:root {
  --bg: #f6f4ee;
  --surface: #ffffff;
  --ink: #15211d;
  --muted: #5b6a64;
  --line: #dcd8cc;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: #dff1ee;
  --good: #15803d;
  --good-soft: #e3f3e7;
  --bad: #b42318;
  --bad-soft: #fbe9e7;
  --warn-soft: #fdf1d3;
  --warn-ink: #6b4a00;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1513;
    --surface: #16201d;
    --ink: #e7efea;
    --muted: #9aaba4;
    --line: #2a3833;
    --accent: #2dd4bf;
    --accent-ink: #06211d;
    --accent-soft: #12332e;
    --good: #4ade80;
    --good-soft: #13301f;
    --bad: #f97066;
    --bad-soft: #3a1a17;
    --warn-soft: #3a2e0e;
    --warn-ink: #f5d98a;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

.wrap {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--accent); }

h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 7vw, 2.9rem); font-weight: 800; }
h2 { font-size: 1.45rem; font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0; }

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}
.brand {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  display: inline-grid;
  place-items: center;
  font-size: 0.85rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-small { min-height: 40px; padding: 0 14px; font-size: 0.92rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Landing sections */
.hero { padding: 36px 0 44px; }
.eyebrow {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.hero p.lead { color: var(--muted); font-size: 1.12rem; margin-top: 16px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.cta-row .btn { flex: 1 1 200px; }
.fine { color: var(--muted); font-size: 0.88rem; margin-top: 12px; }

section { padding: 34px 0; border-top: 1px solid var(--line); }
section > h2 { margin-bottom: 18px; }

.features { display: grid; gap: 14px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.card p { color: var(--muted); margin-top: 6px; }

.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checks li { padding-left: 28px; position: relative; }
.checks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 800;
}

/* Form */
form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 650; font-size: 0.95rem; }
input[type="email"], input[type="text"], select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.notice {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.95rem;
}
.notice.ok { background: var(--good-soft); color: var(--good); }
.notice.err { background: var(--bad-soft); color: var(--bad); }
.notice.warn { background: var(--warn-soft); color: var(--warn-ink); }

footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 40px;
  color: var(--muted);
  font-size: 0.88rem;
}

/* Quiz */
.quiz { padding: 8px 0 48px; }
.progress {
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 22px;
}
.progress > span { display: block; height: 100%; background: var(--accent); transition: width 0.2s; }
.meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.chip {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 999px;
}
.stem { font-size: 1.15rem; font-weight: 600; margin: 4px 0 18px; }
.choices { display: grid; gap: 10px; border: 0; padding: 0; margin: 0; }
.choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
}
.choice input { margin: 4px 0 0; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.nav { display: flex; gap: 12px; margin-top: 22px; }
.nav .btn { flex: 1; }

/* Results */
.score {
  text-align: center;
  padding: 26px 18px;
}
.score .big { font-size: 3.2rem; font-weight: 800; line-height: 1; }
.score p { color: var(--muted); margin-top: 10px; }
.bar-row { margin-top: 14px; }
.bar-row .label { display: flex; justify-content: space-between; font-weight: 650; font-size: 0.95rem; }
.bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.bar > span { display: block; height: 100%; background: var(--accent); }
.stack { display: grid; gap: 14px; margin-top: 18px; }
.topics { margin: 8px 0 0; padding-left: 20px; color: var(--muted); }

details.review {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
details.review summary { cursor: pointer; font-weight: 650; display: flex; gap: 10px; align-items: flex-start; }
details.review summary::-webkit-details-marker { display: none; }
.mark { flex: none; font-weight: 800; }
.mark.right { color: var(--good); }
.mark.wrong { color: var(--bad); }
details.review .body { margin-top: 10px; color: var(--muted); font-size: 0.96rem; display: grid; gap: 6px; }
details.review .body strong { color: var(--ink); }

@media (min-width: 620px) {
  .features { grid-template-columns: repeat(3, 1fr); }
}
