/* Clear Duty. Typography-led, one accent colour, mobile first. Contrast checked to WCAG 2.2 AA. */

:root {
  color-scheme: light;
  --ink: #1b1f23;        /* 16:1 on white */
  --muted: #4a5560;      /* 7.5:1 on white */
  --accent: #0d5c63;     /* 7.3:1 on white; the one accent */
  --accent-soft: #e7f1f2;
  --line: #7b8590;       /* 3.8:1, for control borders */
  --rule: #dde1e5;
  --track: #e3e6ea;
  --surface: #f6f7f8;
  --bg: #ffffff;
  --error: #a4262c;      /* 7:1 on white */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.wrap { max-width: 40rem; margin: 0 auto; padding: 0 1rem; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.75rem; letter-spacing: -0.01em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.25rem; margin-top: 2.5rem; }
h3 { font-size: 1.0625rem; }
h1:focus, h2:focus, legend:focus { outline: none; }
p { margin: 0 0 1rem; }

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--bg); padding: 0.5rem 1rem; }
.skip:focus { left: 1rem; }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap { padding-top: 1rem; padding-bottom: 1rem; }
.brand { font-weight: 700; font-size: 1.125rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }

main.wrap { padding-top: 2rem; padding-bottom: 4rem; }

.site-footer { border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.9375rem; }
.site-footer .wrap { padding-top: 1.5rem; padding-bottom: 2rem; }
.site-footer nav a { margin-right: 1.25rem; }

/* Start page */
.eyebrow { color: var(--muted); font-size: 0.9375rem; font-weight: 600; margin-bottom: 0.5rem; }
.lead { font-size: 1.1875rem; }
.facts, .ticks { padding: 0; margin: 0 0 1.5rem; list-style: none; }
.facts li { padding: 0.75rem 0; border-top: 1px solid var(--rule); }
.facts li:last-child { border-bottom: 1px solid var(--rule); }
.ticks li { position: relative; padding-left: 1.75rem; margin-bottom: 0.5rem; }
.ticks li::before { content: ""; position: absolute; left: 0.25rem; top: 0.45em; width: 0.5rem; height: 0.85rem; border: solid var(--accent); border-width: 0 3px 3px 0; transform: rotate(45deg); }

.claim { border-left: 4px solid var(--accent); background: var(--surface); padding: 1rem 1rem 0.25rem; margin: 2rem 0; }
.source { color: var(--muted); font-size: 0.875rem; }

/* Buttons */
.button {
  display: inline-block; min-height: 3rem; padding: 0.75rem 1.5rem;
  font: inherit; font-weight: 600; color: #fff; background: var(--accent);
  border: 2px solid var(--accent); border-radius: 0.375rem; cursor: pointer; text-decoration: none;
}
.button:hover { background: #0a4a50; border-color: #0a4a50; }
.button:disabled { opacity: 0.6; cursor: progress; }
.button.secondary { color: var(--accent); background: var(--bg); }
.button.secondary:hover { background: var(--accent-soft); }

.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.actions .button:last-child:not(:first-child) { margin-left: auto; }

.status { color: var(--muted); font-size: 0.9375rem; margin-top: 1rem; }

/* Progress */
.progress { margin-bottom: 1.75rem; }
.progress-text { color: var(--muted); font-size: 0.875rem; margin-bottom: 0.375rem; }
.progress-track { height: 0.375rem; background: var(--track); border-radius: 1rem; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); transition: width 0.2s ease; }

/* Questions */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.question { font-size: 1.375rem; line-height: 1.3; margin-bottom: 1.25rem; }
.done { font-weight: 600; color: var(--accent); }
.section-label { color: var(--muted); font-size: 0.875rem; font-weight: 600; margin-bottom: 0.5rem; }

.option {
  display: flex; align-items: flex-start; gap: 0.75rem;
  min-height: 3rem; padding: 0.875rem 1rem; margin-bottom: 0.625rem;
  border: 1px solid var(--line); border-radius: 0.375rem; cursor: pointer;
}
.option:hover { background: var(--surface); }
.option:has(input:checked) { border: 2px solid var(--accent); background: var(--accent-soft); padding: calc(0.875rem - 1px) calc(1rem - 1px); }
.option input { flex: none; width: 1.25rem; height: 1.25rem; margin: 0.15rem 0 0; accent-color: var(--accent); }

label.field { display: block; font-weight: 600; margin-bottom: 0.375rem; }
select, input[type="email"] {
  display: block; width: 100%; min-height: 3rem; padding: 0.625rem 0.75rem;
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 0.375rem;
}
.check { display: flex; gap: 0.625rem; align-items: flex-start; margin: 1rem 0; cursor: pointer; }
.check input { width: 1.25rem; height: 1.25rem; margin: 0.2rem 0 0; flex: none; accent-color: var(--accent); }

.error { color: var(--error); font-weight: 600; margin: 0.5rem 0 0; }
.error:empty { display: none; }
[aria-invalid="true"] { border-color: var(--error); }

/* Result */
.band { font-size: 2.25rem; margin-bottom: 0.5rem; }
.total { color: var(--muted); }
.areas { list-style: none; padding: 0; margin: 0; }
.areas li { margin-bottom: 1.125rem; }
.area-head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.375rem; }
.area-score { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar { height: 0.75rem; background: var(--track); border-radius: 1rem; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }

.gaps { padding-left: 1.25rem; }
.gaps li { margin-bottom: 0.5rem; }

.panel { background: var(--surface); border-radius: 0.5rem; padding: 1.25rem 1rem; margin-top: 2.5rem; }
.panel h2 { margin-top: 0; }
.small { font-size: 0.9375rem; color: var(--muted); }

@media (min-width: 40rem) {
  h1 { font-size: 2.5rem; }
  main.wrap { padding-top: 3rem; }
  .panel { padding: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .progress-fill { transition: none; }
}

/* Header nav */
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-header nav a { margin-left: 1.25rem; color: var(--ink); font-size: 0.9375rem; }
.site-header nav a:first-child { margin-left: 0; }

/* Content pages */
.actions.start .button:last-child { margin-left: 0; }
.view { border-left: 4px solid var(--rule); padding-left: 1rem; color: var(--muted); }
.docs { padding-left: 1.5rem; }
.docs li { margin-bottom: 0.875rem; }
.format { display: inline-block; font-size: 0.8125rem; color: var(--muted); border: 1px solid var(--line); border-radius: 0.25rem; padding: 0 0.375rem; margin-left: 0.25rem; }
.price { font-size: 2rem; font-weight: 700; margin-bottom: 0.75rem; }
.legal h2 { margin-top: 2rem; }
.legal ul { padding-left: 1.25rem; }
.legal li { margin-bottom: 0.375rem; }
.draft-banner { background: #fff4d6; border: 2px solid #8a5a00; color: #4d3200; padding: 0.75rem 1rem; border-radius: 0.375rem; }

/* Articles */
.article-meta { color: var(--muted); font-size: 0.875rem; margin-bottom: 1.25rem; }
.answer { font-size: 1.125rem; }
.article ol, .article ul { padding-left: 1.25rem; }
.article li { margin-bottom: 0.5rem; }
.cta { border-top: 1px solid var(--rule); margin-top: 2.5rem; padding-top: 0.5rem; }
.table-scroll { overflow-x: auto; margin: 1rem 0 1.5rem; border: 1px solid var(--rule); border-radius: 0.375rem; }
.table-scroll table { border-collapse: collapse; width: 100%; min-width: 44rem; font-size: 0.9375rem; }
.table-scroll caption { text-align: left; padding: 0.75rem; font-weight: 600; }
.table-scroll th, .table-scroll td { border-top: 1px solid var(--rule); padding: 0.5rem 0.75rem; text-align: left; vertical-align: top; }
.table-scroll th { background: var(--surface); }
.table-scroll.narrow table { min-width: 0; }
.example-row td { background: var(--accent-soft); }
.tag { display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #fff; background: var(--accent); border-radius: 0.25rem; padding: 0.05rem 0.4rem; margin-bottom: 0.25rem; }
