/* NMCN-style mock exams. Deep blue + teal. Mobile-first: base styles are for phones, wider screens at the bottom. */

:root {
  --navy-900: #0a1f44;
  --navy-800: #0f2c5c;
  --navy-700: #15407f;
  --blue-600: #1d5fbf;
  --teal-600: #0d9488;
  --teal-500: #14b8a6;
  --teal-100: #ccf3ee;
  --teal-50: #ecfbf8;
  --bg: #f2f6fb;
  --card: #ffffff;
  --text: #0f1b2d;
  --muted: #5a6a80;
  --line: #dde5ef;
  --line-strong: #c3cfdd;
  --green: #15803d;
  --green-50: #e8f7ee;
  --red: #c0262d;
  --red-50: #fdeeee;
  --amber: #b45309;
  --amber-50: #fff5e0;
  --gradient: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-700) 45%, var(--teal-600) 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 4px 16px rgba(15, 27, 45, .06);
  --shadow-lg: 0 10px 30px rgba(10, 31, 68, .18);
  --tap: 48px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
a { color: var(--blue-600); }
[hidden] { display: none !important; }
.icon { flex: none; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 780px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 16px; padding-bottom: 32px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.stack { display: grid; gap: 16px; }

/* ---------- Header & footer ---------- */
.site-header { background: var(--navy-900); color: #fff; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; text-decoration: none; font-size: 1rem; }
.brand__logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--teal-500), var(--blue-600)); }
.name-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 45%; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; border: 0; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.name-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-footer { font-size: .82rem; color: var(--muted); padding: 20px 0 36px; border-top: 1px solid var(--line); }
.site-footer p { margin: 0 0 6px; }

/* ---------- Cards & notices ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 20px 16px; box-shadow: var(--shadow); }
.card__title { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; margin-bottom: 12px; }
.card__title .icon { color: var(--teal-600); }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 1.2rem; margin: 8px 0 0; }
.notice { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--radius-sm); padding: 12px 14px; font-size: .93rem; }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.notice--demo { background: var(--amber-50); border: 1px solid #f3cf87; color: #6b3a05; }
.notice--error { background: var(--red-50); border: 1px solid #f2b8b8; color: #7a1419; }
.notice--info { background: var(--teal-50); border: 1px solid var(--teal-100); align-items: center; flex-wrap: wrap; justify-content: space-between; }
.notice--info > span { display: inline-flex; gap: 8px; align-items: center; }

/* ---------- Buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 10px 18px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; color: var(--text);
  font: inherit; font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--teal-600); border-color: var(--teal-600); color: #fff; box-shadow: 0 4px 14px rgba(13, 148, 136, .3); }
.btn--primary:not(:disabled):hover { background: #0b7f75; }
.btn--navy { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.btn--danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--light { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #fff; }
.btn--block { width: 100%; }
.btn--lg { min-height: 56px; font-size: 1.05rem; border-radius: 14px; }
.btn--sm { min-height: 40px; padding: 6px 14px; font-size: .88rem; }
.btn-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
:is(.btn, .chip, .nav-btn, .option, .name-chip):focus-visible { outline: 3px solid #f5b42a; outline-offset: 2px; }

.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; font: inherit; font-size: .87rem; font-weight: 600; color: var(--text); cursor: pointer; }
.chip[aria-pressed="true"], .chip[aria-selected="true"] { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 4px; background: var(--teal-50); color: #0b6b62; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-weight: 800; font-size: .8rem; letter-spacing: .06em; }
.badge--pass { background: var(--green-50); color: var(--green); }
.badge--fail { background: var(--red-50); color: var(--red); }

/* ---------- Landing ---------- */
.hero { position: relative; overflow: hidden; background: var(--gradient); color: #fff; border-radius: 22px; padding: 26px 18px 20px; box-shadow: var(--shadow-lg); }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.07); pointer-events: none; }
.hero::before { width: 260px; height: 260px; right: -90px; top: -110px; }
.hero::after { width: 180px; height: 180px; left: -70px; bottom: -90px; }
.hero > * { position: relative; }
.hero__eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: rgba(255,255,255,.14); padding: 5px 12px; border-radius: 999px; margin-bottom: 14px; }
.hero h1 { font-size: 1.85rem; font-weight: 800; }
.hero p { color: rgba(255,255,255,.88); margin: 0 0 16px; }
.hero__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0; }
.hero__stats div { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 10px 8px; text-align: center; }
.hero__stats strong { display: block; font-size: 1.25rem; font-weight: 800; }
.hero__stats span { font-size: .75rem; opacity: .85; }
.price-box { background: #fff; color: var(--text); border-radius: 16px; padding: 16px; }
.price-box__row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.price { font-size: 2rem; font-weight: 800; color: var(--navy-800); line-height: 1; }
.price-box small { color: var(--muted); font-size: .85rem; text-align: right; }
.pay-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 10px 0 0 !important; font-size: .85rem; color: var(--muted) !important; text-align: center; }
.pay-note .icon { color: var(--green); }

.progress-card { display: grid; gap: 14px; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-stats div { background: var(--bg); border-radius: 12px; padding: 10px; text-align: center; }
.mini-stats strong { display: block; font-size: 1.3rem; font-weight: 800; }
.mini-stats span { font-size: .78rem; color: var(--muted); }

.mock-list { display: grid; gap: 14px; }
.mock-card { background: var(--card); border-radius: var(--radius); padding: 18px 16px; box-shadow: var(--shadow); display: grid; gap: 12px; border: 1px solid transparent; }
.mock-card__head { display: flex; gap: 12px; align-items: flex-start; }
.mock-card__icon { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--teal-50); color: var(--teal-600); }
.mock-card h3 { font-size: 1.15rem; margin: 0 0 2px; }
.mock-card__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .85rem; color: var(--muted); font-weight: 600; }
.mock-card__meta span { display: inline-flex; align-items: center; gap: 4px; }
.mock-card details { font-size: .88rem; color: var(--muted); }
.mock-card summary { cursor: pointer; font-weight: 600; color: var(--blue-600); padding: 4px 0; }
.mock-card .chips { margin-top: 8px; }
.mock-card .tag { font-weight: 600; }

.features { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.feature { background: var(--card); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.feature .icon { color: var(--teal-600); margin-bottom: 6px; }
.feature strong { display: block; font-size: .92rem; }
.feature span { font-size: .8rem; color: var(--muted); }

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--teal-50); color: var(--teal-600); font-weight: 800; }
.rules { margin: 0; padding-left: 20px; }
.rules li { margin-bottom: 6px; }

/* ---------- Exam ---------- */
.exam-page { padding-bottom: 96px; }
.exam-bar { position: sticky; top: 0; z-index: 20; background: var(--navy-900); color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.2); }
.exam-bar__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.exam-bar__title { display: flex; flex-direction: column; min-width: 0; font-weight: 800; }
.exam-bar__title small { font-weight: 500; opacity: .8; font-size: .8rem; }
.timer { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; font-size: 1.2rem; font-weight: 800; background: rgba(255,255,255,.12); padding: 6px 12px; border-radius: 10px; white-space: nowrap; }
.timer.is-low { background: var(--red); animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .78; } }
.progress { height: 4px; background: rgba(255,255,255,.12); }
.progress__fill { height: 100%; width: 0; background: var(--teal-500); transition: width .3s ease; }

.question { scroll-margin-top: 90px; }
.question__meta { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; font-size: .88rem; color: var(--muted); margin-bottom: 12px; font-weight: 600; }
.question__text { font-size: 1.1rem; font-weight: 700; white-space: pre-line; margin: 0 0 16px; }
.options { display: grid; gap: 10px; }
.option {
  position: relative; display: flex; align-items: flex-start; gap: 12px;
  min-height: 58px; padding: 13px 14px;
  border: 2px solid var(--line); border-radius: 14px; cursor: pointer; background: #fff;
  transition: border-color .15s ease, background .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.option:hover { border-color: var(--line-strong); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option__letter {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 10px; background: var(--bg); color: var(--navy-800); font-weight: 800;
  transition: background .15s ease, color .15s ease;
}
.option__text { padding-top: 4px; }
.option:has(input:checked) { border-color: var(--teal-600); background: var(--teal-50); }
.option:has(input:checked) .option__letter { background: var(--teal-600); color: #fff; }
.option:has(input:focus-visible) { outline: 3px solid #f5b42a; outline-offset: 2px; }
.question__extra { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.kbd-hint { font-size: .78rem; color: var(--muted); display: none; }

.action-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); }
.action-bar__inner { display: grid; grid-template-columns: 1fr auto auto 1fr; gap: 8px; }
.action-bar .btn { padding: 10px 12px; }
#flag.is-flagged { background: var(--amber-50); border-color: var(--amber); color: var(--amber); }
.btn-icon-label { display: none; }

/* Navigator sheet */
.sheet { border: 0; padding: 0; margin: auto 0 0; width: 100%; max-width: 100%; max-height: 85vh; border-radius: 22px 22px 0 0; background: #fff; }
.sheet::backdrop { background: rgba(10, 20, 35, .5); }
.sheet[open] { animation: slide-up .22s ease-out; }
@keyframes slide-up { from { transform: translateY(40px); opacity: 0; } }
.sheet__inner { display: flex; flex-direction: column; max-height: 85vh; }
.sheet__head { padding: 16px 16px 10px; border-bottom: 1px solid var(--line); }
.sheet__head-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.sheet__head h2 { margin: 0; font-size: 1.1rem; }
.sheet__body { overflow-y: auto; padding: 14px 16px; }
.sheet__foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--muted); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--line-strong); background: #fff; display: inline-block; }
.dot--current { border-color: var(--navy-800); border-width: 3px; }
.dot--answered { background: var(--teal-600); border-color: var(--teal-600); }
.dot--flagged { background: var(--amber-50); border-color: var(--amber); }
.nav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; }
.nav-btn { position: relative; height: 46px; border-radius: 10px; border: 2px solid var(--line); background: #fff; font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; color: var(--text); }
.nav-btn.is-answered { background: var(--teal-600); border-color: var(--teal-600); color: #fff; }
.nav-btn.is-flagged { border-color: var(--amber); }
.nav-btn.is-flagged::after { content: ""; position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 2px #fff; }
.nav-btn.is-current { outline: 3px solid var(--navy-800); outline-offset: 1px; }
.nav-empty { color: var(--muted); text-align: center; padding: 20px 0; }

/* Dialogs */
.dialog { border: none; border-radius: 20px; padding: 22px; width: min(440px, calc(100% - 32px)); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgba(10, 20, 35, .55); }
.dialog h2 { font-size: 1.2rem; }
.dialog__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--teal-50); color: var(--teal-600); margin-bottom: 12px; }
.dialog input[type="text"] { width: 100%; min-height: var(--tap); padding: 10px 14px; border: 2px solid var(--line-strong); border-radius: 12px; font: inherit; font-size: 1rem; }
.dialog input[type="text"]:focus { outline: none; border-color: var(--teal-600); }
.field-error { color: var(--red); font-size: .88rem; margin: 6px 0 0; }
.confirm-summary { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.confirm-summary li { display: flex; justify-content: space-between; background: var(--bg); padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.confirm-summary li.warn { background: var(--amber-50); color: var(--amber); }
.dialog__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

/* ---------- Results ---------- */
.perf-card { position: relative; overflow: hidden; background: var(--gradient); color: #fff; border-radius: 22px; padding: 22px 18px; box-shadow: var(--shadow-lg); }
.perf-card::before { content: ""; position: absolute; width: 240px; height: 240px; border-radius: 50%; background: rgba(255,255,255,.07); right: -80px; top: -90px; }
.perf-card > * { position: relative; }
.perf-card__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; opacity: .9; }
.perf-card__name { font-size: 1.6rem; font-weight: 800; margin: 16px 0 2px; word-break: break-word; }
.perf-card__mock { opacity: .85; font-size: .92rem; margin: 0; }
.perf-card__body { display: flex; align-items: center; gap: 18px; margin: 18px 0; }
.ring { position: relative; flex: none; width: 128px; height: 128px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring__label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring__label strong { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.ring__label span { font-size: .72rem; opacity: .85; }
.perf-card__facts { display: grid; gap: 8px; font-size: .9rem; }
.perf-card__facts .badge { justify-self: start; }
.perf-card .badge--pass { background: #d7f7e3; color: #0f6a33; }
.perf-card .badge--fail { background: #ffe1e1; color: #a1161c; }
.perf-card__foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .78rem; opacity: .85; border-top: 1px solid rgba(255,255,255,.2); padding-top: 12px; }

.compare__delta { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; }
.delta--up { color: var(--green); }
.delta--down { color: var(--red); }
.delta--same { color: var(--muted); }
.compare__delta .delta { font-size: 1.6rem; }
.compare-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.compare-list li { display: flex; justify-content: space-between; gap: 10px; font-size: .92rem; padding: 8px 0; border-bottom: 1px solid var(--line); }
.compare-list li:last-child { border-bottom: 0; }

.feedback__headline { font-weight: 700; font-size: 1.02rem; margin: 0 0 14px; }
.focus-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
.focus-item { border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 12px; padding: 12px 14px; }
.focus-item__head { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; margin-bottom: 4px; }
.focus-item p { margin: 0; font-size: .92rem; color: var(--muted); }
.strength { display: flex; gap: 8px; align-items: center; background: var(--green-50); color: var(--green); border-radius: 12px; padding: 10px 12px; font-weight: 600; font-size: .92rem; margin-bottom: 14px; }
.tip-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.tip-list li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: .93rem; }
.tip-list .icon { color: var(--amber); margin-top: 2px; }

.topics { display: grid; gap: 14px; }
.topic__head { display: flex; justify-content: space-between; gap: 10px; font-size: .92rem; font-weight: 600; margin-bottom: 6px; }
.bar { position: relative; height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.bar__fill { height: 100%; background: var(--teal-600); border-radius: 999px; }
.bar__fill.is-weak { background: var(--red); }
.bar__pass { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--navy-800); opacity: .4; }

.filters { margin-bottom: 14px; }
.review { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.review__item { border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.review__status { display: inline-flex; align-items: center; gap: 6px; }
.review__status.is-correct { color: var(--green); }
.review__status.is-wrong { color: var(--red); }
.review__opts { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.review__opt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); font-size: .95rem; }
.review__opt .option__letter { width: 26px; height: 26px; font-size: .82rem; border-radius: 8px; }
.review__opt em { display: block; font-style: normal; font-weight: 700; font-size: .8rem; margin-top: 2px; }
.review__opt.is-correct { background: var(--green-50); border-color: #9ad7b1; }
.review__opt.is-correct em { color: var(--green); }
.review__opt.is-wrong { background: var(--red-50); border-color: #f0aaaa; }
.review__opt.is-wrong em { color: var(--red); }
.explanation { display: grid; grid-template-columns: 22px 1fr; gap: 8px; background: var(--teal-50); border-radius: 10px; padding: 10px 12px; margin: 0; font-size: .93rem; }
.explanation .icon { color: var(--teal-600); margin-top: 2px; }
.more { margin-top: 14px; }

/* ---------- History ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--card); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.stat span { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat strong { font-size: 1.5rem; font-weight: 800; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font: 600 11px var(--font); fill: var(--muted); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .pass-line { stroke: var(--navy-800); stroke-width: 1.5; stroke-dasharray: 5 4; opacity: .55; }
.chart .line { fill: none; stroke: var(--teal-600); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--teal-600); opacity: .08; }
.chart .pt { fill: var(--teal-600); stroke: #fff; stroke-width: 2; }
.chart .pt.is-active { r: 6; }
.chart .crosshair { stroke: var(--line-strong); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:focus { outline: none; }
.chart .hit:focus-visible { stroke: #f5b42a; stroke-width: 3; }
.tooltip { position: absolute; pointer-events: none; background: var(--navy-900); color: #fff; padding: 8px 10px; border-radius: 10px; font-size: .8rem; line-height: 1.35; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); box-shadow: var(--shadow-lg); }
.tooltip[data-align="start"] { transform: translate(-12px, calc(-100% - 12px)); }
.tooltip[data-align="end"] { transform: translate(calc(-100% + 12px), calc(-100% - 12px)); }
.tooltip strong { font-size: .95rem; }
.attempts { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.attempt { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: inherit; }
.attempt:hover { border-color: var(--line-strong); }
.attempt__title { font-weight: 700; }
.attempt__meta { font-size: .8rem; color: var(--muted); }
.attempt__score { grid-row: span 2; text-align: right; }
.attempt__score strong { display: block; font-size: 1.3rem; font-weight: 800; }
.empty { text-align: center; padding: 28px 10px; color: var(--muted); }
.empty .icon { color: var(--teal-600); margin-bottom: 8px; }

/* ---------- Share page ---------- */
.share-cta { text-align: center; }
.share-cta h2 { font-size: 1.35rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Wider screens ---------- */
@media (min-width: 640px) {
  .card { padding: 24px; }
  .hero { padding: 36px 32px 28px; }
  .hero h1 { font-size: 2.4rem; }
  .features { grid-template-columns: repeat(3, 1fr); }
  .mock-card { grid-template-columns: 1fr auto; align-items: center; }
  .mock-card details { grid-column: 1 / -1; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .kbd-hint { display: inline; }
  .btn-icon-label { display: inline; }
  .sheet { max-width: 640px; margin: auto auto 0; }
  .perf-card { padding: 28px; }
  .ring { width: 150px; height: 150px; }
}

/* ---------- Navigation ---------- */
.site-header .wrap { gap: 8px; }
.page-title { flex: 1; font-weight: 800; font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-nav { display: flex; gap: 4px; margin-left: auto; }
.icon-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 42px; min-height: 42px; padding: 0 10px; border-radius: 12px; border: 0; background: rgba(255,255,255,.1); color: #fff; font: inherit; font-size: .85rem; font-weight: 700; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.icon-link:hover { background: rgba(255,255,255,.18); }
.icon-link:focus-visible { outline: 3px solid #f5b42a; outline-offset: 2px; }
.icon-link span { display: none; }
.icon-link--exit { flex: none; }
.icon-link--exit span { display: inline; }

/* ---------- Pay form & access ---------- */
.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field label { font-size: .88rem; font-weight: 700; }
.field small { font-weight: 500; color: var(--muted); }
.field input, #claim-code {
  width: 100%; min-height: var(--tap); padding: 10px 14px;
  border: 2px solid var(--line-strong); border-radius: 12px; font: inherit; font-size: 1rem; background: #fff; color: var(--text);
}
.field input:focus, #claim-code:focus { outline: none; border-color: var(--teal-600); }
#claim-code { text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.price-box .field-error { margin: -4px 0 10px; }
.device-note { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; padding: 10px 12px; background: var(--amber-50); color: #6b3a05; border-radius: 10px; font-size: .82rem; line-height: 1.45; }
.device-note .icon { margin-top: 2px; }
.link-btn { display: block; width: 100%; margin-top: 12px; padding: 8px; border: 0; background: none; color: var(--blue-600); font: inherit; font-weight: 700; font-size: .9rem; text-decoration: underline; cursor: pointer; }
.unlocked { display: grid; gap: 12px; }
.unlocked__row { display: flex; gap: 12px; align-items: center; }
.unlocked__row strong { display: block; }
.unlocked__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--green-50); color: var(--green); flex: none; }
.code-text { font-weight: 800; letter-spacing: .05em; color: var(--navy-800); }
.name-row { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font: inherit; font-weight: 600; color: var(--text); cursor: pointer; text-align: left; }
.name-row span { flex: 1; }
.code-big { margin: 14px 0; padding: 14px; border: 2px dashed var(--teal-600); border-radius: 14px; background: var(--teal-50); text-align: center; font-size: 1.7rem; font-weight: 800; letter-spacing: .1em; color: var(--navy-800); }
.dialog__icon--ok { background: var(--green-50); color: var(--green); }

/* ---------- Exam extras ---------- */
.submitting { text-align: center; }
.submitting .dialog__icon { margin: 0 auto 12px; }

/* ---------- Results extras ---------- */
.others__big { font-size: 1.02rem; margin: 0 0 12px; }
.others__big strong { font-size: 1.6rem; color: var(--teal-600); }
.toggle { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; font-weight: 600; cursor: pointer; }
.toggle input { width: 22px; height: 22px; accent-color: var(--teal-600); flex: none; }

/* ---------- Leaderboard ---------- */
.board { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.board__row { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; }
.board__row:nth-child(-n+3) { background: var(--teal-50); border-color: var(--teal-100); }
.board__row.is-you { outline: 2px solid var(--teal-600); }
.board__rank { font-weight: 800; font-size: 1.1rem; text-align: center; }
.board__name { display: flex; gap: 8px; align-items: center; font-weight: 700; min-width: 0; }
.board__score { font-weight: 800; font-size: 1.1rem; }

@media (min-width: 640px) {
  .icon-link span { display: inline; }
}

/* The hero sets white paragraph text; the white price box inside it needs dark text again. */
.hero .price-box p { color: var(--text); margin: 0; }
.hero .price-box .device-note { color: #6b3a05; margin-top: 12px; }
.hero .price-box .field-error { color: var(--red); margin: -4px 0 10px; }
.hero .price-box .muted { color: var(--muted); }

/* ---------- Confirm & code pages ---------- */
.status-card { text-align: center; padding-top: 32px; padding-bottom: 28px; }
.status-card h1 { font-size: 1.35rem; }
.status-card__icon { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 14px; border-radius: 22px; background: var(--teal-50); color: var(--teal-600); }
.status-card__icon--warn { background: var(--amber-50); color: var(--amber); }
.status-card .btn-row { margin-top: 16px; }
.spin .icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.welcome { text-align: center; padding: 8px 8px 0; }
.welcome h1 { font-size: 1.6rem; margin-bottom: 4px; }
.welcome p { color: var(--muted); margin: 0; }
.welcome__icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%; background: var(--green-50); color: var(--green); }
.code-card { position: relative; overflow: hidden; background: var(--gradient); color: #fff; border-radius: 22px; padding: 22px 18px; box-shadow: var(--shadow-lg); text-align: center; }
.code-card__label { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .9; }
.code-card__code { margin: 12px 0 18px; padding: 16px 10px; background: #fff; color: var(--navy-800); border-radius: 16px; font-size: 2rem; font-weight: 800; letter-spacing: .12em; user-select: all; }
.code-card__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 14px; text-align: left; }
.code-card__facts div { background: rgba(255,255,255,.1); border-radius: 12px; padding: 8px 10px; min-width: 0; }
.code-card__facts dt { font-size: .72rem; opacity: .8; }
.code-card__facts dd { margin: 0; font-weight: 700; font-size: .9rem; overflow-wrap: anywhere; }
.code-card__foot { margin: 0; font-size: .72rem; opacity: .75; }

/* ---------- WhatsApp code button ---------- */
.btn--whatsapp { background: #25d366; border-color: #25d366; color: #fff; box-shadow: 0 4px 14px rgba(37, 211, 102, .35); }
.btn--whatsapp:hover { background: #1ebe5b; }
.get-code { display: grid; gap: 10px; }
.get-code__soon { text-align: center; margin: 0 !important; }
.or { display: flex; align-items: center; gap: 10px; margin: 14px 0 !important; color: var(--muted) !important; font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
