:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --ink: #1b1d22;
  --muted: #5d6270;
  --line: #e3e1da;
  --accent: #0f6b5c;
  --accent-ink: #ffffff;
  --accent-soft: #e2f1ed;
  --gold: #b3862b;
  --bad: #b23a3a;
  --bad-soft: #f8e6e6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 24px rgba(0,0,0,.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111316; --surface: #1a1d22; --ink: #eceae4; --muted: #a2a6b0; --line: #2c3038;
    --accent: #3cbfa5; --accent-ink: #08201b; --accent-soft: #17302b; --gold: #d8ac52;
    --bad: #e07a7a; --bad-soft: #3a1f1f; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111316; --surface: #1a1d22; --ink: #eceae4; --muted: #a2a6b0; --line: #2c3038;
  --accent: #3cbfa5; --accent-ink: #08201b; --accent-soft: #17302b; --gold: #d8ac52;
  --bad: #e07a7a; --bad-soft: #3a1f1f; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }

header.top { border-bottom: 1px solid var(--line); background: var(--surface); }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-weight: 800; font-size: 20px; letter-spacing: -.02em; color: var(--ink); text-decoration: none; display: flex; gap: 8px; align-items: center; }
.brand .mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); font-size: 14px; }
nav a { color: var(--muted); text-decoration: none; margin-left: 20px; font-size: 15px; }
nav a:hover { color: var(--ink); }

.demo-banner { background: var(--accent-soft); color: var(--ink); font-size: 14px; text-align: center; padding: 8px 16px; }

h1 { font-size: clamp(32px, 6vw, 52px); line-height: 1.08; letter-spacing: -.03em; margin: 0 0 16px; }
h2 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 12px; }
h3 { font-size: 18px; margin: 0 0 6px; }
.lead { font-size: 19px; color: var(--muted); max-width: 620px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.hero { padding: 72px 0 48px; }
.pill { display: inline-block; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; margin-bottom: 18px; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px;
  padding: 13px 22px; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.small { padding: 8px 14px; font-size: 14px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 40px 0 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat b { display: block; font-size: 28px; letter-spacing: -.02em; }
.stat > span { color: var(--muted); font-size: 14px; }

section.block { padding: 48px 0; border-top: 1px solid var(--line); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card p { margin: 0; color: var(--muted); }
.num { color: var(--accent); font-weight: 800; font-size: 14px; margin-bottom: 6px; display: block; }

footer { border-top: 1px solid var(--line); padding: 28px 0 48px; color: var(--muted); font-size: 14px; }

/* forms */
label { display: block; font-weight: 600; margin: 16px 0 6px; }
input[type=text], input[type=email] {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--muted); font-size: 15px; }
.check input { margin-top: 5px; }
.error { color: var(--bad); background: var(--bad-soft); border-radius: 10px; padding: 10px 14px; margin-top: 16px; }
.rules { margin: 0; padding-left: 20px; color: var(--muted); }
.rules li { margin: 4px 0; }

/* exam */
.exam-bar { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.exam-bar .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; padding: 6px 12px; border-radius: 8px; background: var(--accent-soft); }
.timer.low { background: var(--bad-soft); color: var(--bad); }
.progress { height: 4px; background: var(--line); }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.q-meta { color: var(--muted); font-size: 14px; margin: 28px 0 10px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.scenario { background: var(--surface); border-left: 4px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; padding: 16px 18px; margin: 0 0 16px; }
.question { font-size: 20px; font-weight: 650; margin: 0 0 16px; letter-spacing: -.01em; }
.options { display: grid; gap: 10px; }
.option {
  text-align: left; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 14px 16px; font: inherit; color: var(--ink); cursor: pointer; display: flex; gap: 12px;
}
.option:hover { border-color: var(--accent); }
.option .key { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.option.selected { border-color: var(--accent); background: var(--accent-soft); }
.option.selected .key { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.option:disabled { cursor: default; }
.option:disabled:hover { border-color: var(--line); }
.option.correct, .option.correct:hover { border-color: var(--accent); background: var(--accent-soft); }
.option.correct .key { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.option.wrong, .option.wrong:hover { border-color: var(--bad); background: var(--bad-soft); }
.option.wrong .key { background: var(--bad); border-color: var(--bad); color: #fff; }
.feedback { margin-top: 16px; padding: 14px 16px; border-radius: 12px; }
.feedback.good { background: var(--accent-soft); }
.feedback.bad { background: var(--bad-soft); }
.exam-nav { display: flex; justify-content: space-between; gap: 12px; margin: 24px 0; flex-wrap: wrap; }
.dots { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 40px; }
.dot { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 12px; cursor: pointer; color: var(--muted); font-family: inherit; }
.dot.answered { background: var(--accent-soft); color: var(--ink); border-color: transparent; }
.dot.current { outline: 2px solid var(--accent); }
.dot.flagged { border-color: var(--gold); border-width: 2px; }

/* result */
.result { padding: 56px 0; text-align: center; }
.score { font-size: 64px; font-weight: 800; letter-spacing: -.03em; margin: 8px 0; }
.bars { text-align: left; max-width: 520px; margin: 32px auto; display: grid; gap: 14px; }
.bar-row { font-size: 15px; }
.bar-row .track { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.bar-row .track i { display: block; height: 100%; background: var(--accent); }

/* certificate */
.cert {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  padding: clamp(24px, 6vw, 56px); text-align: center; position: relative; margin: 40px 0 24px;
}
.cert::before { content: ""; position: absolute; inset: 10px; border: 1.5px solid var(--gold); border-radius: 12px; pointer-events: none; opacity: .6; }
.cert .seal { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: var(--gold); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 26px; }
.cert .who { font-size: clamp(28px, 5vw, 40px); font-weight: 750; letter-spacing: -.02em; margin: 10px 0; }
.cert .what { font-size: 20px; font-weight: 650; }
.cert dl { display: flex; justify-content: center; gap: 32px; flex-wrap: wrap; margin: 28px 0 0; }
.cert dt { color: var(--muted); font-size: 13px; }
.cert dd { margin: 0; font-weight: 650; }
.verified { display: inline-flex; gap: 6px; align-items: center; color: var(--accent); font-weight: 650; font-size: 14px; }
.share { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.hidden { display: none !important; }

@media (max-width: 560px) {
  nav a { margin-left: 12px; font-size: 14px; }
  .hero { padding: 48px 0 32px; }
  .question { font-size: 18px; }
}
@media print {
  header, footer, .share, .no-print, .demo-banner { display: none !important; }
  body { background: #fff; }
  .cert { box-shadow: none; margin: 0; }
}
