/* The quiz and results pages. The prototype's shell, in the brand's values
   (BUILD-PLAN section 8): /brand.css defines the colours, faces, CTA radius,
   body size, and the logo's minimum width and clear space, all from config.

   Neutral greys for rules and secondary text aren't brand colours; they carry no
   meaning. The self-hosted Montserrat and Poppins files in static/fonts/ load
   through the @font-face rules /brand.css writes from config; the system faces in
   each stack are only a fallback. */

:root {
  --ink: var(--charcoal);
  --muted: #5B646B;          /* 6.0:1 on white */
  --rule: #DDE1E4;
  --wash: #F4F5F6;
  --tint: #F7EBEE;           /* a pale crimson for the chosen option */
  --logo-width: 200px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  background: #FFFFFF;
  color: var(--ink);
  font-family: var(--font-body), system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--body-size);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* The full-colour logo, on white only. Clear space is the capital-letter height
   on every side: the logo's width times --logo-clear-space. */
header.site {
  background: #FFFFFF;
  border-bottom: 1px solid var(--rule);
  padding: calc(var(--logo-width) * var(--logo-clear-space) + 8px) 22px;
}
header.site .logo {
  display: block;
  width: var(--logo-width);
  min-width: var(--logo-min-width);
  height: auto;
  margin: 0 auto;
}

main {
  overflow-wrap: break-word;
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 22px 56px;
  outline: none;
}

h1, h2, h3 {
  font-family: var(--font-headings), system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  outline: none;
}
h1 { font-size: clamp(32px, 7.5vw, 44px); margin-bottom: 18px; }
h2 { font-size: clamp(23px, 5.5vw, 29px); margin-bottom: 24px; }
p { margin: 0 0 14px; }

.lede { font-size: 19px; max-width: 34em; }
.cred { color: var(--muted); font-size: 15px; border-left: 3px solid var(--crimson); padding-left: 12px; margin: 22px 0 28px; }
.fine { color: var(--muted); font-size: 13px; line-height: 1.5; margin-top: 28px; }
.center { text-align: center; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Buttons: the order pages' CTA - its fill, label, and radius from /brand.css. */
.btn {
  display: inline-block;
  background: var(--cta-fill);
  color: var(--cta-label);
  border: 0;
  border-radius: var(--cta-radius);
  padding: 16px 26px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { filter: brightness(0.92); }
.btn.wide { display: block; width: 100%; margin-top: 8px; }
.btn[disabled] { opacity: 0.6; cursor: default; filter: none; }

.btn:focus-visible, .opt:focus-visible, .link:focus-visible,
input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--crimson);
  outline-offset: 2px;
}

.link {
  background: none; border: 0; padding: 6px 0;
  font: inherit; font-size: 15px; color: var(--muted);
  text-decoration: underline; cursor: pointer;
}
.link.strong { color: var(--ink); font-weight: 500; }
.link[disabled] { opacity: 0.6; cursor: default; }

/* A question */
.progress { display: flex; justify-content: space-between; align-items: center; min-height: 34px; font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.bar { height: 4px; background: var(--rule); border-radius: 2px; margin-bottom: 30px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--crimson); transition: width 0.25s; }

.opts { margin: 0; }
.opt {
  display: block; width: 100%; text-align: left;
  background: #FFFFFF;
  border: 1px solid var(--rule); border-left: 4px solid var(--rule); border-radius: var(--cta-radius);
  padding: 15px 18px; margin: 0 0 10px;
  font: inherit; color: inherit; cursor: pointer;
}
.opt:hover { border-left-color: var(--charcoal); }
.opt[aria-pressed="true"] { border-left-color: var(--crimson); background: var(--tint); }

.interstitial { margin: 8px 0 30px; padding: 4px 0 4px 20px; border-left: 4px solid var(--crimson); }
.interstitial .quote { font-size: clamp(21px, 5vw, 26px); font-weight: 600; line-height: 1.35; margin: 0; }

/* Contact and confirmation */
.field { margin-bottom: 18px; }
label { display: block; font-weight: 500; margin: 0 0 6px; }
label .optional { color: var(--muted); font-weight: 400; font-size: 15px; }
input, textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: 13px 14px; border: 1px solid #B9C0C5; border-radius: var(--cta-radius); background: #FFFFFF;
}
textarea { resize: vertical; min-height: 88px; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.err { color: var(--crimson); font-size: 15px; min-height: 24px; margin-bottom: 6px; }
.status { font-size: 15px; color: var(--muted); text-align: center; min-height: 24px; margin-top: 14px; }
.status.err { color: var(--crimson); }
.suggest { background: var(--wash); border-radius: var(--cta-radius); padding: 14px 16px; margin: 0 0 20px; }
.suggest p { margin: 0 0 4px; }
/* An email address has no break of its own, so text that carries one may break anywhere. */
h2, .suggest p { overflow-wrap: anywhere; }

/* Results */
.verdict {
  background: var(--charcoal); color: #FFFFFF;
  margin: -32px -22px 30px; padding: 34px 22px 30px;
  display: flex; gap: 24px; align-items: center;
}
.verdict h2 { color: #FFFFFF; font-size: 25px; margin: 0 0 8px; overflow-wrap: normal; }
.verdict .band { font-weight: 500; font-size: 19px; margin: 0; }
.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring .track { stroke: rgba(255, 255, 255, 0.16); }
.ring .arc { stroke: #FFFFFF; stroke-linecap: round; transition: stroke-dashoffset 1.1s ease-out; }
.ring .num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .num b { font-family: var(--font-headings), system-ui, sans-serif; font-size: 44px; font-weight: 800; line-height: 1; }
.ring .num small { font-size: 12px; color: #D3D8DB; margin-top: 4px; }

.cats { margin: 0 0 30px; padding: 0; list-style: none; }
.cats li { padding: 16px 0; border-top: 1px solid var(--rule); }
.cats li:last-child { border-bottom: 1px solid var(--rule); }
.cat-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-weight: 500; margin-bottom: 8px; }
.cat-head .pts { color: var(--muted); font-weight: 400; white-space: nowrap; }
.gap-tag { font-style: normal; font-size: 13px; color: var(--crimson); font-weight: 500; margin-left: 8px; white-space: nowrap; }
.meter { height: 6px; background: var(--rule); border-radius: 3px; overflow: hidden; margin-bottom: 10px; }
.meter i { display: block; height: 100%; background: var(--crimson); }
.cats p { font-size: 15.5px; margin: 0; }

.projection { background: var(--wash); border-radius: var(--cta-radius); padding: 18px 20px; margin: 0 0 30px; }
.projection p { margin: 0 0 8px; font-weight: 500; }
.projection .caveat { margin: 0; font-size: 14px; font-weight: 400; color: var(--muted); }

.rec { background: #FFFFFF; border: 1px solid var(--rule); border-top: 4px solid var(--crimson); border-radius: var(--cta-radius); padding: 26px 22px; margin-bottom: 24px; }
.rec h3 { font-size: clamp(22px, 5.2vw, 26px); color: var(--crimson); line-height: 1.3; margin-bottom: 12px; }
.rec .terms { font-size: 14px; color: var(--muted); margin: 14px 0 0; }
.rec .owner { font-size: 15px; margin: 14px 0 0; }

.rec .worry { margin-bottom: 20px; }
.safety { border: 1px solid var(--crimson); background: #FFFFFF; padding: 16px 18px; margin: 0 0 30px; border-radius: var(--cta-radius); }
.fine a { color: inherit; }

@media (max-width: 480px) {
  :root { --logo-width: 160px; }
  .verdict { flex-direction: column; align-items: flex-start; gap: 18px; }
  .ring { width: 116px; height: 116px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* "Open your report" and "Wrong email?" (S27, S9) */
.report-block { margin: 0 0 24px; }
.report-block .open-report { margin: 8px 0 12px; }
.wrong-email .status { text-align: left; }
.wrong-email form { margin-top: 8px; }

/* The hidden attribute wins over any display rule, .btn's included. */
[hidden] { display: none !important; }
