:root {
  /* Validated data-viz reference palette (see dataviz skill / references/palette.md) */
  --brand-primary: #184f95;      /* sequential blue, step 600 */
  --brand-primary-dark: #104281; /* sequential blue, step 650 */
  --brand-accent: #2a78d6;       /* sequential blue, step 450 (categorical slot 1) */
  --brand-success: #0ca30c;      /* status: good */
  --brand-warning: #fab219;      /* status: warning */
  --brand-serious: #ec835a;      /* status: serious */
  --brand-danger: #d03b3b;       /* status: critical */
  --ink-primary: #0b0b0b;
  --ink-secondary: #52514e;
  --ink-muted: #898781;
  --gridline: #e1e0d9;

  --surface: #f6f8fb;
  --surface-card: #ffffff;
  --radius-lg: 1rem;
  --radius-md: 0.65rem;
  --shadow-sm: 0 1px 3px rgba(16, 30, 60, 0.06);
  --shadow-md: 0 6px 24px rgba(16, 30, 60, 0.08);
}

* { -webkit-font-smoothing: antialiased; }

body {
  background-color: var(--surface);
  color: var(--ink-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

h1, h2, h3, h4, h5, h6, .fw-bold { letter-spacing: -0.01em; }
.text-muted { color: var(--ink-muted) !important; }

/* ---------------------------------------------------------------------
   Navbar
   ------------------------------------------------------------------- */
.bg-primary-custom {
  background: linear-gradient(135deg, var(--brand-primary) 0%, #123a6e 100%) !important;
}
.navbar { padding-top: 0.6rem; padding-bottom: 0.6rem; }
.navbar-brand { font-size: 1.05rem; letter-spacing: -0.01em; }
.navbar .nav-link {
  font-weight: 500;
  font-size: 0.92rem;
  border-radius: 0.4rem;
  padding-left: 0.7rem !important;
  padding-right: 0.7rem !important;
  transition: background-color 0.15s ease;
}
.navbar .nav-link:hover { background-color: rgba(255, 255, 255, 0.08); }
.navbar .nav-link.active { background-color: rgba(255, 255, 255, 0.14); color: #fff !important; }
.navbar .dropdown-menu { border: none; box-shadow: var(--shadow-md); border-radius: var(--radius-md); overflow: hidden; }
.navbar .dropdown-item { font-size: 0.9rem; padding: 0.5rem 1rem; }
.navbar .dropdown-item:active, .navbar .dropdown-item.active { background-color: var(--brand-accent); }

/* ---------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------- */
.btn { font-weight: 600; letter-spacing: -0.005em; border-radius: 0.55rem; }
.btn-primary {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--brand-primary-dark);
  border-color: var(--brand-primary-dark);
}
.btn-outline-primary { color: var(--brand-primary); border-color: var(--brand-primary); }
.btn-outline-primary:hover { background-color: var(--brand-primary); border-color: var(--brand-primary); }
.btn-lg { border-radius: 0.65rem; }

/* ---------------------------------------------------------------------
   Cards
   ------------------------------------------------------------------- */
.card {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.category-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 1px solid var(--gridline);
  box-shadow: none;
}
.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

/* ---------------------------------------------------------------------
   Badges / pills
   ------------------------------------------------------------------- */
.band-pill {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}
.band-very-superior, .band-superior { background: #e3f3ec; color: #006300; }
.band-high-average, .band-average { background: #e7eefc; color: var(--brand-primary); }
.band-low-average, .band-borderline { background: #fef3de; color: #8a6200; }
.band-extremely-low { background: #fbe4e1; color: #9c2020; }

.badge { font-weight: 600; letter-spacing: 0.01em; border-radius: 0.4rem; padding: 0.4em 0.65em; }

/* ---------------------------------------------------------------------
   Progress / timer
   ------------------------------------------------------------------- */
.progress { height: 0.6rem; border-radius: 999px; background-color: #eceef3; }
.progress-bar { border-radius: 999px; }

.question-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* ---------------------------------------------------------------------
   Test-taking options
   ------------------------------------------------------------------- */
.option-label {
  display: block;
  padding: 0.85rem 1.1rem;
  border: 1.5px solid var(--gridline);
  border-radius: var(--radius-md);
  margin-bottom: 0.6rem;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.option-label:hover {
  background-color: #eef2fb;
  border-color: var(--brand-accent);
}
.option-input:checked + .option-label,
.option-label.selected {
  background-color: #e7eefc;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 1px var(--brand-accent);
}

.eligible-yes { color: var(--brand-success); font-weight: 600; }
.eligible-no { color: var(--ink-muted); }

/* ---------------------------------------------------------------------
   Forms
   ------------------------------------------------------------------- */
.form-control, .form-select {
  border-radius: 0.55rem;
  border-color: var(--gridline);
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 0.2rem rgba(42, 120, 214, 0.15);
}
.form-label { font-weight: 600; font-size: 0.88rem; color: var(--ink-secondary); }

/* ---------------------------------------------------------------------
   Tables
   ------------------------------------------------------------------- */
.table thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  font-weight: 700;
  border-bottom-width: 1px;
  border-color: var(--gridline);
}
.table td { border-color: var(--gridline); vertical-align: middle; }

/* ---------------------------------------------------------------------
   Landing page / hero
   ------------------------------------------------------------------- */
.hero-section {
  background: radial-gradient(circle at top right, #e7eefc 0%, var(--surface) 60%);
  border-radius: var(--radius-lg);
  padding: 3.5rem 2.5rem;
  margin: -1rem -0.25rem 2.5rem;
}
.feature-icon {
  width: 3rem; height: 3rem;
  border-radius: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  background: #e7eefc; color: var(--brand-primary);
  font-size: 1.25rem;
}
.stat-highlight {
  font-size: 2rem;
  font-weight: 800;
  color: var(--brand-primary);
  line-height: 1;
}

/* ---------------------------------------------------------------------
   Empty states
   ------------------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--ink-muted);
}
.empty-state i { font-size: 2.5rem; opacity: 0.4; margin-bottom: 0.75rem; }

footer { border-top: 1px solid var(--gridline); color: var(--ink-muted); }

/* ---------------------------------------------------------------------
   Alerts
   ------------------------------------------------------------------- */
.alert { border: none; border-radius: var(--radius-md); }
