/* ============================================================
   SKD CPNS 2026 — stylesheet
   ============================================================ */

:root {
  --red: #b0122a;
  --red-dark: #7d0b1d;
  --red-soft: #fdeef0;
  --gold: #f0b429;
  --ink: #141922;
  --muted: #5c6778;
  --line: #e3e8f1;
  --line-strong: #cdd5e3;
  --bg: #f4f6fb;
  --card: #ffffff;
  --ok: #0a7d4f;
  --ok-soft: #e7f6ef;
  --bad: #c0263d;
  --bad-soft: #fdecef;
  --warn: #a3670a;
  --warn-soft: #fdf4e3;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(20, 25, 34, .06), 0 1px 3px rgba(20, 25, 34, .04);
  --shadow-md: 0 8px 24px rgba(20, 25, 34, .08);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 420px at 50% -180px, #fbe3e7 0%, rgba(251, 227, 231, 0) 70%),
    var(--bg);
  line-height: 1.55;
  font-size: 16px;
}

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5rem; letter-spacing: -.01em; }
p { margin: 0 0 .75rem; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 700; }
small { font-size: .82em; }

button { font: inherit; color: inherit; }

.wrap {
  width: min(1080px, calc(100% - 2rem));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--red);
  color: #fff;
  padding: .5rem .9rem;
  border-radius: 8px;
  z-index: 100;
}
.skip-link:focus { left: 8px; }

:focus-visible {
  outline: 3px solid #2b6cd4;
  outline-offset: 2px;
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: none;
  border: 0;
  padding: .2rem;
  cursor: pointer;
  text-align: left;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(140deg, var(--red), var(--red-dark));
  box-shadow: 0 4px 10px rgba(176, 18, 42, .28);
  flex: 0 0 auto;
}

.brand-text { display: flex; flex-direction: column; }
.brand-text strong { font-size: .98rem; letter-spacing: -.01em; }
.brand-text small { color: var(--muted); font-size: .72rem; }

.nav { display: flex; gap: .25rem; }

.nav-btn {
  border: 0;
  background: transparent;
  padding: .45rem .8rem;
  border-radius: 9px;
  cursor: pointer;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 600;
  transition: background .15s, color .15s;
}
.nav-btn:hover { background: #f0f3f9; color: var(--ink); }
.nav-btn.is-active { background: var(--red-soft); color: var(--red); }

/* ---------- layout helpers ---------- */

main.wrap { padding: 1.6rem 0 2.4rem; }
main.wrap:focus { outline: none; }

.section { margin-top: 1.75rem; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .85rem;
}
.section-head h2 { margin: 0; font-size: 1.18rem; }
.section-head .muted { margin: 0; font-size: .88rem; }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
}

.muted { color: var(--muted); }
.tiny { font-size: .8rem; }
.center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.hidden { display: none !important; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 2rem 2rem 1.9rem;
  color: #fff;
  background:
    radial-gradient(700px 240px at 100% 0%, rgba(255, 255, 255, .18), transparent 60%),
    linear-gradient(135deg, var(--red) 0%, var(--red-dark) 70%);
  box-shadow: 0 14px 34px rgba(125, 11, 29, .25);
}

.hero::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -90px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 26px solid rgba(255, 255, 255, .08);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(1.5rem, 3.4vw, 2.15rem);
  margin-bottom: .45rem;
  max-width: 30ch;
}
.hero p { color: #ffd9de; max-width: 58ch; }
.hero .eyebrow {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #ffe4b8;
  margin-bottom: .5rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; position: relative; z-index: 1; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
  margin-top: 1.5rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, .22);
}
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-size: 1.22rem; }
.hero-stats span { font-size: .76rem; color: #ffd9de; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: .62rem 1.05rem;
  font-weight: 700;
  font-size: .92rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s, background .15s, border-color .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--red); color: #fff; box-shadow: 0 6px 16px rgba(176, 18, 42, .25); }
.btn-primary:hover { background: #990f24; }

.btn-light { background: #fff; color: var(--red-dark); }
.btn-light:hover { background: #fff3f4; }

.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: #f3f6fc; }

.btn-sm { padding: .4rem .7rem; font-size: .83rem; border-radius: 9px; }

.btn-danger-ghost { background: transparent; border-color: #f0c6cc; color: var(--bad); }
.btn-danger-ghost:hover { background: var(--bad-soft); }

/* ---------- start cards ---------- */

.start-card {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  position: relative;
}
.start-card h3 { margin: 0; font-size: 1.05rem; }
.start-card p { color: var(--muted); font-size: .9rem; }
.start-card .card-actions { margin-top: auto; padding-top: .9rem; display: flex; gap: .5rem; flex-wrap: wrap; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  align-self: flex-start;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
}
.tag.gold { background: #fdf3dc; color: var(--warn); }
.tag.blue { background: #eaf1fd; color: #1d4fa8; }
.tag.green { background: var(--ok-soft); color: var(--ok); }

/* ---------- stats / history ---------- */

.stat { display: flex; flex-direction: column; gap: .15rem; }
.stat b { font-size: 1.45rem; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .82rem; }

.history-list { display: flex; flex-direction: column; gap: .6rem; }

.history-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  padding: .8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.history-item .meta { display: flex; flex-direction: column; min-width: 0; }
.history-item .meta b { font-size: .95rem; }
.history-item .meta span { color: var(--muted); font-size: .8rem; }
.history-score { display: flex; gap: 1.1rem; text-align: right; }
.history-score div { display: flex; flex-direction: column; }
.history-score span { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.history-score b { font-size: .98rem; }

/* ---------- exam shell ---------- */

.exam-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  position: sticky;
  top: 64px;
  z-index: 30;
  box-shadow: var(--shadow-sm);
}

.exam-title { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.exam-title b { font-size: .95rem; }

.timer {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 1.05rem;
  padding: .35rem .7rem;
  border-radius: 10px;
  background: #f2f5fb;
  color: var(--ink);
  border: 1px solid var(--line);
}
.timer.is-warn { background: var(--warn-soft); border-color: #f2ddb0; color: var(--warn); }
.timer.is-danger { background: var(--bad-soft); border-color: #f4c2ca; color: var(--bad); }

.exam-actions { display: flex; gap: .5rem; align-items: center; }

.exam-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 1rem;
  margin-top: 1rem;
  align-items: start;
}

.q-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem 1.35rem;
  box-shadow: var(--shadow-sm);
}

.q-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .9rem;
  padding-bottom: .8rem;
  border-bottom: 1px dashed var(--line);
}

.q-no { display: flex; align-items: center; gap: .5rem; }
.q-no b { font-size: 1rem; }
.q-no span { color: var(--muted); font-size: .82rem; }

.q-topic {
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  background: #f3f6fc;
  padding: .22rem .55rem;
  border-radius: 999px;
}

.q-text { font-size: 1rem; margin-bottom: 1rem; }
.q-text p { margin-bottom: .5rem; }
.q-figure { display: flex; justify-content: center; padding: .4rem 0 1rem; }
.q-figure svg { width: min(100%, 520px); height: auto; color: var(--ink); }

.options { display: flex; flex-direction: column; gap: .55rem; }

.opt {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  width: 100%;
  text-align: left;
  padding: .72rem .85rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color .12s, background .12s, box-shadow .12s;
  font-size: .95rem;
  line-height: 1.5;
}
.opt:hover:not(:disabled) { border-color: #c3cddf; background: #fafbff; }
.opt .letter {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 800;
  background: #eef2f9;
  color: var(--muted);
  margin-top: 1px;
}
.opt .opt-body { flex: 1; min-width: 0; }
.opt .opt-figure { display: grid; place-items: center; padding: .1rem 0; }
.opt .opt-figure svg { width: 64px; height: 64px; color: var(--ink); }
.opt.is-selected { border-color: var(--red); background: #fff7f8; box-shadow: 0 0 0 3px rgba(176, 18, 42, .08); }
.opt.is-selected .letter { background: var(--red); color: #fff; }
.opt.is-correct { border-color: var(--ok); background: #f2fbf7; }
.opt.is-correct .letter { background: var(--ok); color: #fff; }
.opt.is-wrong { border-color: var(--bad); background: #fff5f6; }
.opt.is-wrong .letter { background: var(--bad); color: #fff; }
.opt:disabled { cursor: default; }
.opt .tick { margin-left: auto; font-weight: 800; font-size: .85rem; }
.opt .tick.ok { color: var(--ok); }
.opt .tick.no { color: var(--bad); }

.q-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.q-foot-right { display: flex; gap: .5rem; }

/* side panel */

.side { display: flex; flex-direction: column; gap: 1rem; }
.side-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1rem; box-shadow: var(--shadow-sm); }
.side-card h3 { font-size: .9rem; margin-bottom: .7rem; display: flex; justify-content: space-between; align-items: center; }
.side-card h3 span { font-weight: 600; color: var(--muted); font-size: .78rem; }

.legend { display: flex; flex-wrap: wrap; gap: .5rem .9rem; margin-top: .7rem; font-size: .72rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .28rem; vertical-align: -1px; }

.navgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .35rem; }

.navgrid button {
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
  position: relative;
  padding: 0;
}
.navgrid button:hover { border-color: #a9b6cc; }
.navgrid button.is-answered { background: #e8f2ff; border-color: #b9d3f7; color: #1d4fa8; }
.navgrid button.is-flagged::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}
.navgrid button.is-current { outline: 2px solid var(--red); outline-offset: 1px; color: var(--red); }

.progress-wrap { margin-top: .8rem; }
.progress-meta { display: flex; justify-content: space-between; font-size: .74rem; color: var(--muted); margin-bottom: .3rem; }
.progress { height: 8px; background: #edf1f8; border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), #d9405c); border-radius: 999px; transition: width .25s; }

/* practice feedback */

.feedback {
  margin-top: 1rem;
  border-radius: 12px;
  padding: .9rem 1rem;
  border: 1px solid;
  font-size: .92rem;
}
.feedback.ok { background: var(--ok-soft); border-color: #bfe6d5; }
.feedback.no { background: var(--bad-soft); border-color: #f3c8d0; }
.feedback b { display: block; margin-bottom: .25rem; }
.feedback.ok b { color: var(--ok); }
.feedback.no b { color: var(--bad); }
.feedback p { margin-bottom: .35rem; }
.feedback .answer-key { font-weight: 700; }

/* ---------- result ---------- */

.result-hero {
  border-radius: 20px;
  padding: 1.6rem;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
.result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.result-total { display: flex; align-items: baseline; gap: .4rem; }
.result-total b { font-size: 2.6rem; line-height: 1; letter-spacing: -.03em; }
.result-total span { color: var(--muted); font-size: .95rem; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .7rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.no { background: var(--bad-soft); color: var(--bad); }
.badge.neutral { background: #eef2f9; color: var(--muted); }

.score-rows { display: flex; flex-direction: column; gap: .9rem; margin-top: 1.3rem; }
.score-row { display: grid; grid-template-columns: 120px 1fr 82px; gap: .8rem; align-items: center; }
.score-row .name { font-weight: 700; font-size: .9rem; }
.score-row .name small { display: block; font-weight: 500; color: var(--muted); font-size: .74rem; }
.score-row .val { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.score-row .val small { font-weight: 500; color: var(--muted); font-size: .75rem; }

.bar { position: relative; height: 10px; background: #eef2f9; border-radius: 999px; overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--red), #d9405c); border-radius: 999px; }
.bar.is-pass > i { background: linear-gradient(90deg, #0a8a58, #35b37f); }
.bar .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #374151; opacity: .5; }

.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: .55rem .5rem; border-bottom: 1px solid var(--line); text-align: left; }
.table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- review ---------- */

.filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.chip {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 999px;
  padding: .35rem .8rem;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
}
.chip.is-active { background: var(--red); border-color: var(--red); color: #fff; }

.review-item { border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; background: #fff; margin-bottom: .7rem; }
.review-top { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .5rem; }
.review-top .no { font-weight: 800; font-size: .85rem; }
.review-q { font-weight: 600; margin-bottom: .6rem; white-space: pre-line; }
.review-ans { display: grid; gap: .3rem; font-size: .9rem; margin-bottom: .55rem; }
.review-ans div { display: flex; gap: .45rem; }
.review-ans .k { color: var(--muted); min-width: 118px; }
.review-exp { font-size: .9rem; background: #f7f9fd; border-radius: 10px; padding: .65rem .8rem; color: #33404f; }
.review-exp b { color: var(--ink); }

/* ---------- misc ---------- */

.note {
  display: flex;
  gap: .75rem;
  padding: .9rem 1rem;
  border-radius: 12px;
  background: #fff8e6;
  border: 1px solid #f4e1b4;
  color: #6b4a08;
  font-size: .88rem;
}
.note.info { background: #eef4ff; border-color: #cfdefb; color: #1c3f7a; }
.note b { color: inherit; }

.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
}
.empty h3 { color: var(--ink); }

.kisi-item { padding: .8rem 0; border-bottom: 1px dashed var(--line); }
.kisi-item:last-child { border-bottom: 0; padding-bottom: 0; }
.kisi-item b { display: block; margin-bottom: .15rem; }
.kisi-item span { color: var(--muted); font-size: .88rem; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 30, .45);
  display: grid;
  place-items: center;
  z-index: 90;
  padding: 1rem;
}
.modal {
  background: #fff;
  border-radius: 18px;
  padding: 1.4rem;
  width: min(440px, 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
}
.modal h3 { margin-bottom: .35rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.2rem; }

/* pemilih jenis soal */
.modal-wide { width: min(640px, 100%); max-height: calc(100vh - 2rem); display: flex; flex-direction: column; }
.pick-count { align-items: center; margin: .9rem 0 .2rem; }
.pick-count .chip { padding: .28rem .7rem; }
.pick-scroll { overflow: auto; margin-top: .6rem; padding-right: .2rem; flex: 1 1 auto; min-height: 0; }
.pick-group { margin-bottom: 1rem; }
.pick-group:last-child { margin-bottom: 0; }
.pick-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.pick-head .chip { padding: .18rem .55rem; font-size: .74rem; }
.pick-list { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; }
.pick-item {
  display: flex; align-items: center; gap: .45rem;
  border: 1px solid var(--line); border-radius: 10px;
  padding: .45rem .55rem; font-size: .86rem;
  cursor: pointer; background: #fff;
}
.pick-item:hover { border-color: var(--line-strong); }
.pick-item.is-on { border-color: var(--red); background: #fdf1f3; }
.pick-item input { accent-color: var(--red); }
.pick-name { flex: 1; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: #1c2431;
  color: #fff;
  padding: .55rem .95rem;
  border-radius: 10px;
  font-size: .86rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 120;
  max-width: calc(100% - 2rem);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.footer { border-top: 1px solid var(--line); background: #fff; padding: 1.2rem 0; margin-top: 2rem; }
.footer-in { font-size: .8rem; color: var(--muted); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-in p { max-width: 70ch; }
.footer-meta { white-space: nowrap; }

kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .72rem;
  background: #eef2f9;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: .05rem .3rem;
}

/* ---------- akun & login ---------- */

.account-chip {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-left: .2rem;
  padding-left: .55rem;
  border-left: 1px solid var(--line);
}
.account-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  font-size: .72rem;
  font-weight: 800;
}
.account-name {
  max-width: 13ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .85rem;
  font-weight: 600;
}
.account-logout { font-size: .82rem; }
.nav.is-locked > .nav-btn { display: none; }

.auth-shell { display: grid; place-items: center; padding: .8rem 0 2rem; }

.auth-card {
  width: min(480px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.6rem;
  box-shadow: var(--shadow-md);
}
.auth-card h1 { font-size: 1.4rem; margin: .55rem 0 .4rem; }
.auth-card > p { max-width: 46ch; }

.auth-tabs {
  display: flex;
  gap: .25rem;
  background: #f3f6fc;
  padding: .25rem;
  border-radius: 11px;
  margin: 1.1rem 0 1rem;
}
.auth-tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: .5rem;
  border-radius: 9px;
  font-weight: 700;
  font-size: .9rem;
  color: var(--muted);
  cursor: pointer;
}
.auth-tab.is-active { background: #fff; color: var(--red); box-shadow: var(--shadow-sm); }

.auth-form { display: flex; flex-direction: column; gap: .75rem; }

.field { display: flex; flex-direction: column; gap: .3rem; }
.field span { font-size: .8rem; font-weight: 700; color: var(--muted); }
.field input {
  font: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  padding: .6rem .7rem;
}
.field input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(176, 18, 42, .12); }

.auth-check { display: flex; align-items: center; gap: .45rem; font-size: .85rem; color: var(--muted); }
.auth-check input { accent-color: var(--red); }
.auth-submit { width: 100%; margin-top: .2rem; }
.auth-error { font-size: .85rem; }
.auth-switch { margin-top: .15rem; }

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--red);
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }

.auth-note {
  margin-top: 1.1rem;
  padding-top: .9rem;
  border-top: 1px dashed var(--line);
  font-size: .76rem;
  line-height: 1.5;
  color: var(--muted);
}
.auth-note b { color: var(--ink); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .exam-body { grid-template-columns: 1fr; }
  .side { order: -1; }
  .side-card .navgrid { grid-template-columns: repeat(10, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .wrap { width: calc(100% - 1.4rem); }
  .hero { padding: 1.4rem 1.15rem; border-radius: 18px; }
  .topbar-in { gap: .5rem; }
  .brand-text small { display: none; }
  .nav-btn { padding: .4rem .55rem; font-size: .85rem; }
  .account-name { display: none; }
  .auth-card { padding: 1.2rem; }
  .auth-card h1 { font-size: 1.25rem; }
  .auth-note { font-size: .72rem; }
  .grid-2, .grid-3, .grid-5 { grid-template-columns: 1fr; }
  .exam-top { top: 56px; padding: .6rem .7rem; }
  .q-card { padding: 1rem; }
  .score-row { grid-template-columns: 88px 1fr 64px; gap: .5rem; }
  .side-card .navgrid { grid-template-columns: repeat(8, 1fr); }
  .history-item { align-items: flex-start; flex-direction: column; }
  .history-score { gap: .8rem; }
  .pick-list { grid-template-columns: 1fr; }
  .modal-wide { padding: 1rem; }
  .footer-meta { white-space: normal; }
  .q-foot { flex-direction: column; align-items: stretch; }
  .q-foot-right { display: grid; grid-template-columns: 1fr 1fr; }
  .q-foot .btn { width: 100%; }
  .hero-stats { gap: 1.1rem; }
  .opt { font-size: .93rem; }
}

@media print {
  .topbar, .footer, .exam-actions, .side, .q-foot, .filters { display: none; }
  body { background: #fff; }
}
