/* Bank PO — web client. Sleek, minimal, Linear/Notion-inspired. Mobile-first. */
:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --surface-2: #f6f6f5;
  --border: #ececea;
  --border-strong: #dededb;
  --text: #1c1c1a;
  --muted: #6b6b66;
  --faint: #9a9a93;
  --accent: #5b57d1;
  --accent-hover: #4a46c0;
  --accent-soft: #edecff;
  --green: #1a9c5b;
  --green-soft: #e6f5ed;
  --red: #d4493f;
  --red-soft: #fbeae8;
  --amber: #c98a12;
  --amber-soft: #fbf2dd;
  --shadow-sm: 0 1px 2px rgba(20, 20, 18, 0.04), 0 1px 3px rgba(20, 20, 18, 0.06);
  --shadow-md: 0 4px 14px rgba(20, 20, 18, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
    sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
}
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }

/* layout ------------------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: rgba(251, 251, 250, 0.82);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; letter-spacing: -0.02em; }
.brand .dot {
  width: 22px; height: 22px; border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), #8a86ff);
  display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.who { color: var(--muted); font-size: 13px; }

.container { max-width: 760px; margin: 0 auto; padding: 28px 20px 80px; }
.view { animation: fade 0.28s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* typography -------------------------------------------------------------- */
h1 { font-size: 26px; font-weight: 650; letter-spacing: -0.03em; }
h2 { font-size: 18px; font-weight: 620; letter-spacing: -0.02em; }
h3 { font-size: 15px; font-weight: 600; }
.sub { color: var(--muted); margin-top: 6px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); }

/* cards ------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 12px; align-items: center; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid { display: grid; gap: 12px; }
@media (min-width: 560px) { .grid.two { grid-template-columns: 1fr 1fr; } }

/* buttons ----------------------------------------------------------------- */
.btn {
  appearance: none; border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 10px 16px; font-weight: 550; cursor: pointer; transition: all 0.15s ease;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* inputs ------------------------------------------------------------------ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 550; color: var(--muted); }
.input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); transition: all 0.15s ease;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* chips / badges ---------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
}
.chip-pass { background: var(--green-soft); color: var(--green); }
.chip-fail { background: var(--red-soft); color: var(--red); }
.chip-neutral { background: var(--surface-2); color: var(--muted); }
.chip-accent { background: var(--accent-soft); color: var(--accent); }

/* exam picker cards ------------------------------------------------------- */
.exam {
  text-align: left; cursor: pointer; transition: all 0.16s ease; width: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px;
}
.exam:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.exam .name { font-weight: 600; }
.exam .meta { color: var(--faint); font-size: 13px; margin-top: 3px; }

/* mock player ------------------------------------------------------------- */
.player-head {
  position: sticky; top: 51px; z-index: 10; background: rgba(251,251,250,0.9);
  backdrop-filter: blur(8px); padding: 12px 0 14px; border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.timer { font-variant-numeric: tabular-nums; font-weight: 650; font-size: 17px; letter-spacing: -0.02em; }
.timer.warn { color: var(--amber); }
.timer.danger { color: var(--red); }
.section-name { font-size: 13px; color: var(--muted); font-weight: 550; }
.progress-track { height: 5px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.3s ease; }

.palette { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.pal {
  width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--border-strong);
  background: var(--surface); font-size: 12px; font-weight: 600; cursor: pointer;
  display: grid; place-items: center; transition: all 0.12s ease; color: var(--muted);
}
.pal:hover { border-color: var(--accent); }
.pal.answered { background: var(--accent); color: #fff; border-color: var(--accent); }
.pal.flagged { box-shadow: 0 0 0 2px var(--amber); }
.pal.current { outline: 2px solid var(--text); outline-offset: 1px; }

.stem { font-size: 16px; line-height: 1.6; margin: 6px 0 18px; }
.stim { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px; margin-bottom: 16px; font-size: 14px; color: var(--muted); white-space: pre-wrap; }

.option {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); transition: all 0.13s ease;
  background: var(--surface);
}
.option + .option { margin-top: 9px; }
.option:hover { border-color: var(--accent); background: var(--accent-soft); }
.option.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.option .key {
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border-strong);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0;
  text-transform: uppercase; color: var(--muted); background: var(--surface);
}
.option.selected .key { background: var(--accent); color: #fff; border-color: var(--accent); }
.option.correct { border-color: var(--green); background: var(--green-soft); }
.option.correct .key { background: var(--green); color: #fff; border-color: var(--green); }
.option.wrong { border-color: var(--red); background: var(--red-soft); }
.option.wrong .key { background: var(--red); color: #fff; border-color: var(--red); }

.player-nav { display: flex; gap: 10px; margin-top: 22px; }

/* results ----------------------------------------------------------------- */
.score-hero { text-align: center; padding: 30px 20px; }
.score-big { font-size: 46px; font-weight: 680; letter-spacing: -0.03em; line-height: 1; }
.score-big .denom { color: var(--faint); font-size: 24px; font-weight: 500; }
.sec-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--border); }
.sec-row:first-child { border-top: none; }
.bar-track { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; width: 120px; }
.bar-fill { height: 100%; border-radius: 999px; }

/* review ------------------------------------------------------------------ */
.rev-item { padding: 18px 0; border-top: 1px solid var(--border); }
.rev-item:first-child { border-top: none; }
.solution {
  margin-top: 12px; padding: 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; line-height: 1.6;
}
.solution .label { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.ai-box {
  margin-top: 10px; padding: 14px; border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #faf9ff, #f4f2ff); border: 1px solid var(--accent-soft);
  font-size: 14px; line-height: 1.65; white-space: pre-wrap;
}
.ai-box .label { color: var(--accent); }
.ai-text { white-space: pre-wrap; }
.cursor {
  display: inline-block; width: 7px; height: 15px; margin-left: 2px; vertical-align: text-bottom;
  background: var(--accent); border-radius: 1px; animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

/* misc -------------------------------------------------------------------- */
.spinner {
  width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center-screen { min-height: 70vh; display: grid; place-items: center; }
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 11px 18px; border-radius: 10px;
  font-size: 14px; box-shadow: var(--shadow-md); z-index: 100; animation: fade 0.2s ease;
  max-width: 90vw;
}
.toast.error { background: var(--red); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.tiny { font-size: 12px; }
.mt { margin-top: 16px; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.link { color: var(--accent); cursor: pointer; font-weight: 550; }
.link:hover { text-decoration: underline; }
a { color: var(--accent); }
