/* ============================================================
   APTET Paper II — Mock Test Platform
   Clean academic light theme
   ============================================================ */
:root {
  --indigo:      #4f46e5;
  --indigo-600:  #4338ca;
  --indigo-400:  #6366f1;
  --sky:         #0ea5e9;
  --teal:        #14b8a6;
  --green:       #16a34a;
  --green-soft:  #dcfce7;
  --red:         #dc2626;
  --red-soft:    #fee2e2;
  --amber:       #f59e0b;
  --amber-soft:  #fef3c7;
  --purple:      #7c3aed;
  --purple-soft: #ede9fe;

  --ink:      #0f172a;
  --ink-2:    #334155;
  --muted:    #64748b;
  --line:     #e6e9f2;
  --line-2:   #eef1f8;
  --bg:       #f4f6fc;
  --bg-2:     #eef2fb;
  --card:     #ffffff;

  --radius:    18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.05);
  --shadow:    0 10px 30px -12px rgba(30,41,90,.18), 0 4px 12px -6px rgba(30,41,90,.10);
  --shadow-lg: 0 30px 60px -20px rgba(30,41,90,.28);
  --font:  'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --head:  'Sora', var(--font);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 85% -10%, #e8edff 0%, transparent 55%),
    radial-gradient(1000px 500px at -10% 10%, #e6fbff 0%, transparent 50%),
    var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.15; color: var(--ink); }
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.grad {
  background: linear-gradient(100deg, var(--indigo) 10%, var(--sky) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Header / footer ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(18px, 5vw, 48px);
  background: rgba(255,255,255,.72);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  color: #fff; font-family: var(--head); font-weight: 800; font-size: 22px;
  background: linear-gradient(135deg, var(--indigo), var(--indigo-400));
  box-shadow: 0 8px 20px -6px rgba(79,70,229,.6);
}
.brand-text { display: flex; flex-direction: column; font-weight: 700; font-size: 1.02rem; }
.brand-text b { color: var(--indigo); font-weight: 800; }
.brand-text small { font-weight: 500; color: var(--muted); font-size: .74rem; letter-spacing: .02em; }
.site-nav { display: flex; align-items: center; gap: 18px; font-weight: 600; }
.site-nav a { color: var(--ink-2); }
.site-nav a:hover { color: var(--indigo); }
.pill {
  padding: 6px 12px; border-radius: 999px; font-size: .78rem; font-weight: 700;
  color: var(--indigo-600); background: var(--indigo-soft, #eef0ff); border: 1px solid #e0e3ff;
}
.site-main { min-height: 60vh; }
.site-footer {
  margin-top: 60px; padding: 30px clamp(18px, 5vw, 48px);
  border-top: 1px solid var(--line); text-align: center; color: var(--ink-2); font-size: .9rem;
}
.site-footer .muted { font-size: .82rem; }

/* ---------- Buttons ---------- */
.btn {
  --b: var(--indigo);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 12px; border: 1px solid transparent;
  font-family: var(--font); font-weight: 700; font-size: .95rem; cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  white-space: nowrap; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 14px 26px; font-size: 1rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-primary {
  color: #fff; background: linear-gradient(135deg, var(--indigo), var(--indigo-400));
  box-shadow: 0 12px 24px -10px rgba(79,70,229,.7);
}
.btn-primary:hover { box-shadow: 0 16px 30px -10px rgba(79,70,229,.8); transform: translateY(-1px); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-2); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: #cdd3ea; color: var(--indigo); }
.btn-soft { background: var(--bg-2); color: var(--ink-2); border-color: var(--line); }
.btn-soft:hover { background: #e6ebfa; }
.btn-warn { background: var(--purple-soft); color: var(--purple); border-color: #ddd0fb; }
.btn-warn:hover { background: #e4dbfb; }
.is-disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* ---------- Layout helpers ---------- */
.section { padding: clamp(40px, 6vw, 80px) clamp(18px, 5vw, 48px); max-width: 1200px; margin: 0 auto; }
.section.narrow { max-width: 940px; }
.section-head { text-align: center; margin-bottom: 34px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 8px; }
.back-link { display: inline-block; margin-bottom: 18px; color: var(--muted); font-weight: 600; }
.back-link:hover { color: var(--indigo); }

/* ---------- Hero ---------- */
.hero { padding: clamp(40px, 7vw, 90px) clamp(18px, 5vw, 48px) 20px; max-width: 1200px; margin: 0 auto; }
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-block; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  font-size: .76rem; color: var(--indigo-600); background: #eaecff; padding: 6px 12px; border-radius: 999px;
  border: 1px solid #dfe2ff; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); margin: 0 0 16px; letter-spacing: -.02em; }
.lede { font-size: 1.08rem; color: var(--ink-2); max-width: 560px; }
.hero-cta { display: flex; gap: 14px; margin: 26px 0 30px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 26px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats b { font-family: var(--head); font-size: 1.7rem; color: var(--indigo); line-height: 1; }
.hero-stats span { color: var(--muted); font-size: .85rem; font-weight: 600; }

.hero-card { position: relative; }
.mini-exam {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 22px;
  box-shadow: var(--shadow-lg); transform: rotate(1.4deg);
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 50% { transform: rotate(1.4deg) translateY(-10px); } }
.mini-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.mini-timer {
  font-family: var(--head); font-weight: 800; font-size: 1.35rem; color: var(--indigo);
  background: #eef0ff; padding: 6px 12px; border-radius: 10px;
}
.mini-tag { font-size: .72rem; font-weight: 800; color: #fff; background: var(--green); padding: 4px 10px; border-radius: 999px; }
.mini-q { font-weight: 700; margin-bottom: 12px; }
.mini-opt { padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; font-size: .92rem; color: var(--ink-2); }
.mini-opt.sel { border-color: var(--indigo); background: #eef0ff; color: var(--indigo-600); font-weight: 700; }
.mini-palette { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-top: 14px; }
.mini-palette span { aspect-ratio: 1; border-radius: 7px; background: #eef1f8; }
.mini-palette .ok { background: var(--green); } .mini-palette .no { background: var(--red); }
.mini-palette .mark { background: var(--purple); } .mini-palette .cur { background: var(--indigo); box-shadow: 0 0 0 3px #c7ccff; }

/* ---------- Test grid ---------- */
.test-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.test-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform .18s ease, box-shadow .25s ease, border-color .2s ease;
}
.test-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--indigo), var(--sky));
}
.test-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: #d7dcf1; }
.test-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.test-num { font-family: var(--head); font-weight: 800; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--indigo); }
.best-badge { font-size: .74rem; font-weight: 800; color: var(--green); background: var(--green-soft); padding: 4px 10px; border-radius: 999px; }
.test-card h3 { font-size: 1.2rem; margin: 4px 0 14px; }
.test-meta { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.test-meta li { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .86rem; font-weight: 600; }
.test-meta svg { width: 16px; height: 16px; fill: none; stroke: var(--indigo-400); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.test-sections { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.chip { font-size: .74rem; font-weight: 700; color: var(--ink-2); background: var(--bg-2); border: 1px solid var(--line-2); padding: 5px 9px; border-radius: 8px; }

/* ---------- How it works ---------- */
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.how-step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); }
.how-n { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; font-family: var(--head); font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--indigo), var(--indigo-400)); margin-bottom: 14px; }
.how-step h4 { margin: 0 0 8px; font-size: 1.15rem; }
.how-step p { margin: 0; color: var(--ink-2); }

/* ---------- Instructions ---------- */
.instr-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.instr-head { padding: 30px 34px 20px; border-bottom: 1px solid var(--line-2); background: linear-gradient(180deg, #fbfcff, #fff); }
.instr-head h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 6px 0; }
.instr-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; }
.instr-figures { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 26px 34px; }
.fig { background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 16px; text-align: center; }
.fig b { display: block; font-family: var(--head); font-size: 1.8rem; color: var(--indigo); line-height: 1; }
.fig span { font-size: .82rem; color: var(--muted); font-weight: 600; }
.instr-sections { padding: 26px 34px; border-left: 1px solid var(--line-2); }
.instr-sections h3 { margin: 0 0 12px; }
.instr-sections ul { list-style: none; margin: 0; padding: 0; }
.instr-sections li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--line); font-weight: 600; color: var(--ink-2); }
.instr-sections li b { color: var(--indigo); }
.instr-body { padding: 26px 34px; }
.instr-body h3 { margin: 0 0 12px; }
.instr-body ol { margin: 0 0 16px; padding-left: 20px; color: var(--ink-2); }
.instr-body li { margin-bottom: 9px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 0 20px; padding: 14px 16px; background: var(--bg); border-radius: var(--radius-sm); border: 1px solid var(--line-2); }
.lg { display: flex; align-items: center; gap: 8px; font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.lg i { width: 20px; height: 20px; border-radius: 6px; display: inline-block; }
.s-answered   { background: var(--green); }
.s-notanswered{ background: var(--red); }
.s-notvisited { background: #fff; border: 1.5px solid #cbd3e6; }
.s-marked     { background: var(--purple); }
.s-markedans  { background: var(--purple); position: relative; }
.s-markedans::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--green); border: 1.5px solid #fff; }
.agree { display: flex; align-items: center; gap: 12px; margin: 6px 34px 0; padding: 16px 18px; background: #eef0ff; border: 1px solid #dfe2ff; border-radius: var(--radius-sm); font-weight: 600; color: var(--ink-2); cursor: pointer; }
.agree input { width: 20px; height: 20px; accent-color: var(--indigo); }
.instr-actions { display: flex; justify-content: flex-end; gap: 12px; padding: 22px 34px 30px; }

/* ============================================================
   EXAM MODE
   ============================================================ */
body.exam-mode {
  background: #eef1f9;
}
.exam-shell { display: flex; flex-direction: column; min-height: 100vh; }
.exam-topbar {
  display: flex; align-items: center; gap: 18px; padding: 12px clamp(14px, 3vw, 28px);
  background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
  box-shadow: var(--shadow-sm);
}
.exam-title { display: flex; flex-direction: column; min-width: 0; }
.exam-title h1 { font-size: 1rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exam-sections { display: flex; gap: 8px; flex: 1; overflow-x: auto; padding: 4px; scrollbar-width: thin; }
.sec-tab {
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg);
  font-weight: 700; font-size: .84rem; color: var(--ink-2); cursor: pointer; white-space: nowrap;
  transition: all .15s ease;
}
.sec-tab small { display: block; font-size: .68rem; color: var(--muted); font-weight: 600; }
.sec-tab.is-active { background: linear-gradient(135deg, var(--indigo), var(--indigo-400)); color: #fff; border-color: transparent; }
.sec-tab.is-active small { color: #dfe2ff; }

.exam-timer { display: flex; align-items: center; gap: 10px; }
.timer-ring { width: 44px; height: 44px; transform: rotate(-90deg); }
.timer-ring .ring-bg { fill: none; stroke: #e7ebf5; stroke-width: 5; }
.timer-ring .ring-fg { fill: none; stroke: var(--indigo); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 119; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear, stroke .4s; }
.timer-read { display: flex; flex-direction: column; line-height: 1.1; }
.timer-read span { font-family: var(--head); font-weight: 800; font-size: 1.05rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.timer-read small { font-size: .68rem; color: var(--muted); font-weight: 600; }
.exam-timer.warn .timer-read span { color: var(--red); }
.exam-timer.warn .ring-fg { stroke: var(--red); }

.exam-body { display: grid; grid-template-columns: 1fr 320px; gap: 20px; padding: 20px clamp(14px, 3vw, 28px) 30px; flex: 1; max-width: 1400px; margin: 0 auto; width: 100%; }

.exam-main { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; overflow: hidden; }
.q-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line-2); background: #fbfcff; }
.q-index { font-weight: 700; color: var(--ink-2); }
.q-index b { color: var(--indigo); font-size: 1.15rem; }
.q-index i { color: var(--muted); font-style: normal; font-weight: 600; }
.q-section { display: block; font-size: .8rem; color: var(--muted); font-weight: 700; margin-top: 2px; }
.q-head-right { text-align: right; }
.q-topic { display: block; font-size: .8rem; font-weight: 700; color: var(--indigo-600); }
.q-marks { font-size: .74rem; color: var(--green); font-weight: 700; }
.q-content { padding: 24px; flex: 1; }
.q-text { font-size: 1.14rem; font-weight: 600; color: var(--ink); margin: 0 0 22px; line-height: 1.55; white-space: pre-wrap; }
.q-options { display: flex; flex-direction: column; gap: 12px; }
.q-opt {
  display: flex; align-items: center; gap: 14px; padding: 15px 18px; border: 1.5px solid var(--line);
  border-radius: 14px; cursor: pointer; transition: all .14s ease; background: #fff;
}
.q-opt:hover { border-color: var(--indigo-400); background: #fafbff; }
.q-opt.selected { border-color: var(--indigo); background: #eef0ff; box-shadow: 0 0 0 3px #e0e3ff inset; }
.q-opt .letter { width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-family: var(--head); background: var(--bg-2); color: var(--ink-2); border: 1px solid var(--line); }
.q-opt.selected .letter { background: var(--indigo); color: #fff; border-color: transparent; }
.q-opt .otext { font-weight: 500; color: var(--ink); }
.q-opt input { display: none; }

.q-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--line-2); background: #fbfcff; flex-wrap: wrap; }
.q-actions-left, .q-actions-right { display: flex; gap: 10px; flex-wrap: wrap; }

/* palette */
.exam-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); }
.side-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 14px 16px; }
.side-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.side-legend .lg { font-size: .78rem; }
.side-palette { padding: 8px; flex: 1; min-height: 0; display: flex; }
.side-scroll { overflow-y: auto; width: 100%; padding: 8px; }
.pal-sec-title { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 12px 4px 8px; }
.pal-sec-title:first-child { margin-top: 4px; }
.pal-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.pal-btn {
  aspect-ratio: 1; border-radius: 10px; border: 1.5px solid #cbd3e6; background: #fff; color: var(--ink-2);
  font-weight: 800; font-family: var(--head); font-size: .92rem; cursor: pointer; position: relative;
  transition: transform .1s ease;
}
.pal-btn:hover { transform: scale(1.08); }
.pal-btn.answered { background: var(--green); color: #fff; border-color: transparent; }
.pal-btn.notanswered { background: var(--red); color: #fff; border-color: transparent; }
.pal-btn.marked { background: var(--purple); color: #fff; border-color: transparent; }
.pal-btn.markedans { background: var(--purple); color: #fff; border-color: transparent; }
.pal-btn.markedans::after { content: ""; position: absolute; right: 2px; bottom: 2px; width: 9px; height: 9px; border-radius: 50%; background: var(--green); border: 1.5px solid #fff; }
.pal-btn.current { outline: 3px solid #c7ccff; outline-offset: 1px; box-shadow: 0 0 0 2px var(--indigo); }

.side-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.side-summary .sum { background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; }
.side-summary .sum b { font-family: var(--head); font-size: 1.15rem; display: block; }
.side-summary .sum span { font-size: .72rem; color: var(--muted); font-weight: 600; }
#sumAnswered b { color: var(--green); }
#sumNotAnswered b { color: var(--red); }
#sumMarked b { color: var(--purple); }

/* modal */
.modal-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(15,23,42,.55); backdrop-filter: blur(4px); padding: 20px; }
/* A class selector's `display: grid` would otherwise beat the UA `[hidden]{display:none}`
   rule (equal specificity, later wins), leaving modals permanently visible. Force hidden. */
.modal-overlay[hidden] { display: none; }
.modal { background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); padding: 30px; max-width: 480px; width: 100%; text-align: center; animation: pop .2s ease; }
@keyframes pop { from { transform: scale(.92); opacity: 0; } }
.modal h2 { margin: 0 0 8px; }
.modal-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 20px 0; }
.modal-summary div { background: var(--bg); border-radius: 12px; padding: 12px 6px; }
.modal-summary b { display: block; font-family: var(--head); font-size: 1.3rem; }
.modal-summary span { font-size: .72rem; color: var(--muted); font-weight: 600; }
.modal-actions { display: flex; gap: 12px; justify-content: center; }

/* ============================================================
   RESULT PAGE
   ============================================================ */
.result-banner { display: flex; align-items: center; gap: 18px; padding: 22px 26px; border-radius: var(--radius); margin-bottom: 24px; box-shadow: var(--shadow); }
.result-banner.is-pass { background: linear-gradient(120deg, #ecfdf5, #d1fae5); border: 1px solid #a7f3d0; }
.result-banner.is-fail { background: linear-gradient(120deg, #fff7ed, #ffedd5); border: 1px solid #fed7aa; }
.result-banner h1 { font-size: 1.5rem; margin: 0 0 2px; }
.result-banner p { margin: 0; color: var(--ink-2); }
.rb-emoji { font-size: 2.6rem; }

.result-top { display: grid; grid-template-columns: 260px 1fr; gap: 26px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); margin-bottom: 24px; }
.score-donut { position: relative; width: 220px; height: 220px; margin: 0 auto; }
.score-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-bg { fill: none; stroke: #eef1f8; stroke-width: 16; }
.donut-fg { fill: none; stroke-width: 16; stroke-linecap: round; transition: stroke-dasharray 1.1s cubic-bezier(.3,1,.4,1); }
.donut-fg.ok { stroke: url(#g) ; stroke: var(--green); }
.donut-fg.no { stroke: var(--amber); }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center b { font-family: var(--head); font-size: 2.6rem; line-height: 1; }
.donut-center span { color: var(--muted); font-weight: 700; }
.score-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 16px; text-align: center; }
.stat b { display: block; font-family: var(--head); font-size: 1.7rem; line-height: 1; }
.stat span { font-size: .82rem; color: var(--muted); font-weight: 600; }
.stat-ok b { color: var(--green); } .stat-no b { color: var(--red); } .stat-skip b { color: var(--muted); }
.stat-acc b { color: var(--indigo); } .stat-att b { color: var(--ink); } .stat-time b { color: var(--sky); font-size: 1.4rem; }

.result-sections { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); margin-bottom: 24px; }
.result-sections h2 { margin: 0 0 18px; font-size: 1.3rem; }
.sec-row { display: grid; grid-template-columns: 240px 1fr 54px; gap: 16px; align-items: center; margin-bottom: 14px; }
.sec-name { font-weight: 700; color: var(--ink); }
.sec-name small { display: block; font-weight: 600; color: var(--muted); font-size: .8rem; }
.sec-bar { height: 12px; background: #eef1f8; border-radius: 999px; overflow: hidden; }
.sec-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--indigo), var(--sky)); transition: width 1s cubic-bezier(.3,1,.4,1); }
.sec-pct { font-weight: 800; font-family: var(--head); text-align: right; color: var(--indigo); }

.result-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

/* ============================================================
   REVIEW PAGE
   ============================================================ */
.review-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.review-head h1 { font-size: 1.7rem; margin: 0 0 4px; }
.review-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.rf { padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 700; color: var(--ink-2); cursor: pointer; display: flex; gap: 8px; align-items: center; box-shadow: var(--shadow-sm); }
.rf span { background: var(--bg-2); padding: 1px 8px; border-radius: 999px; font-size: .78rem; }
.rf.is-active { background: var(--indigo); color: #fff; border-color: transparent; }
.rf.is-active span { background: rgba(255,255,255,.25); }

.review-section-head { font-size: 1.1rem; margin: 26px 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--line); color: var(--indigo-600); }
.review-card { background: #fff; border: 1px solid var(--line); border-left-width: 5px; border-radius: var(--radius-sm); padding: 20px 22px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.review-card.status-correct { border-left-color: var(--green); }
.review-card.status-incorrect { border-left-color: var(--red); }
.review-card.status-skipped { border-left-color: #cbd3e6; }
.rc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.rc-num { font-family: var(--head); font-weight: 800; color: var(--indigo); }
.rc-topic { font-size: .76rem; font-weight: 700; color: var(--ink-2); background: var(--bg-2); padding: 3px 10px; border-radius: 999px; }
.rc-badge { margin-left: auto; font-size: .78rem; font-weight: 800; padding: 4px 12px; border-radius: 999px; }
.b-correct { color: var(--green); background: var(--green-soft); }
.b-incorrect { color: var(--red); background: var(--red-soft); }
.b-skipped { color: var(--muted); background: var(--bg-2); }
.rc-question { font-size: 1.06rem; font-weight: 600; margin: 0 0 16px; white-space: pre-wrap; }
.rc-options { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.rc-opt { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 11px; }
.rc-opt .opt-letter { width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-family: var(--head); background: var(--bg-2); color: var(--ink-2); font-size: .85rem; }
.rc-opt .opt-text { flex: 1; font-weight: 500; }
.rc-opt .opt-tags { display: flex; gap: 6px; }
.rc-opt em { font-style: normal; font-size: .72rem; font-weight: 800; padding: 3px 8px; border-radius: 999px; }
.tag-you { color: var(--ink-2); background: var(--bg-2); }
.tag-correct { color: var(--green); background: var(--green-soft); }
.opt-correct { border-color: var(--green); background: #f0fdf4; }
.opt-correct .opt-letter { background: var(--green); color: #fff; }
.opt-wrong { border-color: var(--red); background: #fef2f2; }
.opt-wrong .opt-letter { background: var(--red); color: #fff; }
.opt-wrong .tag-you { color: var(--red); background: var(--red-soft); }
.rc-explain { background: linear-gradient(180deg, #f7f9ff, #f2f5ff); border: 1px solid #e2e7fb; border-radius: var(--radius-sm); padding: 14px 16px; }
.rc-explain-label { display: inline-block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--indigo-600); margin-bottom: 4px; }
.rc-explain p { margin: 0; color: var(--ink-2); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-card { max-width: 420px; }
  .how-grid { grid-template-columns: 1fr; }
  .exam-body { grid-template-columns: 1fr; }
  .exam-side { position: static; max-height: none; order: 2; }
  .instr-grid { grid-template-columns: 1fr; }
  .instr-sections { border-left: none; border-top: 1px solid var(--line-2); }
  .result-top { grid-template-columns: 1fr; }
  .result-banner { flex-direction: column; text-align: center; }
}
@media (max-width: 640px) {
  .score-stats { grid-template-columns: repeat(2, 1fr); }
  .sec-row { grid-template-columns: 1fr; gap: 6px; }
  .sec-pct { text-align: left; }
  .exam-title h1 { max-width: 40vw; }
  .modal-summary { grid-template-columns: repeat(2, 1fr); }
  .q-actions { flex-direction: column; align-items: stretch; }
  .q-actions-left, .q-actions-right { justify-content: space-between; }
}
