/* Layout: navy header with the logo's wave, then one question at a time in a single centred column (max 560px).
   Brand per the Aquavation style guide: Josefin Sans headings, Open Sans body, teal / navy / mint.
   Deliberately light-only, like the rest of Aquavation's site. */
:root {
  color-scheme: light;
  --navy: #201249;
  --teal: #20afc6;
  --teal-ink: #0b7487;   /* teal dark enough for text on white */
  --mint: #96cfae;
  --mint-wash: #eaf6f0;
  --green: #29624f;
  --bg: #f2f8fa;
  --surface: #ffffff;
  --ink: #1d1842;
  --muted: #555c73;
  --line: #d5e4ea;
  --error: #b3261e;
  --display: "Josefin Sans", "Century Gothic", "Futura", system-ui, sans-serif;
  --body: "Open Sans", "Segoe UI", Helvetica, Arial, sans-serif;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--body);
  min-height: 100dvh; display: flex; flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: var(--teal-ink); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Header */
.site-head { background: var(--navy); position: relative; }
.site-head-inner {
  max-width: 560px; margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) 22px max(20px, env(safe-area-inset-left, 0px));
}
/* The wave is drawn in the page colour over the navy header, so no seam shows at either edge. */
.wave { display: block; width: 100%; height: 26px; margin-bottom: -1px; fill: var(--bg); }

/* Column */
main { flex: 1; width: 100%; max-width: 560px; margin: 0 auto;
  padding: 8px max(20px, env(safe-area-inset-right, 0px)) 40px max(20px, env(safe-area-inset-left, 0px)); }
.step { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
legend { padding: 0; margin-bottom: 4px; }

h1, h2 { font-family: var(--display); color: var(--navy); line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 8vw, 2.8rem); font-weight: 700; }
h2 { font-size: clamp(1.45rem, 5.5vw, 1.75rem); font-weight: 700; outline: none; }
.eyebrow { margin: 8px 0 -6px; font-family: var(--display); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; font-size: .82rem; color: var(--teal-ink); }
.lede { margin: 0; font-size: 1.12rem; color: var(--muted); }
.hint { margin: -6px 0 0; color: var(--muted); }
.fine { margin: 0; font-size: .82rem; color: var(--muted); line-height: 1.5; }

.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ticks li { position: relative; padding-left: 32px; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--mint-wash) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%2329624f' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat;
}

/* Progress */
.progress { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px 12px; margin: 4px 0 20px; }
.back { font: inherit; font-weight: 600; color: var(--teal-ink); background: none; border: 0; padding: 8px 4px; margin-left: -4px; cursor: pointer; }
.progress-label { justify-self: end; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress-bar { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--teal); border-radius: 6px; transition: width .3s ease; }

/* Buttons */
.btn {
  font: 700 1.05rem/1 var(--body); color: var(--navy); background: var(--teal);
  border: 0; border-radius: 999px; min-height: 54px; padding: 0 28px; cursor: pointer;
  box-shadow: 0 2px 0 rgba(32, 18, 73, .18); transition: transform .1s ease, background .15s ease;
}
.btn:hover { background: #33bdd3; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-secondary { background: var(--surface); border: 2px solid var(--teal); box-shadow: none; }

/* Choice cards (real radios, visually replaced) */
.options { display: flex; flex-direction: column; gap: 10px; }
.options-row { flex-direction: row; flex-wrap: wrap; }
.options-row .option { flex: 1 1 120px; }
.option { position: relative; display: block; cursor: pointer; }
.option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.option span {
  display: flex; flex-direction: column; gap: 2px; min-height: 60px; justify-content: center;
  padding: 14px 18px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  transition: border-color .15s ease, background .15s ease;
}
.options-row .option span { align-items: center; text-align: center; }
.option strong { font-weight: 700; color: var(--navy); font-size: 1.05rem; }
.option small { color: var(--muted); font-size: .9rem; }
.option:hover span { border-color: var(--teal); }
.option input:checked + span { border-color: var(--teal); background: var(--mint-wash); }
.option input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 2px; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row .field { flex: 0 1 120px; }
.field-row .grow { flex: 1 1 180px; }
label { font-weight: 600; color: var(--navy); }
input:not([type="radio"]):not([type="checkbox"]) {
  font: inherit; font-size: 1.05rem; color: var(--ink); background: var(--surface);
  border: 2px solid var(--line); border-radius: 10px; min-height: 52px; padding: 10px 14px; width: 100%;
}
input:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(32, 175, 198, .25); }
input[aria-invalid="true"] { border-color: var(--error); }
.field-note { color: var(--muted); font-size: .85rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.area-note { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--mint-wash); color: var(--green); font-weight: 600; }
.error { margin: 0; padding: 10px 14px; border-radius: 10px; background: #fdecea; color: var(--error); font-weight: 600; }

/* Consents */
.consents { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.check { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; font-weight: 400; color: var(--ink); font-size: .9rem; line-height: 1.5; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--teal-ink); cursor: pointer; }
.check strong { color: var(--navy); }
.check em { color: var(--muted); font-style: normal; }

/* Result */
.result { display: flex; flex-direction: column; gap: 18px; }
.result-head { display: flex; flex-direction: column; gap: 6px; }
.badge { align-self: flex-start; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--green); background: var(--mint-wash); padding: 4px 10px; border-radius: 999px; }
.supplier { font-family: var(--display); font-size: 1.15rem; color: var(--teal-ink); font-weight: 600; }
.facts { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.fact dt { font-weight: 700; color: var(--navy); }
.fact dd { margin: 0; }
.fact .value { font-weight: 700; color: var(--teal-ink); text-align: right; font-variant-numeric: tabular-nums; }
.fact .note { grid-column: 1 / -1; color: var(--muted); font-size: .92rem; }
.profile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.profile h3, .cta h3 { font-family: var(--display); color: var(--navy); margin: 0; font-size: 1.15rem; }
.profile p { margin: 0; }
.concern { margin: 0; padding: 14px 16px; border-radius: var(--radius); background: var(--mint-wash); }
.cta { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.cta h3 { color: #fff; }
.cta p { margin: 0; color: #dcd9ee; }
.sent { margin: 0; padding: 14px 16px; border-radius: var(--radius); border: 2px solid var(--mint); background: var(--surface); }
.source-line { font-size: .82rem; color: var(--muted); margin: 0; }
.source-line a { word-break: break-word; }

/* Snapshot: gauges, comparison, summary, reveal */
.fact .scale-wrap { grid-column: 1 / -1; margin: 6px 0 2px; }
.scale-track { position: relative; height: 10px; border-radius: 6px; background: var(--line); margin-top: 14px; }
.scale-seg { position: absolute; top: 0; bottom: 0; }
.scale-seg:nth-child(1) { background: #d4f0f5; border-radius: 6px 0 0 6px; }
.scale-seg:nth-child(2) { background: #9fdbe6; }
.scale-seg:nth-child(3) { background: #4cc1d4; }
.scale-seg:nth-child(4) { background: #1891a6; border-radius: 0 6px 6px 0; }
.scale-band { position: absolute; top: 0; bottom: 0; background: var(--mint); border-radius: 6px; }
.scale-range { position: absolute; top: 2px; bottom: 2px; background: #9fdbe6; border-radius: 6px; }
.scale-marker { position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--navy); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(32, 18, 73, .35); transition: left 1s cubic-bezier(.2, .8, .2, 1); }
.scale-labels { display: flex; justify-content: space-between; gap: 6px; margin-top: 8px; font-size: .75rem; color: var(--muted); }
.scale-caption { margin: 4px 0 0; font-size: .78rem; color: var(--muted); }
.value .num { font-variant-numeric: tabular-nums; }

.compare { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.compare h3, .summary h3 { font-family: var(--display); color: var(--navy); margin: 0; font-size: 1.15rem; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: inherit; font-size: .9rem; font-weight: 600; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--navy); cursor: pointer; }
.chip[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 8.5em) 1fr auto; align-items: center; gap: 10px; font-size: .88rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.bar-track { height: 12px; border-radius: 6px; background: var(--bg); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 6px; background: #9fdbe6; transition: width .6s ease; }
.bar-value { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.bar-row.you .bar-label, .bar-row.you .bar-value { color: var(--navy); font-weight: 700; }
.bar-row.you .bar-fill { background: var(--teal); }

.summary { background: var(--surface); border: 2px solid var(--teal); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.summary-headline { margin: 0; font-weight: 600; color: var(--navy); }
.summary-list { margin: 0; display: flex; flex-direction: column; }
.summary-list div { display: grid; grid-template-columns: minmax(0, 9em) 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.summary-list dt { color: var(--muted); font-size: .9rem; }
.summary-list dd { margin: 0; font-weight: 600; color: var(--ink); min-width: 0; }
.summary-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.btn-call { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.send-failed { display: flex; flex-direction: column; gap: 10px; }

.building { display: flex; flex-direction: column; gap: 18px; padding: 24px 0; }
.building-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.building-steps li { position: relative; padding-left: 34px; color: var(--muted); transition: color .3s ease; }
.building-steps li::before { content: ""; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--teal); animation: spin .8s linear infinite; }
.building-steps li.done { color: var(--navy); font-weight: 600; }
.building-steps li.done::before { animation: none; border-color: var(--green); background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; }
@keyframes spin { to { transform: rotate(360deg); } }
.reveal { animation: rise .5s ease both; animation-delay: calc(var(--i, 0) * 90ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Footer */
.site-foot { background: var(--surface); border-top: 1px solid var(--line); text-align: center; font-size: .8rem; color: var(--muted);
  padding: 18px max(20px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); }
.site-foot p { margin: 4px auto; max-width: 520px; }

/* Plain text pages (privacy, terms) */
.doc { display: flex; flex-direction: column; gap: 12px; }
.doc h2 { font-size: 1.2rem; margin-top: 12px; }
.doc p, .doc ul, .doc ol { margin: 0; }
.doc li + li { margin-top: 6px; }
.ph { background: #fff0bf; padding: 0 4px; border-radius: 3px; font-weight: 600; }

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