/* ============================================================
   NY Real Estate Exam Prep — styles
   Design system: EB Garamond (headings) + Lato (body)
   Premium / trustworthy: indigo brand + emerald "correct" accent
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:wght@500;600;700&family=Lato:wght@400;700;900&display=swap');

:root {
  --brand: #4338CA;
  --brand-dark: #312E81;
  --brand-light: #EEF2FF;
  --accent: #059669;
  --accent-light: #ECFDF5;
  --danger: #DC2626;
  --danger-light: #FEF2F2;
  --warn: #D97706;

  --bg: #F6F7FB;
  --surface: #FFFFFF;
  --fg: #0F172A;
  --fg-soft: var(--fg-soft);
  --muted: #64748B;
  --muted-bg: var(--muted-bg);
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --nav-bg: rgba(255,255,255,.86);

  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.08);
  --shadow-md: 0 4px 12px rgba(15,23,42,.08), 0 2px 4px rgba(15,23,42,.04);
  --shadow-lg: 0 18px 40px rgba(49,46,129,.16), 0 6px 14px rgba(15,23,42,.06);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --maxw: 1120px;

  --font-head: 'EB Garamond', Georgia, serif;
  --font-body: 'Lato', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; letter-spacing: .2px; }
a { color: var(--brand); }
img, svg { vertical-align: middle; }
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 28px; height: 28px; }

/* ---------- Layout helpers ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { display: none; padding: 48px 0 80px; animation: fade .25s ease; }
.section.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.eyebrow { color: var(--brand); font-weight: 900; text-transform: uppercase; letter-spacing: 1.5px; font-size: 13px; }
.section-title { font-size: 34px; margin: 6px 0 8px; }
.section-sub { color: var(--muted); font-size: 18px; max-width: 640px; margin: 0 0 28px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}

/* ---------- Top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 16px; height: 68px; }
.nav-right { display: flex; align-items: center; gap: 6px; }
.theme-toggle { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 8px; border-radius: 9px; display: inline-grid; place-items: center; }
.theme-toggle:hover { background: var(--brand-light); color: var(--brand); }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
.pro-badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; color: var(--accent); background: var(--accent-light); padding: 6px 12px; border-radius: 999px; }
.pro-badge[hidden] { display: none !important; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.logo-badge {
  width: 42px; height: 42px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, #4338CA, #312E81);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(67,56,202,.4);
}
.logo-badge-svg { width: 42px; height: 42px; display: block; }
.logo-text { display: flex; flex-direction: column; justify-content: center; }
.logo-main { font-family: var(--font-head); font-weight: 700; font-size: 19px; color: var(--fg); line-height: 1.15; letter-spacing: -0.3px; }
.logo-main b { color: var(--brand); }
.logo-sub { font-family: var(--font-body); font-weight: 900; font-size: 9px; text-transform: uppercase; letter-spacing: 1.3px; color: var(--muted); margin-top: 2px; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links button {
  font-family: var(--font-body); font-weight: 700; font-size: 15px;
  background: none; border: 0; color: var(--muted); cursor: pointer;
  padding: 10px 14px; border-radius: 10px; transition: all .18s ease;
}
.nav-links button:hover { color: var(--fg); background: var(--brand-light); }
.nav-links button.active { color: var(--brand); background: var(--brand-light); }
.nav-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 700; font-size: 16px;
  padding: 13px 22px; border-radius: 12px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .18s ease, background .18s ease;
  min-height: 46px; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; box-shadow: var(--shadow-md); }
.btn-primary:hover { box-shadow: var(--shadow-lg); }
.btn-accent { background: linear-gradient(135deg, #10B981, var(--accent)); color: #fff; box-shadow: var(--shadow-md); }
.btn-accent:hover { box-shadow: var(--shadow-lg); }
.btn-ghost { background: var(--surface); color: var(--fg); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--brand-light); border-color: var(--brand); color: var(--brand); }
.btn:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #A5B4FC; outline-offset: 2px; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 48px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: 52px; margin: 14px 0 18px; }
.hero h1 em { color: var(--brand); font-style: normal; }
.hero p.lead { font-size: 20px; color: var(--muted); margin: 0 0 28px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.badge-row { display: flex; gap: 18px; margin-top: 28px; flex-wrap: wrap; }
.badge-row .b { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 700; }
.badge-row .b svg { color: var(--accent); }
.hero-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 28px; position: relative; overflow: hidden;
}
.hero-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: linear-gradient(90deg, var(--brand), var(--accent)); }
.hero-card h3 { font-size: 22px; margin: 8px 0 4px; }
.stat-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 18px; }
.stat { text-align: center; background: var(--bg); border-radius: var(--radius-sm); padding: 14px 8px; }
.stat .n { font-family: var(--font-head); font-weight: 700; font-size: 28px; color: var(--brand); }
.stat .l { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }

/* ---------- Agent credibility strip ---------- */
.agent-strip { display: flex; align-items: center; gap: 20px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 22px 26px; margin-top: 44px; box-shadow: var(--shadow-sm); }
.agent-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--accent-light); color: var(--accent); flex: none; }
.agent-text { flex: 1; }
.agent-text strong { display: block; font-family: var(--font-head); font-size: 19px; color: var(--fg); margin-bottom: 3px; }
.agent-text span { color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.agent-badge { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; font-size: 13px; color: var(--accent); background: var(--accent-light); padding: 9px 15px; border-radius: 999px; white-space: nowrap; flex: none; }

/* ---------- How it works ---------- */
.how-wrap { margin-top: 56px; }
.how-title { font-size: 30px; text-align: center; margin-bottom: 32px; }
.how-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.how-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 24px; box-shadow: var(--shadow-sm); position: relative; }
.how-num { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 20px; margin-bottom: 14px; }
.how-step h4 { font-size: 20px; margin-bottom: 8px; }
.how-step p { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 0; }

/* ---------- Feature cards ---------- */
.features { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin-top: 44px; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm); cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brand); }
.feature .ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--brand-light); color: var(--brand); margin-bottom: 14px; }
.feature h3 { font-size: 22px; margin: 0 0 6px; }
.feature p { color: var(--muted); margin: 0 0 12px; }
.feature .go { color: var(--brand); font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Learn ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.tabs button { font-family: var(--font-body); font-weight: 700; font-size: 15px; border: 0; background: none; color: var(--muted); padding: 10px 16px; border-radius: 10px 10px 0 0; cursor: pointer; border-bottom: 3px solid transparent; }
.tabs button:hover { color: var(--fg); }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.prose { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px 40px; box-shadow: var(--shadow-sm); max-width: 820px; }
.prose h1 { font-size: 32px; margin: 0 0 16px; }
.prose h2 { font-size: 25px; margin: 32px 0 10px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--brand-dark); }
.prose h2:first-of-type { border-top: 0; padding-top: 0; }
.prose h3 { font-size: 20px; margin: 20px 0 8px; }
.prose p, .prose li { font-size: 16.5px; }
.prose ul { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose strong { color: var(--fg); }
.prose code { background: var(--brand-light); color: var(--brand-dark); padding: 2px 6px; border-radius: 6px; font-size: 14px; }
.prose pre { background: #0F172A; color: #E2E8F0; padding: 16px; border-radius: 12px; overflow-x: auto; }
.prose pre code { background: none; color: inherit; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.prose th { background: var(--brand-light); color: var(--brand-dark); font-weight: 700; }
.prose tr:nth-child(even) td, .prose tbody tr:nth-child(even) { background: var(--muted-bg); }
.prose blockquote { border-left: 4px solid var(--brand); background: var(--brand-light); margin: 16px 0; padding: 12px 18px; border-radius: 0 10px 10px 0; }

/* ---------- Terms ---------- */
.search { position: relative; flex: 1; min-width: 240px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input {
  width: 100%; font-family: var(--font-body); font-size: 16px; padding: 13px 14px 13px 44px;
  border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); color: var(--fg);
}
.search-wide { margin-bottom: 22px; }
.tip { display: inline-block; font-weight: 900; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--accent); background: var(--accent-light); padding: 1px 7px; border-radius: 999px; margin-right: 4px; }
code { background: var(--brand-light); color: var(--brand-dark); padding: 1px 6px; border-radius: 5px; font-size: 13.5px; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }

.terms-layout { display: grid; grid-template-columns: 264px 1fr; gap: 28px; align-items: start; }
.terms-sidebar { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 100px); overflow-y: auto; padding-right: 4px; }
.side-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  font-family: var(--font-body); font-weight: 700; font-size: 14.5px; text-align: left;
  background: none; border: 0; border-radius: 10px; padding: 11px 14px; color: var(--muted); cursor: pointer;
  transition: all .15s ease;
}
.side-item:hover { background: var(--brand-light); color: var(--brand-dark); }
.side-item.active { background: var(--brand); color: #fff; }
.side-item .side-n { font-size: 12px; font-weight: 800; background: rgba(0,0,0,.06); color: inherit; padding: 1px 8px; border-radius: 999px; }
.side-item.active .side-n { background: rgba(255,255,255,.25); }

.terms-main { min-width: 0; }
.terms-cat-title { font-size: 26px; margin: 0 0 2px; color: var(--brand-dark); }
.terms-count { color: var(--muted); font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.terms-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.term-row { display: grid; grid-template-columns: 230px 1fr; gap: 22px; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.term-row:last-child { border-bottom: 0; }
.term-row:hover { background: var(--muted-bg); }
.term-row .t { font-family: var(--font-head); font-weight: 700; font-size: 18px; color: var(--fg); }
.term-row .t .row-cat { display: block; font-family: var(--font-body); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--brand); margin-top: 4px; }
.term-row .d { color: var(--fg-soft); font-size: 15.5px; line-height: 1.55; }

/* ---------- Learn: mode switch + flashcards ---------- */
.mode-switch { display: inline-flex; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 26px; }
.mode-switch button { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-body); font-weight: 700; font-size: 15px; border: 0; background: none; color: var(--muted); padding: 10px 18px; border-radius: 9px; cursor: pointer; transition: all .15s ease; }
.mode-switch button:hover { color: var(--fg); }
.mode-switch button.active { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }

.flash-home { display: grid; gap: 24px; }
.mastery-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-md); }
.mastery-card h3 { font-size: 24px; margin: 0 0 4px; }
.mastery-card p { color: var(--muted); margin: 0 0 16px; }
.big-bar { height: 14px; background: var(--border); border-radius: 999px; overflow: hidden; margin-bottom: 18px; }
.big-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 999px; transition: width .4s ease; }
.mastery-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.link-btn { background: none; border: 0; color: var(--muted); font-family: var(--font-body); font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: var(--danger); }

.topic-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.topic-list h4 { margin: 0; padding: 16px 22px; font-size: 16px; border-bottom: 1px solid var(--border); background: var(--muted-bg); }
.topic-item { display: grid; grid-template-columns: 1fr 120px 64px 92px; gap: 14px; align-items: center; padding: 12px 22px; border-bottom: 1px solid var(--border); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; cursor: pointer; font-family: var(--font-body); text-align: left; transition: background .15s ease; }
.topic-item:last-child { border-bottom: 0; }
.topic-item:hover { background: var(--brand-light); }
.topic-item .tn { font-weight: 700; font-size: 15px; color: var(--fg); }
.topic-item .tbar { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.topic-item .tbar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.topic-item .tcount { font-size: 13px; font-weight: 800; color: var(--muted); text-align: right; }
.topic-item .tgo { font-size: 13px; font-weight: 800; color: var(--brand); text-align: right; }

.mastery-note { font-size: 13.5px; color: var(--muted); margin: 0 0 16px; }
.flash-quiz { max-width: 720px; margin: 0 auto; }
.flash-roundlbl { font-size: 13px; color: var(--muted); font-weight: 700; text-align: center; margin-bottom: 12px; }
.flash-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.flash-head .progress-bar { flex: 1; }
.flash-head .lbl { font-size: 13px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.flash-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 30px; }
.flash-prompt-label { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .8px; color: var(--brand); margin-bottom: 8px; }
.flash-def { font-size: 19px; line-height: 1.5; color: var(--fg); margin-bottom: 22px; }
.flash-q { font-family: var(--font-head); font-size: 20px; font-weight: 600; margin-bottom: 16px; }
.flash-feedback { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.flash-verdict { font-weight: 900; font-size: 16px; display: inline-flex; align-items: center; gap: 8px; }
.flash-verdict.ok { color: var(--accent); }
.flash-verdict.no { color: var(--danger); }
.flash-done { text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 48px 32px; max-width: 600px; margin: 0 auto; }
.flash-done .trophy { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: var(--accent-light); color: var(--accent); margin: 0 auto 18px; }
.flash-done h3 { font-size: 30px; margin: 0 0 8px; }
.flash-done p { color: var(--muted); margin: 0 0 24px; font-size: 17px; }
.flash-done .results-actions { justify-content: center; }

/* ---------- Test list ---------- */
.test-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; }
.test-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.test-card.locked { opacity: .72; }
.test-card .tnum { font-family: var(--font-head); font-weight: 700; font-size: 15px; color: var(--brand); }
.test-card h3 { font-size: 24px; margin: 4px 0 6px; }
.test-card .meta { display: flex; gap: 16px; color: var(--muted); font-size: 14px; font-weight: 700; margin: 8px 0 18px; }
.test-card .meta span { display: inline-flex; gap: 6px; align-items: center; }
.test-card .btn { margin-top: auto; }
.lock-tag { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; color: var(--warn); background: #FFFBEB; border: 1px solid #FDE68A; padding: 6px 10px; border-radius: 999px; align-self: flex-start; margin-top: auto; }

/* ---------- Exam engine ---------- */
.exam { display: none; position: fixed; inset: 0; z-index: 1000; background: var(--bg); flex-direction: column; }
.exam.active { display: flex; }
.exam-top { background: var(--surface); border-bottom: 1px solid var(--border); }
.exam-top-inner { display: flex; align-items: center; gap: 18px; height: 64px; max-width: 1000px; margin: 0 auto; padding: 0 20px; }
.exam-top h3 { font-size: 18px; margin: 0; }
.progress-wrap { flex: 1; }
.progress-bar { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); width: 0; transition: width .3s ease; }
.progress-lbl { font-size: 12px; color: var(--muted); font-weight: 700; margin-top: 4px; }
.timer { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 18px; font-variant-numeric: tabular-nums; padding: 8px 14px; border-radius: 10px; background: var(--brand-light); color: var(--brand-dark); }
.timer.warn { background: var(--danger-light); color: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.exit-btn { background: none; border: 0; color: var(--muted); cursor: pointer; display: inline-flex; padding: 8px; border-radius: 8px; }
.exit-btn:hover { background: var(--danger-light); color: var(--danger); }

.exam-body { flex: 1; overflow-y: auto; }
.q-wrap { max-width: 760px; margin: 0 auto; padding: 32px 20px 40px; }
.q-topic { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .6px; color: var(--brand); background: var(--brand-light); display: inline-block; padding: 5px 12px; border-radius: 999px; }
.q-num { color: var(--muted); font-weight: 700; font-size: 14px; margin-left: 8px; }
.q-text { font-family: var(--font-head); font-size: 26px; font-weight: 600; margin: 16px 0 24px; line-height: 1.35; }
.options { display: flex; flex-direction: column; gap: 12px; }
.option {
  display: flex; align-items: flex-start; gap: 14px; width: 100%; text-align: left;
  background: var(--surface); border: 2px solid var(--border); border-radius: 14px;
  padding: 16px 18px; cursor: pointer; font-family: var(--font-body); font-size: 17px; color: var(--fg);
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.option:hover { border-color: var(--brand); background: var(--brand-light); }
.option:active { transform: scale(.995); }
.option .key { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 2px solid var(--border-strong); font-weight: 900; font-size: 15px; color: var(--muted); }
.option.selected { border-color: var(--brand); background: var(--brand-light); }
.option.selected .key { background: var(--brand); border-color: var(--brand); color: #fff; }
/* review states */
.option.correct { border-color: var(--accent); background: var(--accent-light); }
.option.correct .key { background: var(--accent); border-color: var(--accent); color: #fff; }
.option.wrong { border-color: var(--danger); background: var(--danger-light); }
.option.wrong .key { background: var(--danger); border-color: var(--danger); color: #fff; }
.explain { margin-top: 16px; background: var(--muted-bg); border-left: 4px solid var(--brand); border-radius: 0 12px 12px 0; padding: 14px 18px; font-size: 15.5px; }
.explain b { color: var(--accent); }

.exam-foot { background: var(--surface); border-top: 1px solid var(--border); }
.exam-foot-inner { display: flex; align-items: center; gap: 12px; max-width: 760px; margin: 0 auto; padding: 14px 20px; }
.flag-btn { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; padding: 11px 16px; font-weight: 700; cursor: pointer; color: var(--muted); display: inline-flex; gap: 8px; align-items: center; }
.flag-btn.on { color: var(--warn); border-color: var(--warn); background: #FFFBEB; }
.spacer { flex: 1; }

/* navigator grid */
.navigator { max-width: 760px; margin: 0 auto 30px; padding: 0 20px; }
.nav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px,1fr)); gap: 8px; margin-top: 10px; }
.nav-cell { aspect-ratio: 1; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 8px; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--muted); }
.nav-cell.answered { background: var(--brand); color: #fff; border-color: var(--brand); }
.nav-cell.flagged { border-color: var(--warn); border-width: 2px; color: var(--warn); }
.nav-cell.current { outline: 3px solid #A5B4FC; }

/* results */
.results { max-width: 760px; margin: 0 auto; padding: 40px 20px; }
.score-hero { text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px; box-shadow: var(--shadow-md); }
.score-ring { font-family: var(--font-head); font-size: 64px; font-weight: 700; line-height: 1; }
.pass-badge { display: inline-flex; align-items: center; gap: 8px; font-weight: 900; padding: 8px 18px; border-radius: 999px; font-size: 15px; margin-top: 12px; }
.pass-badge.pass { background: var(--accent-light); color: var(--accent); }
.pass-badge.fail { background: var(--danger-light); color: var(--danger); }
.score-meta { display: flex; justify-content: center; gap: 28px; margin-top: 18px; color: var(--muted); font-weight: 700; }
.breakdown { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); margin-top: 24px; }
.breakdown h3 { margin: 0 0 16px; font-size: 22px; }
.topic-row { display: grid; grid-template-columns: 160px 1fr 52px; gap: 12px; align-items: center; margin: 9px 0; }
.topic-row .name { font-size: 14px; font-weight: 700; }
.topic-bar { height: 10px; background: var(--border); border-radius: 999px; overflow: hidden; }
.topic-bar i { display: block; height: 100%; border-radius: 999px; }
.topic-row .pct { font-size: 13px; font-weight: 800; text-align: right; }
.results-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.review-q { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); margin-top: 16px; }

/* footer */
.site-foot { border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); font-size: 14px; text-align: center; }

/* ---------- Pricing ---------- */
.btn-block { width: 100%; }
.plans { display: grid; grid-template-columns: repeat(2,1fr); gap: 22px; max-width: 860px; align-items: stretch; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; position: relative; }
.plan-pro { border: 2px solid var(--brand); box-shadow: var(--shadow-lg); }
.plan-badge { position: absolute; top: -12px; right: 20px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 800; padding: 5px 12px; border-radius: 999px; }
.plan h3 { font-size: 24px; margin: 0 0 4px; }
.plan-price { font-family: var(--font-head); font-size: 42px; font-weight: 700; color: var(--brand-dark); line-height: 1; }
.plan-price small { font-size: 15px; color: var(--muted); font-family: var(--font-body); font-weight: 700; }
.plan-tag { color: var(--muted); margin: 6px 0 18px; }
.incl { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-direction: column; gap: 11px; }
.incl li { position: relative; padding-left: 28px; font-size: 15px; color: var(--fg-soft); }
.incl li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--accent); font-weight: 900; }
.plan .btn-block { margin-top: auto; }
.plan .link-btn { margin-top: 10px; align-self: center; }
.faq-title { font-size: 27px; margin: 52px 0 18px; }
.faq { max-width: 760px; display: flex; flex-direction: column; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); overflow: hidden; }
.faq summary { list-style: none; cursor: pointer; padding: 16px 20px; font-weight: 700; font-size: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 24px; color: var(--brand); font-weight: 400; line-height: 1; }
.faq details[open] summary::after { content: "\2013"; }
.faq details > div { padding: 0 20px 16px; color: var(--fg-soft); font-size: 15px; line-height: 1.6; }

/* ---------- Free diagnostic card + upsell ---------- */
.diag-card { grid-column: 1 / -1; border: 2px solid var(--accent); background: linear-gradient(180deg, var(--surface), var(--accent-light)); }
.diag-tag { color: var(--accent) !important; }
.diag-desc { color: var(--fg-soft); margin: 6px 0 4px; font-size: 15px; }
.diag-cta { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; border-radius: var(--radius-lg); padding: 26px 28px; margin-top: 24px; text-align: center; }
.diag-cta h3 { margin: 0 0 6px; font-size: 24px; color: #fff; }
.diag-cta p { margin: 0 0 16px; opacity: .92; font-size: 15.5px; }
.diag-cta .btn-accent { box-shadow: 0 8px 20px rgba(0,0,0,.25); }

/* ---------- Locked test card ---------- */
.test-card.locked-pro { background: linear-gradient(180deg, var(--surface), var(--muted-bg)); }
.test-card .lock-ico { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--brand-light); color: var(--brand); margin-bottom: 8px; }

/* ---------- Unlock modal ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 1100; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .2s ease; }
.modal-overlay[hidden] { display: none; }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); max-width: 460px; width: 100%; padding: 32px; position: relative; }
.modal-close { position: absolute; top: 14px; right: 14px; background: none; border: 0; cursor: pointer; color: var(--muted); padding: 6px; border-radius: 8px; }
.modal-close:hover { background: var(--muted-bg); color: var(--fg); }
.modal h3 { font-size: 24px; margin: 10px 0 4px; }
.modal-price { color: var(--muted); margin: 0 0 18px; }
.modal-price strong { font-family: var(--font-head); font-size: 28px; color: var(--brand-dark); }
.divider-or { text-align: center; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; margin: 18px 0 12px; }
.key-row { display: flex; gap: 8px; }
.key-row input { flex: 1; font-family: var(--font-body); font-size: 15px; padding: 12px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--fg); }
.key-msg { font-size: 13.5px; font-weight: 700; margin-top: 8px; min-height: 18px; }
.key-msg.ok { color: var(--accent); }
.key-msg.no { color: var(--danger); }
.guarantee { font-size: 13px; color: var(--muted); margin: 16px 0 0; text-align: center; }

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
  --bg: #0E1420;
  --surface: #18202E;
  --fg: #E6EAF2;
  --fg-soft: #C4CCD9;
  --muted: #93A1B5;
  --muted-bg: #1E2736;
  --border: #2A3548;
  --border-strong: #3C4A60;
  --nav-bg: rgba(14,20,32,.86);
  --brand: #818CF8;
  --brand-dark: #A5B4FC;
  --brand-light: #222C42;
  --accent: #34D399;
  --accent-light: #10271F;
  --danger: #F87171;
  --danger-light: #2A1719;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 4px 14px rgba(0,0,0,.5);
  --shadow-lg: 0 18px 44px rgba(0,0,0,.6);
}
[data-theme="dark"] .btn-primary { color: #0E1420; }
[data-theme="dark"] .btn-accent { color: #06251A; }
[data-theme="dark"] .plan-badge, [data-theme="dark"] .timer.warn { color: #0E1420; }
[data-theme="dark"] .side-item .side-n { background: rgba(255,255,255,.12); }
[data-theme="dark"] .side-item.active .side-n { background: rgba(0,0,0,.25); }
[data-theme="dark"] .logo-main b { color: #818CF8; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero h1 { font-size: 38px; }
  .features, .test-grid, .plans, .how-steps { grid-template-columns: 1fr; }
  .agent-strip { flex-direction: column; text-align: center; }
  .nav-right { margin-left: auto; }
  .terms-layout { grid-template-columns: 1fr; gap: 18px; }
  .terms-sidebar { position: static; flex-direction: row; overflow-x: auto; max-height: none; gap: 8px; padding-bottom: 6px; }
  .side-item { white-space: nowrap; flex: none; }
  .term-row { grid-template-columns: 1fr; gap: 4px; }
  .term-row .t { font-size: 17px; }
  .topic-item { grid-template-columns: 1fr 56px 80px; }
  .topic-item .tbar { display: none; }
  .mode-switch { width: 100%; }
  .mode-switch button { flex: 1; justify-content: center; padding: 10px 8px; }
  .nav-links { display: none; position: absolute; top: 68px; left: 0; right: 0; background: var(--surface); flex-direction: column; padding: 10px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md); }
  .nav-links.open { display: flex; }
  .nav-links button { text-align: left; }
  .nav-toggle { display: inline-grid; place-items: center; background: none; border: 0; cursor: pointer; color: var(--fg); padding: 8px; }
  .q-text { font-size: 22px; }
  .topic-row { grid-template-columns: 110px 1fr 46px; }
  .section-title { font-size: 28px; }
}
