/* =================================================================
   CadetPass — dark law-enforcement theme
   Independent blue + red spectrums (siren-inspired)
   ================================================================= */

:root {
  /* Backgrounds — concrete / asphalt grays */
  --bg: #1f242b;
  --bg-elev: #272c34;
  --bg-card: #2c323b;
  --bg-card-hover: #343a45;
  --bg-soft: #242932;
  --bg-muted: #3c424d;

  /* Borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* Text */
  --text: #e9ecf3;
  --text-muted: #a9b0bd;
  --text-faint: #6c7385;

  /* Brand spectrum — bases set by user */
  /* Blue spectrum — base #3498db */
  --le-blue-100: #5dade2;   /* lighter — hover */
  --le-blue-300: #3498db;   /* BASE — Peter River */
  --le-blue-500: #2980b9;   /* darker */
  --le-blue-700: #1f618d;   /* deepest */
  --le-blue-glow: rgba(52, 152, 219, 0.55);
  /* Red spectrum — base #c0392b */
  --le-red-100: #e74c3c;    /* lighter — Alizarin */
  --le-red-300: #d04335;    /* medium */
  --le-red-500: #c0392b;    /* BASE — Pomegranate */
  --le-red-700: #922b1e;    /* deepest */
  --le-red-glow: rgba(192, 57, 43, 0.55);
  /* Yellow highlight — for reference-section label text */
  --highlight: #f1c40f;      /* Sun Flower */
  --highlight-soft: rgba(241, 196, 15, 0.14);
  /* Convenience aliases */
  --le-red: var(--le-red-500);
  --le-blue: var(--le-blue-300);
  --accent: var(--le-blue-300);
  --accent-hover: var(--le-blue-100);
  --accent-soft: rgba(52, 152, 219, 0.14);

  /* Semantic */
  --success: #27ae60;                          /* Nephritis */
  --success-soft: rgba(39, 174, 96, 0.14);
  --danger: var(--le-red-500);                 /* tied to red base */
  --danger-soft: rgba(192, 57, 43, 0.14);
  --warning: var(--highlight);                 /* tied to yellow */
  --warning-soft: var(--highlight-soft);

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow-red: 0 0 60px var(--le-red-glow);
  --shadow-glow-blue: 0 0 60px var(--le-blue-glow);

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --max-width: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  /* Independent blue and red gradients */
  --gradient-blue: linear-gradient(135deg, var(--le-blue-100) 0%, var(--le-blue-500) 100%);
  --gradient-blue-soft: linear-gradient(135deg, rgba(93, 173, 226, 0.20) 0%, rgba(41, 128, 185, 0.20) 100%);
  --gradient-red: linear-gradient(135deg, var(--le-red-100) 0%, var(--le-red-700) 100%);
  --gradient-red-soft: linear-gradient(135deg, rgba(231, 76, 60, 0.18) 0%, rgba(146, 43, 30, 0.18) 100%);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

body {
  /* Solid base + tiled noise = concrete. The data URI is a small
     fractalNoise SVG; it tiles seamlessly via stitchTiles. */
  background-color: var(--bg);
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  background-size: 220px 220px;
  background-attachment: fixed;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--accent-hover); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* =================================================================
   Header / Nav
   ================================================================= */

.site-header {
  border-bottom: 1px solid var(--border-strong);
  background: rgba(12, 14, 18, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

/* Brand wordmark with red/blue gradient */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  text-decoration: none;
}
.brand-mark {
  font-weight: 800;
  font-size: 1.18rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}
.brand-tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding-left: 12px;
  border-left: 1px solid var(--border-strong);
}

/* Brand mini-logo (badge) — small siren-glow shield */
.brand-shield {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--gradient-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  box-shadow: 0 0 24px rgba(63, 116, 255, 0.45);
}

.site-nav {
  display: flex;
  gap: 28px;
}
.site-nav a {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  position: relative;
  padding-bottom: 4px;
}
.site-nav a:hover { color: var(--accent-hover); }
.site-nav a.active {
  color: var(--accent);
}
.site-nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -22px;
  height: 2px;
  background: var(--gradient-blue);
}

/* =================================================================
   Hero (homepage)
   ================================================================= */

.hero {
  padding: 80px 0 56px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 48px;
  align-items: start;
  isolation: isolate;
}
/* Full-bleed blueprint hero background — extends edge-to-edge while
   content stays constrained to .container. Sits behind everything via
   isolated z-index. */
.hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 100vw;
  height: 100%;
  transform: translateX(-50%);
  background-image: url("../img/hero-bg.svg");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: -1;
  pointer-events: none;
}
/* Soft fade at the bottom so the hero blends into the page below. */
.hero::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100vw;
  height: 96px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(31, 36, 43, 0) 0%, var(--bg) 100%);
  z-index: -1;
  pointer-events: none;
}
.hero-content { min-width: 0; position: relative; }
.hero-pricing {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}
/* Hero accent removed — concrete background reads on its own. */
.hero-eyebrow {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  margin-bottom: 24px;
}
/* Police lightbar — red/white/blue strobe loop. The dot itself shifts color
   while a halo flashes outward in matching color. Cycle is fast (1.2s) so
   it reads as a real emergency light rather than a slow heartbeat pulse. */
.hero-eyebrow .pulse {
  position: relative;
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c0392b;
  animation: police-dot 1.2s steps(1, end) infinite;
}
.hero-eyebrow .pulse::before,
.hero-eyebrow .pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}
.hero-eyebrow .pulse::before {
  animation: police-halo 1.2s linear infinite;
}
.hero-eyebrow .pulse::after {
  background: #fff;
  opacity: 0;
  animation: police-flash 1.2s linear infinite;
}
@keyframes police-dot {
  0%   { background: #c0392b; box-shadow: 0 0 6px 1px rgba(192, 57, 43, 0.85); }
  35%  { background: #c0392b; box-shadow: 0 0 8px 1px rgba(192, 57, 43, 0.95); }
  45%  { background: #ffffff; box-shadow: 0 0 12px 3px rgba(255, 255, 255, 0.9); }
  50%  { background: #3498db; box-shadow: 0 0 6px 1px rgba(52, 152, 219, 0.85); }
  85%  { background: #3498db; box-shadow: 0 0 8px 1px rgba(52, 152, 219, 0.95); }
  95%  { background: #ffffff; box-shadow: 0 0 12px 3px rgba(255, 255, 255, 0.9); }
  100% { background: #c0392b; box-shadow: 0 0 6px 1px rgba(192, 57, 43, 0.85); }
}
@keyframes police-halo {
  0%   { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.55); }
  40%  { box-shadow: 0 0 0 10px rgba(192, 57, 43, 0); }
  50%  { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.55); }
  90%  { box-shadow: 0 0 0 10px rgba(52, 152, 219, 0); }
  100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.55); }
}
@keyframes police-flash {
  0%, 42%, 50%, 92%, 100% { opacity: 0; }
  44%, 46% { opacity: 0.9; }
  94%, 96% { opacity: 0.9; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-eyebrow .pulse,
  .hero-eyebrow .pulse::before,
  .hero-eyebrow .pulse::after {
    animation: none;
  }
  .hero-eyebrow .pulse {
    background: #c0392b;
    box-shadow: 0 0 6px 1px rgba(192, 57, 43, 0.85);
  }
}

.hero h1 {
  position: relative;
  z-index: 1;
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  font-weight: 800;
  max-width: 100%;
}
.hero h1 .accent {
  background: var(--gradient-blue);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.lede {
  position: relative;
  z-index: 1;
  font-size: 1.06rem;
  color: var(--text-muted);
  margin: 0 0 28px;
  max-width: 640px;
}

.hero-cta {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* =================================================================
   Buttons
   ================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.94rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease,
    transform 0.12s ease, box-shadow 0.18s ease;
  text-decoration: none;
  font-family: inherit;
  background: transparent;
  color: var(--text);
  letter-spacing: 0.005em;
}
.btn-primary {
  background: var(--gradient-blue);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 30px rgba(63, 116, 255, 0.25);
}
.btn-primary:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 36px rgba(63, 116, 255, 0.35);
}
.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent);
  color: var(--text);
}
.btn-sm {
  padding: 8px 14px;
  font-size: 0.86rem;
}
.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* =================================================================
   Section heading
   ================================================================= */

.section-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  font-weight: 700;
  margin: 0 0 20px;
}

/* =================================================================
   Section card grid (homepage)
   ================================================================= */

.sections {
  padding: 36px 0 56px;
  position: relative;
  z-index: 1;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 24px 22px;
  background: var(--bg-card);
  transition: border-color 0.15s ease, transform 0.18s ease, box-shadow 0.18s ease,
    background 0.15s ease;
  color: var(--text);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-blue);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.card-active:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.card-active:hover::before {
  opacity: 1;
}
.card h3 {
  margin: 10px 0 8px;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.card p {
  color: var(--text-muted);
  margin: 0 0 16px;
  font-size: 0.93rem;
  line-height: 1.55;
}
.card-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.card-active .card-tag {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(61, 220, 132, 0.25);
}
.card-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.card-meta {
  display: flex;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-faint);
  flex-wrap: wrap;
  align-items: center;
}
.card-meta span:not(:last-child)::after {
  content: "·";
  margin-left: 10px;
  color: var(--text-faint);
}

/* =================================================================
   Features (homepage)
   ================================================================= */

.about { padding: 48px 0; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
}
.feature {
  padding: 24px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}
.feature h4 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.feature p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* =================================================================
   Disclaimer
   ================================================================= */

.disclaimer {
  margin: 32px 0 64px;
  padding: 18px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text-muted);
}
.disclaimer strong { color: var(--text); }

/* =================================================================
   Footer
   ================================================================= */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  font-size: 0.85rem;
  color: var(--text-faint);
  background: var(--bg-soft);
}

/* =================================================================
   Test / Section page
   ================================================================= */

/* Test header — section title block. Hidden when in quiz / glossary / results. */
.test-header {
  padding: 56px 0 24px;
}
.test-header .eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 700;
}
.test-header h1 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.015em;
  margin: 8px 0 8px;
  color: var(--text);
  font-weight: 800;
}
.test-header p {
  color: var(--text-muted);
  margin: 0;
  max-width: 680px;
}

/* When body has a "is-running" or "is-glossary" or "is-results" class, hide the test-header. */
body.is-running .test-header,
body.is-glossary .test-header,
body.is-results .test-header {
  display: none;
}

/* Configuration panel */
.config-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin: 24px 0 32px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}
.config-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 36px;
  align-items: flex-start;
}
.config-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 200px;
}
.config-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-faint);
}
.toggle-group {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elev);
}
.toggle-btn {
  padding: 9px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
  font-weight: 500;
}
.toggle-btn:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.toggle-btn.is-active {
  background: var(--gradient-blue);
  color: #fff;
  font-weight: 600;
}
.config-help {
  font-size: 0.85rem;
  color: var(--text-faint);
  margin-top: 4px;
}
.config-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* Form controls */
select, input[type="number"], input[type="search"] {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 0.94rem;
  font-family: inherit;
  background: var(--bg-elev);
  color: var(--text);
  min-width: 200px;
  transition: border-color 0.15s ease;
}
select:focus, input[type="search"]:focus, input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
}

/* Quiz container */
.quiz {
  margin: 32px 0;
  display: none;
}
.quiz.is-active { display: block; }

.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.86rem;
  color: var(--text-muted);
}
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-muted);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 28px;
}
.progress-fill {
  height: 100%;
  background: var(--gradient-blue);
  border-radius: var(--radius-pill);
  width: 0%;
  transition: width 0.25s ease;
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.q-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.chip {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--bg-muted);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.chip-accent {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(77, 141, 246, 0.3);
}

.q-text {
  font-size: 1.1rem;
  line-height: 1.55;
  margin: 0 0 22px;
  color: var(--text);
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  font-size: 0.96rem;
  background: var(--bg-elev);
  user-select: none;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  width: 100%;
}
.choice:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.02);
}
.choice .choice-letter {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-muted);
  color: var(--text-muted);
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-top: 1px;
  border: 1px solid var(--border);
}
.choice.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.choice.is-selected .choice-letter {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.choice.is-correct {
  border-color: var(--success);
  background: var(--success-soft);
}
.choice.is-correct .choice-letter {
  background: var(--success);
  color: #1f242b;
  border-color: var(--success);
}
.choice.is-incorrect {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.choice.is-incorrect .choice-letter {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.choice[disabled] { cursor: default; }
.choice[disabled]:hover { background: var(--bg-elev); }

/* Explanation block */
.explanation {
  margin-top: 22px;
  padding: 18px 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
}
.explanation .exp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.exp-status {
  font-weight: 700;
}
.exp-status.correct { color: var(--success); }
.exp-status.incorrect { color: var(--danger); }
.exp-statute {
  font-size: 0.8rem;
  color: var(--text-faint);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.explanation p { margin: 8px 0 0; color: var(--text); }
.elements-list {
  margin: 12px 0 0;
  padding-left: 22px;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.elements-list li { margin: 3px 0; }

.q-actions {
  margin-top: 22px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* =================================================================
   Results
   ================================================================= */

.results {
  display: none;
  margin: 32px 0 64px;
}
.results.is-active { display: block; }

.results-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}
.score-headline {
  text-align: center;
  margin-bottom: 24px;
}
.score-num {
  font-size: 3.4rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
  background: var(--gradient-blue);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.score-pct {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 8px;
}
.score-pass {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.score-pass.pass {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(61, 220, 132, 0.3);
}
.score-pass.fail {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(255, 92, 92, 0.3);
}

.results-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.review { margin-top: 32px; }
.review h3 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  font-weight: 700;
  margin: 0 0 12px;
}
.review-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  font-size: 0.93rem;
  background: var(--bg-elev);
}
.review-item .ri-q { font-weight: 600; margin-bottom: 8px; }
.review-item .ri-row { display: flex; gap: 14px; margin: 4px 0; font-size: 0.88rem; }
.review-item .ri-row .label { color: var(--text-faint); min-width: 90px; }
.review-item .ri-correct { color: var(--success); }
.review-item .ri-incorrect { color: var(--danger); }
.review-item .ri-statute {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--text-faint);
  font-size: 0.8rem;
  margin-top: 6px;
}
.review-item .ri-explanation {
  margin-top: 8px;
  color: var(--text-muted);
}

/* =================================================================
   History
   ================================================================= */

.history {
  margin: 16px 0 0;
  padding: 18px 20px;
  background: var(--bg-elev);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}
.history h4 {
  margin: 0 0 10px;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  font-weight: 700;
}
.history ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.history li {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}
.history li strong { color: var(--text); }

/* =================================================================
   Definitions buttons & glossary
   ================================================================= */

.def-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-strong);
  align-items: center;
}
.def-actions .btn { font-size: 0.86rem; padding: 8px 14px; }
.def-actions-hint {
  width: 100%;
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-top: 4px;
}

.glossary { margin: 24px 0 64px; }
.glossary-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.glossary-header h2 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  background: var(--gradient-blue);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.glossary-header .gloss-meta {
  color: var(--text-faint);
  font-size: 0.86rem;
}
.glossary-search { flex: 1 1 240px; max-width: 360px; }
.glossary-search input { width: 100%; }
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.gloss-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: var(--bg-card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.18s ease;
}
.gloss-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.gloss-item h4 {
  margin: 0 0 4px;
  font-size: 1rem;
  color: var(--text);
}
.gloss-item .gloss-stat {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 8px;
}
.gloss-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.91rem;
  line-height: 1.55;
}

/* =================================================================
   Statute card (inline below explanation)
   ================================================================= */

.statute-card {
  margin-top: 18px;
  padding: 20px 22px 18px;
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.55;
  border: 1px solid var(--border);
  border-left: 3px solid var(--highlight);
}
.statute-card .sc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.statute-card .sc-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--highlight);
  font-weight: 700;
}
.statute-card .sc-badge {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(77, 141, 246, 0.32);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}
.statute-card .sc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px 28px;
  margin-bottom: 14px;
}
.statute-card .sc-col-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  font-weight: 700;
  margin-bottom: 4px;
}
.statute-card .sc-col-value {
  color: var(--text);
  font-weight: 600;
  font-size: 0.96rem;
}
.statute-card .sc-desc {
  margin: 0 0 14px;
  color: var(--text-muted);
}
.statute-card .sc-enh-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--highlight);
  font-weight: 700;
  margin-bottom: 8px;
}
.statute-card .sc-enh-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.statute-card .sc-enh-table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  padding: 6px 10px 6px 0;
  border-bottom: 1px solid var(--border);
}
.statute-card .sc-enh-table th:last-child { text-align: right; }
.statute-card .sc-enh-table td {
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-muted);
}
.statute-card .sc-enh-table td:nth-child(2) {
  color: var(--text);
  font-weight: 600;
}
.statute-card .sc-enh-stat {
  text-align: right;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--text-faint);
  white-space: nowrap;
}
.statute-card .sc-enh-table tr:last-child td { border-bottom: none; }

/* =================================================================
   Responsive
   ================================================================= */

@media (max-width: 700px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 14px 0; gap: 14px; }
  .site-nav { gap: 16px; flex-wrap: wrap; }
  .hero { padding: 48px 0 32px; }
  .test-header { padding: 32px 0 16px; }
  .question-card { padding: 22px 18px; }
  .results-card { padding: 24px 20px; }
  .config-row { gap: 18px; }
  .config-group { min-width: 0; flex: 1 1 100%; }
  select, input[type="search"] { width: 100%; }
}

/* =================================================================
   CadetPass split-color wordmark (blue + red, independent spectrums)
   ================================================================= */
.brand-mark {
  /* The wordmark is built from two spans — one blue, one red. */
  background: none;
  -webkit-text-fill-color: initial;
  color: var(--text);
}
.brand-mark .word-blue {
  background: var(--gradient-blue);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-mark .word-red {
  background: var(--gradient-red);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Shield uses red gradient now (the wordmark already has blue/red split). */
.brand-shield {
  background: var(--gradient-red);
  box-shadow: 0 0 24px rgba(230, 57, 70, 0.45);
}

/* Utility classes for headings that should pick a single spectrum */
.text-blue {
  background: var(--gradient-blue);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.text-red {
  background: var(--gradient-red);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* =================================================================
   Override block: blue-primary, red as seasoning only
   ================================================================= */

/* Wordmark: "Cadet" white + "Pass" solid blue. Both rendered as solid
   colors (no gradient text-clipping) so anti-aliasing is identical and
   the two halves read the same weight and visual size. */
.brand-mark .word-blue,
.brand-mark .word-red {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: initial;
  font-weight: inherit;
  font-size: inherit;
  letter-spacing: inherit;
}
.brand-mark .word-blue { color: var(--text); }       /* CADET — white */
.brand-mark .word-red  { color: var(--le-blue-100); } /* PASS  — blue */

/* Brand shield returns to blue (red was too loud). */
.brand-shield {
  background: var(--gradient-blue);
  box-shadow: 0 0 24px rgba(63, 116, 255, 0.45);
}

/* =================================================================
   Pricing page
   ================================================================= */

.pricing-hero {
  padding: 64px 0 12px;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}
.pricing-hero h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  font-weight: 800;
  line-height: 1.15;
}
.pricing-hero .lede {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 auto;
}

.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 18px;
  margin: 48px 0 32px;
  align-items: stretch;
}

.tier {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px 24px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.tier:hover {
  border-color: var(--border-strong);
}
.tier.is-featured {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-md);
  transform: translateY(-4px);
}
.tier-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-blue);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}
.tier-title {
  font-size: 1.08rem;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.005em;
  color: var(--text);
}
.tier-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 22px;
  min-height: 2.6em;
  line-height: 1.4;
}
.tier-price {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
  margin-bottom: 4px;
  color: var(--text);
}
.tier-price .tier-price-from {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: block;
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}
.tier-period {
  color: var(--text-faint);
  font-size: 0.86rem;
  margin-bottom: 22px;
}
.tier-bullets {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.tier-bullets li {
  font-size: 0.92rem;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.5;
}
.tier-bullets li::before {
  content: "";
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.5L6.5 11.5L12.5 5' stroke='%2327ae60' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  margin-top: 3px;
}
.tier .btn {
  width: 100%;
}

/* Affiliation disclaimer block (used on pricing page and footer) */
.affiliation-note {
  margin: 32px 0 56px;
  padding: 18px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--highlight);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.affiliation-note strong { color: var(--text); }

@media (max-width: 700px) {
  .pricing-hero { padding: 32px 0 8px; }
  .tier-grid { gap: 14px; margin: 36px 0 24px; }
  .tier { padding: 24px 20px 20px; }
  .tier.is-featured { transform: none; }   /* don't stack-shift on mobile */
}

/* Pricing preview on homepage */
.pricing-preview {
  padding: 36px 0 56px;
}
.pricing-preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.pricing-preview-head .section-title { margin: 0; }
.pricing-preview-link {
  font-size: 0.88rem;
  color: var(--accent);
  font-weight: 600;
}
.pricing-preview-link:hover { color: var(--accent-hover); }
.pricing-preview .tier-grid {
  margin-top: 32px;
}


/* =================================================================
   Hero pricing rail — compact stacked tier cards
   ================================================================= */
.tier-mini {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.tier-mini:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
  color: var(--text);
  transform: translateY(-1px);
}
.tier-mini.is-featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  background: var(--bg-card-hover);
}
.tier-mini .tm-name {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tier-mini .tm-badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--gradient-blue);
  color: #fff;
}
.tier-mini .tm-meta {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-top: 2px;
}
.tier-mini .tm-price {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  text-align: right;
  color: var(--text);
  white-space: nowrap;
}
.tier-mini .tm-price .tm-price-from {
  display: block;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: -2px;
}
.tier-mini .tm-cta {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
}
.tier-mini.is-featured .tm-cta {
  background: var(--gradient-blue);
  border-color: transparent;
  color: #fff;
}
.tier-mini .tm-cta:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent);
  color: var(--text);
}
.tier-mini.is-featured .tm-cta:hover {
  filter: brightness(1.05);
  color: #fff;
}

.hero-pricing-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.hero-pricing-head .section-title { margin: 0; }
.hero-pricing-link {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
}
.hero-pricing-link:hover { color: var(--accent-hover); }

/* ---- Soft paywall modal -------------------------------------- */
.paywall-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 10, 14, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.paywall-modal.is-open {
  display: flex;
  animation: paywall-fade 0.18s ease-out;
}
@keyframes paywall-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
body.is-paywalled {
  overflow: hidden;
}
.paywall-card {
  width: 100%;
  max-width: 520px;
  background: var(--surface-2, #1a1f27);
  border: 1px solid var(--border-strong, rgba(255,255,255,0.10));
  border-radius: var(--radius-lg, 14px);
  padding: 28px 28px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(52,152,219,0.18);
  animation: paywall-pop 0.22s cubic-bezier(.2,.8,.2,1);
}
@keyframes paywall-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.paywall-eyebrow {
  display: inline-block;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--highlight, #f1c40f);
  font-weight: 700;
  margin-bottom: 10px;
}
.paywall-title {
  font-size: 1.45rem;
  line-height: 1.2;
  margin: 0 0 12px;
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.paywall-body {
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--text-soft, rgba(255,255,255,0.78));
  margin: 0 0 16px;
}
.paywall-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  display: grid;
  gap: 8px;
}
.paywall-bullets li {
  position: relative;
  padding-left: 22px;
  font-size: 0.92rem;
  color: var(--text-soft, rgba(255,255,255,0.78));
}
.paywall-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent, #3498db);
  box-shadow: 0 0 0 3px rgba(52,152,219,0.18);
}
.paywall-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.paywall-ctas .btn {
  flex: 1 1 auto;
  text-align: center;
  justify-content: center;
}
.paywall-foot {
  display: flex;
  justify-content: center;
  padding-top: 4px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.06));
  margin-top: 8px;
}
.paywall-back {
  background: none;
  border: 0;
  padding: 10px 14px;
  font-size: 0.84rem;
  color: var(--text-faint, rgba(255,255,255,0.55));
  cursor: pointer;
  font-weight: 500;
  transition: color 0.15s ease;
}
.paywall-back:hover {
  color: var(--text);
  text-decoration: underline;
}

@media (max-width: 540px) {
  .paywall-card {
    padding: 22px 20px 18px;
  }
  .paywall-title {
    font-size: 1.25rem;
  }
  .paywall-ctas {
    flex-direction: column;
  }
}

/* ---- Featured "Full Exam" card on homepage ----------------------- */
.card.card-featured {
  position: relative;
  grid-column: 1 / -1;
  background:
    linear-gradient(135deg, rgba(52, 152, 219, 0.16), rgba(52, 152, 219, 0.04)),
    var(--surface-2, #1a1f27);
  border-color: rgba(52, 152, 219, 0.45);
  box-shadow:
    0 0 0 1px rgba(52, 152, 219, 0.25) inset,
    0 12px 32px rgba(0, 0, 0, 0.35);
}
.card.card-featured h3 {
  font-size: 1.25rem;
}
.card.card-featured::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%);
}
.card.card-featured:hover {
  border-color: rgba(52, 152, 219, 0.7);
  transform: translateY(-1px);
}
.card-tag.card-tag-hot {
  background: linear-gradient(90deg, var(--le-blue-500, #2980b9), var(--le-blue-300, #3498db));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.06em;
  border: none;
}

/* ---- Registration gate form (inside .paywall-card) ----------------- */
.register-form {
  display: block;
  margin-bottom: 4px;
}
.register-label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-faint, rgba(255, 255, 255, 0.55));
  margin-bottom: 6px;
}
.register-input {
  display: block;
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-strong, rgba(255, 255, 255, 0.16));
  border-radius: var(--radius-sm, 6px);
  color: var(--text);
  font-size: 0.96rem;
  padding: 10px 14px;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
  margin-bottom: 8px;
  box-sizing: border-box;
}
.register-input:focus {
  outline: none;
  border-color: var(--accent, #3498db);
  background: rgba(52, 152, 219, 0.06);
}
.register-input::placeholder {
  color: rgba(255, 255, 255, 0.30);
}
.register-support {
  font-size: 0.82rem;
  color: var(--text-faint, rgba(255, 255, 255, 0.55));
  margin-bottom: 14px;
}
.register-error {
  font-size: 0.84rem;
  color: var(--le-red-100, #e74c3c);
  min-height: 1.2em;
  margin-top: 8px;
}
.register-error:empty { display: none; }

.paywall-modal--register .paywall-card {
  max-width: 480px;
}
.paywall-modal--register .paywall-bullets {
  margin-bottom: 18px;
}

/* ---- Free Practice Pass tier styling ----------------------- */
.tier.tier-free {
  border-style: dashed;
  border-color: var(--border-strong, rgba(255,255,255,0.16));
  background: rgba(255, 255, 255, 0.015);
}
.tier.tier-free .tier-period {
  color: var(--success, #27ae60);
  font-weight: 600;
}
.tier-bullets .tier-bullet-muted {
  color: var(--text-faint, #6c7385);
  position: relative;
}
.tier-bullets .tier-bullet-muted em {
  font-style: normal;
  color: var(--accent, #3498db);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---- Group / academy section (Class Pack) ------------------ */
.group-pricing {
  margin: 56px 0 32px;
  padding-top: 40px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
}
.group-pricing-head {
  margin-bottom: 22px;
}
.group-pricing-head .section-title {
  margin: 0 0 6px;
  font-size: 1.25rem;
}
.group-pricing-lede {
  color: var(--text-muted, #a9b0bd);
  font-size: 0.96rem;
  margin: 0;
}
.tier.tier-wide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 36px;
  align-items: center;
  padding: 28px;
}
.tier-wide-main h3.tier-title {
  margin-top: 0;
  font-size: 1.15rem;
}
.tier-wide-aside {
  text-align: right;
  border-left: 1px solid var(--border, rgba(255,255,255,0.08));
  padding-left: 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}
.tier-wide-aside .btn {
  margin-top: 6px;
}
.tier-bullets-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  padding: 0;
  list-style: none;
  margin: 14px 0 0;
}
.tier-bullets-inline li {
  position: relative;
  padding-left: 16px;
  font-size: 0.9rem;
  color: var(--text-muted, #a9b0bd);
}
.tier-bullets-inline li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, #3498db);
  opacity: 0.55;
}
@media (max-width: 760px) {
  .tier.tier-wide {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .tier-wide-aside {
    border-left: 0;
    border-top: 1px solid var(--border, rgba(255,255,255,0.08));
    padding-left: 0;
    padding-top: 16px;
    text-align: left;
    align-items: flex-start;
  }
}

/* ---- Free Practice Pass tier-mini (hero rail) -------------------- */
.tier-mini.tier-mini-free {
  border-style: dashed;
}
.tier-mini.tier-mini-free .tm-price {
  color: var(--success, #27ae60);
}
.tier-mini.tier-mini-free .tm-cta {
  border-color: var(--success, #27ae60);
  color: var(--success, #27ae60);
}
.tier-mini.tier-mini-free .tm-cta:hover {
  background: rgba(39, 174, 96, 0.08);
  color: var(--text);
}

/* =================================================================
   Study pages (SEO-exposed content)
   ================================================================= */
.study-crumbs {
  padding: 18px 24px 0;
  font-size: 0.86rem;
  color: var(--text-faint);
}
.study-crumbs ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
}
.study-crumbs li + li::before {
  content: "›";
  margin: 0 8px;
  color: var(--text-faint);
}
.study-crumbs a { color: var(--accent); }
.study-crumbs a:hover { color: var(--accent-hover); }
.study-crumbs li[aria-current="page"] { color: var(--text); }

.study-article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 48px;
  align-items: start;
  padding: 28px 24px 64px;
}
@media (max-width: 920px) {
  .study-article { grid-template-columns: 1fr; gap: 32px; }
}

.study-eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 6px;
}
.study-title {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 0 0 18px;
  color: var(--text);
  font-weight: 800;
}
.study-overview p {
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.65;
  margin: 0 0 14px;
  max-width: 720px;
}
.study-elements {
  margin: 28px 0 24px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: rgba(52, 152, 219, 0.04);
}
.study-elements h2 {
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
  font-weight: 700;
}
.study-elements ul { margin: 0; padding-left: 20px; }
.study-elements li { color: var(--text); margin: 4px 0; }

/* Statute card on study pages */
.study-statute-card {
  margin: 24px 0;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--highlight);
  border-radius: var(--radius);
  padding: 18px 22px;
  background: var(--bg-soft);
}
.ssc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.ssc-label {
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--highlight);
  font-weight: 700;
}
.ssc-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(241, 196, 15, 0.12);
  color: var(--highlight);
}
.ssc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 12px;
}
@media (max-width: 640px) { .ssc-grid { grid-template-columns: 1fr; } }
.ssc-col-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 4px;
}
.ssc-col-value { color: var(--text); font-weight: 600; font-size: 0.96rem; }
.ssc-desc { color: var(--text-muted); margin: 8px 0 12px; line-height: 1.6; }
.ssc-enh-title {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 12px 0 6px;
  font-weight: 700;
}
.ssc-enh-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.ssc-enh-table th, .ssc-enh-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  color: var(--text);
}
.ssc-enh-table th {
  color: var(--text-faint);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ssc-enh-stat { color: var(--accent); white-space: nowrap; font-size: 0.88rem; }

/* CTA bridge from study content to gated practice */
.study-cta-bridge { margin: 30px 0 26px; }
.study-cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 22px 26px;
  border: 1px solid rgba(52, 152, 219, 0.45);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.16), rgba(52, 152, 219, 0.04)), var(--bg-soft);
}
.study-cta-text h3 { margin: 0 0 4px; font-size: 1.08rem; color: var(--text); }
.study-cta-text p  { margin: 0; color: var(--text-muted); font-size: 0.94rem; max-width: 540px; }

/* Worked-example questions */
.study-examples { margin: 30px 0; }
.study-examples h2 { font-size: 1.15rem; color: var(--text); margin: 0 0 14px; }
.study-q {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 16px;
  background: var(--bg-soft);
}
.study-q-num {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 4px;
}
.study-q-text { font-size: 1.02rem; color: var(--text); margin: 0 0 10px; line-height: 1.5; }
.study-q-choices { margin: 8px 0 12px; padding-left: 24px; color: var(--text-muted); }
.study-q-choices li { padding: 4px 0; }
.study-q-choices li.is-correct { color: var(--success); font-weight: 600; }
.study-q-tag {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(39, 174, 96, 0.15);
  color: var(--success);
}
.study-q-exp {
  margin-top: 10px;
  padding: 12px 14px;
  border-left: 2px solid var(--accent);
  background: rgba(52, 152, 219, 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
  font-size: 0.94rem;
  line-height: 1.55;
}
.study-q-exp strong { color: var(--accent); }
.study-q-cite {
  margin-top: 10px;
  font-size: 0.84rem;
  color: var(--text-faint);
}
.study-q-cite span { color: var(--text); }

/* Statutory definitions block */
.study-defs { margin: 30px 0; }
.study-defs h3 { font-size: 1.08rem; color: var(--text); margin: 0 0 12px; }
.study-defs dl { margin: 0; }
.study-defs dt {
  font-weight: 600;
  color: var(--text);
  margin: 12px 0 4px;
  font-size: 0.96rem;
}
.study-defs dt span {
  color: var(--text-faint);
  font-weight: 500;
  font-size: 0.84rem;
  margin-left: 8px;
}
.study-defs dd {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 0.94rem;
  padding-left: 0;
  line-height: 1.55;
}

/* Related-topics sidebar */
.study-related {
  position: sticky;
  top: 96px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: var(--bg-soft);
}
.study-related h3 {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 10px;
  font-weight: 700;
}
.study-related ul { margin: 0; padding: 0; list-style: none; }
.study-related li { border-bottom: 1px solid var(--border); }
.study-related li:last-child { border-bottom: 0; }
.study-related a {
  display: block;
  padding: 10px 0;
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 500;
}
.study-related a span {
  display: block;
  color: var(--text-faint);
  font-size: 0.78rem;
  font-weight: 400;
  margin-top: 2px;
}
.study-related a:hover { color: var(--accent); }

/* Section index pages */
.study-section-index, .study-index { padding: 40px 24px 64px; }
.study-section-header { margin-bottom: 28px; }
.study-section-header h1 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin: 0 0 8px;
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.015em;
}
.study-section-header p {
  color: var(--text-muted);
  margin: 0;
  max-width: 720px;
  font-size: 1rem;
}
.study-topic-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.study-topic-list a {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.study-topic-list a:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  background: var(--bg-card);
}
.study-topic-list .stl-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 0.96rem;
}
.study-topic-list .stl-meta {
  font-size: 0.82rem;
  color: var(--text-faint);
}

/* Top-level /study/ landing */
.study-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.study-section-card {
  display: flex;
  flex-direction: column;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.study-section-card:hover { border-color: var(--accent); transform: translateY(-1px); color: var(--text); }
.study-section-card h2 { margin: 0 0 6px; font-size: 1.15rem; color: var(--text); }
.study-section-card .ssg-meta { color: var(--text-faint); font-size: 0.86rem; margin-bottom: 12px; }
.study-section-card .ssg-preview {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  flex: 1;
}
.study-section-card .ssg-preview li {
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
}
.study-section-card .ssg-preview li:last-child { border-bottom: 0; }
.study-section-card .ssg-cta {
  font-size: 0.86rem;
  color: var(--accent);
  font-weight: 600;
}

/* ---- Soft-launch beta banner (pricing page) -------------------- */
.launch-banner {
  margin: 12px 0 28px;
  padding: 14px 18px;
  border: 1px solid rgba(241, 196, 15, 0.32);
  background: rgba(241, 196, 15, 0.06);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.94rem;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
}
.launch-banner strong {
  color: var(--highlight);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.launch-banner span {
  color: var(--text-muted);
}

/* ---- Legal / About / Contact / 404 page templates ----------------- */
.legal-page, .text-page {
  max-width: 760px;
  padding: 32px 24px 64px;
}
.legal-header { margin-bottom: 28px; }
.legal-header h1 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin: 0 0 6px;
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.015em;
}
.legal-meta {
  margin: 0;
  color: var(--text-faint);
  font-size: 0.9rem;
}
.legal-page section, .text-page section { margin: 28px 0; }
.legal-page h2, .text-page h2 {
  font-size: 1.1rem;
  margin: 0 0 8px;
  color: var(--text);
  font-weight: 700;
}
.legal-page h3, .text-page h3 {
  font-size: 1rem;
  margin: 18px 0 6px;
  color: var(--text);
  font-weight: 600;
}
.legal-page p, .text-page p, .legal-page li, .text-page li {
  color: var(--text-muted);
  line-height: 1.65;
}
.legal-page ul, .legal-page ol, .text-page ul, .text-page ol { padding-left: 22px; }
.legal-page strong, .text-page strong { color: var(--text); }
.legal-page a, .text-page a { color: var(--accent); }
.legal-page a:hover, .text-page a:hover { color: var(--accent-hover); }
.legal-page code, .text-page code {
  background: rgba(255,255,255,0.05);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--text);
}
.legal-disclaimer-foot {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 0.88rem;
}

/* ---- Contact form ---- */
.contact-form {
  display: grid;
  gap: 12px;
  max-width: 540px;
  margin-top: 14px;
}
.contact-form label {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-faint);
  margin-bottom: -6px;
}
.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.96rem;
  padding: 10px 14px;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
  box-sizing: border-box;
}
.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(52, 152, 219, 0.06);
}
.contact-form textarea { resize: vertical; }
.contact-form button { justify-self: start; margin-top: 6px; }
.contact-direct {
  font-size: 1.15rem;
  font-weight: 600;
}

/* ---- 404 page ---- */
.not-found {
  padding: 64px 24px 80px;
  max-width: 720px;
}
.nf-eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 6px;
}
.nf-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin: 0 0 12px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--text);
}
.nf-body {
  color: var(--text-muted);
  font-size: 1.02rem;
  margin: 0 0 22px;
  max-width: 560px;
}
.nf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}
.nf-suggestions {
  border-top: 1px solid var(--border);
  padding-top: 22px;
}
.nf-suggestions h2 {
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 12px;
  font-weight: 700;
}
.nf-suggestions ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}
.nf-suggestions a {
  color: var(--text);
  font-size: 0.94rem;
}
.nf-suggestions a:hover { color: var(--accent); }

/* ---- Site footer (multi-column) ----------------------------------- */
.site-footer {
  margin-top: 64px;
  padding: 48px 0 28px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 36px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-brand-col { grid-column: 1 / -1; }
}
@media (max-width: 460px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-brand-col .brand { margin-bottom: 8px; }
.footer-tag {
  color: var(--text-faint);
  font-size: 0.92rem;
  max-width: 260px;
  margin: 4px 0 0;
  line-height: 1.5;
}
.footer-col h4 {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-faint);
  margin: 0 0 12px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { padding: 4px 0; }
.footer-col a {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  padding-top: 22px;
  text-align: center;
}
.footer-bottom p {
  color: var(--text-faint);
  font-size: 0.86rem;
  margin: 0;
}

/* ---- Welcome / Access page (post-payment + magic-link landing) ----- */
.welcome-page { padding: 64px 24px 80px; }
.welcome-card {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
}
.welcome-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(52, 152, 219, 0.10);
  color: var(--accent);
  margin: 0 auto 18px;
}
.welcome-eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 6px;
}
.welcome-title {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0 0 14px;
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.welcome-body {
  color: var(--text-muted);
  margin: 0 0 22px;
  font-size: 1rem;
  line-height: 1.6;
}
.welcome-body strong { color: var(--text); }
.welcome-tips {
  text-align: left;
  margin: 22px 0;
  padding: 18px 22px;
  background: rgba(255,255,255,0.02);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}
.welcome-tips h2 {
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
  font-weight: 700;
}
.welcome-tips ul { margin: 0; padding-left: 20px; }
.welcome-tips li { color: var(--text-muted); margin: 4px 0; }
.welcome-hint {
  color: var(--text-faint);
  font-size: 0.92rem;
  margin: 18px 0 24px;
}
.welcome-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---- License badge (paid-user signal in test pages) ---------------- */
.license-badge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 0 0 18px;
  padding: 10px 16px;
  background: linear-gradient(90deg, rgba(39, 174, 96, 0.10), rgba(52, 152, 219, 0.06));
  border: 1px solid rgba(39, 174, 96, 0.30);
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
}
.license-badge-plan {
  color: var(--success);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.license-badge-meta {
  color: var(--text-muted);
  flex: 1 1 auto;
  font-size: 0.84rem;
}
.license-badge-signout {
  background: none;
  border: 0;
  color: var(--text-faint);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 4px 8px;
  text-decoration: underline;
  font-weight: 500;
}
.license-badge-signout:hover { color: var(--text); }
