:root {
  color-scheme: light dark;
  --primary-blue: #0A192F;
  --primary-maroon: #7B1E3A;
  --secondary-blue: #1A365D;
  --accent-maroon: #9D2B4A;
  
  /* Light theme variables */
  --bg-gradient: #ffffff;
  --card-bg: #ffffff;
  --card-border: #EFF3F4;
  --text-main: #0F1419;
  --text-muted: #536471;
  --star: #CBD5E1;
  --star-on: #F59E0B;
  --input-bg: #ffffff;
  --input-border: #CFD9DE;
  --input-focus: #1D9BF0;
  --error-bg: #FEE2E2;
  --error-text: #991B1B;
  --success-bg: #DCFCE7;
  --success-text: #166534;
  --btn-bg: #0F1419;
  --btn-hover-bg: #272C30;
  --hover-bg: rgba(15, 20, 25, 0.1);
  --feedback-red-bg: rgba(220, 38, 38, 0.05);
  --feedback-red-hover: rgba(220, 38, 38, 0.1);
  --feedback-yellow-bg: rgba(217, 119, 6, 0.06);
  --feedback-yellow-hover: rgba(217, 119, 6, 0.11);
  --feedback-green-bg: rgba(22, 163, 74, 0.05);
  --feedback-green-hover: rgba(22, 163, 74, 0.1);
  --feedback-red-text: #b91c1c;
  --feedback-yellow-text: #b45309;
  --feedback-green-text: #15803d;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-gradient: #000000;
    --card-bg: #000000;
    --card-border: #2F3336;
    --text-main: #E7E9EA;
    --text-muted: #71767B;
    --star: #334155;
    --star-on: #FBBF24;
    --input-bg: #000000;
    --input-border: #333639;
    --input-focus: #1D9BF0;
    --error-bg: rgba(153, 27, 27, 0.2);
    --error-text: #FCA5A5;
    --success-bg: rgba(22, 101, 52, 0.25);
    --success-text: #86EFAC;
    --btn-bg: #EFF3F4;
    --btn-hover-bg: #D7DBDC;
    --hover-bg: rgba(239, 243, 244, 0.1);
    --feedback-red-bg: rgba(239, 68, 68, 0.08);
    --feedback-red-hover: rgba(239, 68, 68, 0.15);
    --feedback-yellow-bg: rgba(245, 158, 11, 0.08);
    --feedback-yellow-hover: rgba(245, 158, 11, 0.15);
    --feedback-green-bg: rgba(34, 197, 94, 0.08);
    --feedback-green-hover: rgba(34, 197, 94, 0.15);
    --feedback-red-text: #fca5a5;
    --feedback-yellow-text: #fde68a;
    --feedback-green-text: #86efac;
  }
}

* { 
  box-sizing: border-box; 
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main.public {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 40px;
  max-width: 540px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.6s ease-out forwards;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand-header {
  text-align: center;
  margin-bottom: 30px;
}

.brand-logo-img {
  display: block;
  margin: 0 auto 16px;
  max-width: 100%;
  max-height: 80px;
  object-fit: contain;
}

h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 30px;
}

.alert {
  background: var(--error-bg);
  color: var(--error-text);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 24px;
  font-weight: 500;
  border: 1px solid rgba(153, 27, 27, 0.2);
}
.alert ul { margin: 0; padding-left: 20px; }

.alert-success {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: rgba(22, 101, 52, 0.2);
}

fieldset.rating-group {
  border: none;
  padding: 0;
  margin: 0 0 24px;
  background: rgba(0,0,0,0.02);
  border-radius: 12px;
  padding: 16px;
  transition: transform 0.2s ease, background 0.2s ease;
}
@media (prefers-color-scheme: dark) {
  fieldset.rating-group { background: rgba(255,255,255,0.02); }
}

fieldset.rating-group:hover {
  transform: translateY(-2px);
  background: rgba(0,0,0,0.04);
}
@media (prefers-color-scheme: dark) {
  fieldset.rating-group:hover { background: rgba(255,255,255,0.04); }
}

fieldset.rating-group legend {
  font-weight: 600;
  margin-bottom: 8px;
  padding: 0;
  color: var(--text-main);
  width: 100%;
}

.stars {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 8px;
}

.stars input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.stars label {
  font-size: 2.2rem;
  line-height: 1;
  color: var(--star);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.stars input[type="radio"]:checked ~ label,
.stars label:hover,
.stars label:hover ~ label {
  color: var(--star-on);
}

.stars label:hover {
  transform: scale(1.15);
}

.stars input[type="radio"]:focus-visible + label {
  outline: 2px solid var(--accent-maroon);
  outline-offset: 2px;
  border-radius: 4px;
}

.field-group {
  margin-bottom: 24px;
}

.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--text-main); }
.form-row input[type="text"],
.form-row input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  font-size: 1rem;
  color: var(--text-main);
}
.form-row input[type="text"]:focus,
.form-row input[type="password"]:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-main);
}

.required-mark {
  color: #dc2626;
  font-weight: 700;
}

.field-hint {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

select, textarea, input[type="tel"] {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 14px 16px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  color: var(--text-main);
  transition: all 0.2s ease;
}

select:focus, textarea:focus, input[type="tel"]:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

.btn-primary {
  display: block;
  width: 100%;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--bg-gradient);
  background: var(--btn-bg);
  border: none;
  border-radius: 9999px; /* X style rounded buttons */
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: var(--btn-hover-bg);
}

.btn-primary:active {
  transform: translateY(0);
  opacity: 0.9;
}

@media (max-width: 480px) {
  main.public {
    padding: 16px;
  }

  .card {
    padding: 24px 20px;
    border-radius: 18px;
  }

  .stars label {
    padding: 8px;
  }
}

/* Public Header & Breadcrumb */
.public-header {
  width: 100%;
  padding: 16px 20px;
  position: absolute;
  top: 0;
  left: 0;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.breadcrumb ul {
  list-style: none;
  display: flex;
  gap: 8px;
  padding: 0;
  margin: 0;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.breadcrumb li a {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.breadcrumb li a:hover {
  color: var(--input-focus);
}

.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: 8px;
  color: var(--text-muted);
  opacity: 0.5;
}

.login-link {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 16px;
  border-radius: 99px;
  background: var(--hover-bg);
  transition: background 0.2s;
}

.login-link:hover {
  background: var(--card-border);
}

/* Landing Page Grid */
.landing-container {
  max-width: 800px;
  width: 100%;
  margin: 60px auto 0;
  padding: 20px;
}

.landing-header {
  text-align: center;
  margin-bottom: 40px;
}

.branches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.branch-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.branch-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.15);
  border-color: var(--input-focus);
}

.branch-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.branch-name {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-main);
}

.branch-address {
  font-size: 0.9rem;
  color: var(--text-muted);
}
