:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #5b6475;
  --line: #e2e7f0;
  --brand: #0a6fd1;      /* deeper shade of the logo blue, readable under white text */
  --brand-ink: #ffffff;
  --brand-soft: #e6f3ff;
  --logo-blue: #62b8ff;  /* the logo's own blue */
  --navy: #0d2a4a;
  --ok: #15803d;
  --danger: #b91c1c;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(15 23 42 / 6%), 0 8px 24px rgb(15 23 42 / 6%);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #131b2e;
    --ink: #e7ecf5;
    --muted: #9aa5b8;
    --line: #253049;
    --brand: #3d9cf5;
    --brand-soft: #13263f;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[hidden] { display: none !important; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.015em; }
h1 { font-size: clamp(1.8rem, 4.2vw, 2.7rem); font-weight: 800; }
h2 { font-size: clamp(1.25rem, 2.6vw, 1.55rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px max(16px, env(safe-area-inset-left)) 14px max(16px, env(safe-area-inset-right));
  background: #fff; color: #0f172a; border-bottom: 1px solid #e2e7f0;
}
.brand { display: flex; align-items: center; }
.brand img { display: block; height: 52px; width: auto; }
.topbar-tag { font-size: clamp(1.05rem, 2.6vw, 1.6rem); font-weight: 800; color: #0d2a4a; letter-spacing: -0.01em; text-align: right; line-height: 1.15; }

.shell { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 28px 16px 40px; }
.screen { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } }
.center { text-align: center; padding-top: 12vh; }

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

/* Intro */
#screen-intro { display: grid; gap: 28px; }
@media (min-width: 860px) { #screen-intro { grid-template-columns: 1.15fr 1fr; align-items: start; gap: 44px; padding-top: 24px; } }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; color: var(--brand); margin: 0 0 10px; }
.lede { font-size: 1.08rem; color: var(--muted); max-width: 52ch; }
.ticks { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; }
.ticks li { padding-left: 28px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .3em; width: 18px; height: 18px; border-radius: 50%; background: var(--brand-soft); }
.ticks li::after { content: ""; position: absolute; left: 6px; top: calc(.3em + 4px); width: 5px; height: 9px; border: solid var(--brand); border-width: 0 2px 2px 0; transform: rotate(45deg); }

.form h2 { font-size: 1.15rem; }
.field { display: grid; gap: 6px; margin-bottom: 14px; font-weight: 600; font-size: .92rem; }
.field em { font-weight: 400; color: var(--muted); font-style: normal; }
.field input {
  font: inherit; font-weight: 400; font-size: 1rem; /* 16px stops iOS zooming */
  padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); width: 100%;
}
.field input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { color: var(--danger); min-height: 1.2em; margin: 0 0 8px; font-size: .92rem; }
.fineprint { font-size: .82rem; color: var(--muted); margin: 12px 0 0; }

/* Buttons */
.btn {
  font: inherit; font-weight: 600; border-radius: 10px; padding: 12px 20px; cursor: pointer;
  border: 1px solid transparent; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; transition: transform .05s, background .15s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.primary:not(:disabled):hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.link { background: none; border: 0; color: var(--brand); padding: 12px 0; min-height: 0; margin-top: 8px; }
.form .btn.primary { width: 100%; }
.btn.big { margin-top: 26px; padding: 15px 30px; font-size: 1.05rem; }

/* Intro illustration: a sample report card in the logo's blue */
.intro-art { display: none; }
@media (min-width: 860px) {
  .intro-art { display: grid; place-items: center; min-height: 340px; border-radius: 24px;
    background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--logo-blue) 35%, transparent), transparent 60%), var(--brand-soft); }
}
.art-card { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 26px; display: flex; gap: 20px; align-items: center; width: 300px; transform: rotate(-3deg); }
.art-grade { width: 76px; height: 76px; border-radius: 18px; background: #65a30d; color: #fff; font-size: 2.2rem; font-weight: 800; display: grid; place-items: center; flex: none; }
.art-lines { display: grid; gap: 10px; flex: 1; }
.art-lines span { height: 10px; border-radius: 99px; background: var(--line); }
.art-lines span:first-child { background: var(--logo-blue); width: 85%; }
.art-lines .short { width: 55%; }

/* Recommendations form under the grade */
.unlock { margin-top: 18px; border-top: 4px solid var(--logo-blue); }
.unlock h3 { font-size: 1.2rem; }
.unlock > .muted { margin: 0 0 16px; }
.form-grid { display: grid; gap: 0 14px; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .wide { grid-column: 1 / -1; } }

/* Question */
#screen-question { max-width: 720px; margin: 0 auto; }
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: 18px; }
.progress-bar { height: 100%; width: 0; background: var(--brand); transition: width .3s ease; }
.q-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: .9rem; margin-bottom: 10px; }
.chip { background: var(--brand-soft); color: var(--brand); padding: 4px 10px; border-radius: 99px; font-weight: 600; font-size: .8rem; white-space: nowrap; }
.q-text { margin-bottom: 18px; outline: none; }
.choices { display: grid; gap: 10px; }
.choice {
  display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center; text-align: left;
  font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 14px 16px; cursor: pointer; min-height: 60px; transition: border-color .15s, background .15s;
}
/* Hover only with a real mouse: on phones a tap leaves a "sticky" hover on whatever
   lands under the finger next, which looked like the next question was pre-selected. */
@media (hover: hover) and (pointer: fine) {
  .choice:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); }
}
.choice { -webkit-tap-highlight-color: transparent; }
.choice:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.choice .key {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: var(--bg); border: 1px solid var(--line); font-weight: 700; color: var(--muted);
}
.choice[aria-checked="true"] { border-color: var(--brand); background: var(--brand-soft); }
.choice[aria-checked="true"] .key { background: var(--brand); color: #fff; border-color: var(--brand); }
.q-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }
.q-nav .btn { flex: 0 1 160px; }
.hint { color: var(--muted); font-size: .8rem; text-align: center; margin-top: 16px; }
@media (hover: none) { .hint { display: none; } }

/* Sending */
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--brand); margin: 0 auto 20px; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.muted { color: var(--muted); }

/* Results */
#screen-results { max-width: 760px; margin: 0 auto; }
.result-head { display: flex; gap: 20px; align-items: center; }
.result-head h2 { margin-bottom: 2px; }
.result-head > div:last-child { flex: 1; min-width: 0; }
.grade {
  flex: 0 0 auto; width: 92px; height: 92px; border-radius: 22px; display: grid; place-items: center;
  font-size: 2.6rem; font-weight: 800; color: #fff; background: var(--grade, var(--brand));
}
.meter { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.meter-fill { height: 100%; width: 0; background: var(--grade, var(--brand)); transition: width .8s ease; }
.email-note { color: var(--muted); font-size: .92rem; margin: 14px 2px 0; }
.section-title { margin: 30px 0 12px; }
.recs { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; counter-reset: rec; }
.recs li { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 12px; padding: 16px 18px; }
.recs .rec-title { font-weight: 700; margin-bottom: 4px; }
.recs .rec-answer { color: var(--muted); font-size: .92rem; margin-bottom: 8px; }
.recs .rec-action { font-weight: 500; }
.recs .rec-action b { color: var(--brand); }
.recs .perfect { border-left-color: var(--ok); color: var(--ok); font-weight: 600; }
.cta { margin-top: 28px; background: var(--navy); color: #fff; border-color: var(--navy); }
.cta p { color: #c7d2e8; }
.cta a:not(.btn) { color: #fff; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.cta .btn.ghost { color: #fff; border-color: rgb(255 255 255 / 30%); }

@media (max-width: 520px) {
  .shell { padding-top: 20px; }
  .card { padding: 18px; }
  .result-head { flex-direction: column; text-align: center; }
  .grade { width: 84px; height: 84px; font-size: 2.3rem; }
  .cta-actions .btn { flex: 1 1 100%; }
  .brand img { height: 42px; }
}

.foot { text-align: center; color: var(--muted); font-size: .82rem; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.foot a { color: inherit; }
