/* Front Desk
   Restrained on purpose. Therapists are pitched relentlessly by marketing
   agencies; anything that reads as a funnel undermines the one thing this has
   going for it, which is that the findings are specific and true. */

:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --border: #e4e0d9;
  --border-strong: #cfc9bf;
  --ink: #23201c;
  --ink-soft: #5f5950;
  --ink-faint: #8a8378;
  --accent: #2f5d50;
  --accent-ink: #ffffff;
  --accent-soft: #eaf1ee;
  --fail: #9b2c2c;
  --fail-soft: #fbeaea;
  --warn: #8a5a12;
  --warn-soft: #fdf3e2;
  --pass: #2f6b4f;
  --pass-soft: #eaf3ed;
  --radius: 10px;
  --maxw: 43rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16150f;
    --surface: #1e1d17;
    --border: #322f26;
    --border-strong: #464236;
    --ink: #eceae4;
    --ink-soft: #b3ada1;
    --ink-faint: #877f72;
    --accent: #7fb8a4;
    --accent-ink: #10241d;
    --accent-soft: #22322c;
    --fail: #e79a9a;
    --fail-soft: #33211f;
    --warn: #ddb36a;
    --warn-soft: #322817;
    --pass: #8dc4a4;
    --pass-soft: #1d2c23;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.masthead {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.wordmark {
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

h1 {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  line-height: 1.2;
  margin: 0 0 0.75rem;
  letter-spacing: -0.015em;
}
h2 { font-size: 1.2rem; margin: 0 0 0.5rem; letter-spacing: -0.01em; }
h3 { font-size: 1rem; margin: 0 0 0.5rem; }

.lede { color: var(--ink-soft); margin: 0 0 2rem; max-width: 38rem; }

/* ------------------------------- form ------------------------------- */

.field { margin-bottom: 1.5rem; }

label {
  display: block;
  font-weight: 550;
  font-size: 0.925rem;
  margin-bottom: 0.4rem;
}

input[type="text"], input[type="email"] {
  width: 100%;
  padding: 0.7rem 0.8rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}
input[type="text"]:focus, input[type="email"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.input--code {
  font-size: 1.5rem;
  letter-spacing: 0.4em;
  text-align: center;
  max-width: 11rem;
}

.hint { color: var(--ink-faint); font-size: 0.85rem; margin: 0.4rem 0 0; }
.hint--standalone { margin-top: 1.5rem; }

.error { color: var(--fail); font-size: 0.85rem; margin: 0.4rem 0 0; }
.error--form { margin-top: 1rem; }

.field--check { margin-top: 2rem; }
.checkbox {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.checkbox input { margin-top: 0.25rem; flex: none; width: 1rem; height: 1rem; accent-color: var(--accent); }

.btn {
  font: inherit;
  font-weight: 550;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
}
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ----------------------------- overview ----------------------------- */

/* Status palette, fixed. Validated with the dataviz validator against both
   surfaces: normal-vision ΔE 27.6 and CVD ΔE 11.3 on the worst adjacent pair,
   both comfortably clear. Yellow sits under 3:1 on the light surface by design,
   which is why every segment carries a visible label and count — status colour
   never carries meaning on its own here. */
:root {
  --stat-good: #0ca30c;
  --stat-warning: #fab219;
  --stat-critical: #d03b3b;
  --stat-none: var(--border-strong);
  --chart-surface: var(--surface);
}

.overview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
  display: grid;
  gap: 1.75rem;
}

.overview__lead { display: flex; align-items: baseline; gap: 0.6rem; }
.hero {
  font-size: 3rem;
  line-height: 1;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.03em;
}
.hero__label { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

.chart__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.6rem;
}
.chart__title { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-faint); }
.chart__note { font-size: 0.8rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

/* Stacked bar. The 2px separation is a gap in the surface colour, not a stroke
   around each segment — a border would add ink that isn't data. */
.stack {
  display: flex;
  gap: 2px;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--border);
}
.stack__seg { min-width: 3px; transition: width 0.4s ease; position: relative; }
.stack__seg:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.stack__seg--good { background: var(--stat-good); }
.stack__seg--warning { background: var(--stat-warning); }
.stack__seg--critical { background: var(--stat-critical); }
.stack__seg--none { background: var(--stat-none); }

.legend {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.legend li { display: flex; align-items: center; gap: 0.4rem; }
.legend .swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend .count { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Small multiples: the same stacked form, once per area. */
.areas { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.area { display: grid; grid-template-columns: 10.5rem 1fr auto; align-items: center; gap: 0.75rem; }
.area__name { font-size: 0.875rem; color: var(--ink-soft); }
.area__count { font-size: 0.8rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.area .stack { height: 10px; }
@media (max-width: 34rem) {
  .area { grid-template-columns: 1fr auto; }
  .area .stack { grid-column: 1 / -1; }
}

/* Meter: fill carries severity, track is a recessive step behind it. */
.meter__track {
  height: 14px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.meter__fill { height: 100%; border-radius: 999px; transition: width 0.5s ease; }
.meter__fill--good { background: var(--stat-good); }
.meter__fill--warning { background: var(--stat-warning); }
.meter__fill--critical { background: var(--stat-critical); }
.meter__scale {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.7rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

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

@media (prefers-reduced-motion: reduce) {
  .stack__seg, .meter__fill { transition: none; }
}

/* ----------------------------- progress ----------------------------- */

.progress { margin-bottom: 1.75rem; }
.progress__bar {
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress__fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.progress__label { font-size: 0.85rem; color: var(--ink-faint); margin: 0.5rem 0 0; }
.progress[hidden] { display: none; }

/* ----------------------------- results ------------------------------ */

.results-head { margin-bottom: 1.5rem; }

.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }

.result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  /* Checks land one at a time; a brief fade keeps that legible rather than
     making the page appear to twitch. */
  animation: settle 0.35s ease both;
}
@keyframes settle {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .result { animation: none; }
  .progress__fill { transition: none; }
}

.result--fail { border-left-color: var(--fail); }
.result--warn { border-left-color: var(--warn); }
.result--pass { border-left-color: var(--pass); }
.result--skipped { border-left-color: var(--border-strong); opacity: 0.75; }
.result--error { border-left-color: var(--warn); border-style: dashed; }

.result__head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.result__label { font-weight: 600; font-size: 0.95rem; }

.chip {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}
.chip--critical, .chip--high { background: var(--fail-soft); color: var(--fail); }
.chip--medium { background: var(--warn-soft); color: var(--warn); }
.chip--low { background: var(--border); color: var(--ink-soft); }
.chip--ok { background: var(--pass-soft); color: var(--pass); }
.chip--skipped { background: var(--border); color: var(--ink-faint); }
.chip--error { background: var(--warn-soft); color: var(--warn); }

.result__finding { margin: 0; color: var(--ink-soft); font-size: 0.925rem; }

/* --------------------------- incomplete ----------------------------- */

/* Reported, not hidden — but folded away so it can't crowd out the findings. */
.incomplete {
  margin-top: 1rem;
  padding: 0.85rem 1.1rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--ink-faint);
  font-size: 0.875rem;
}
.incomplete summary { cursor: pointer; font-weight: 550; }
.incomplete summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.incomplete ul { margin: 0.75rem 0 0; padding-left: 1.1rem; display: grid; gap: 0.4rem; }
.incomplete strong { color: var(--ink-soft); font-weight: 600; }

/* ----------------------------- summary ------------------------------ */

.summary { margin-top: 2.5rem; }
.summary > p { color: var(--ink-soft); }

.cta {
  margin-top: 1.75rem;
  padding: 1.5rem;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cta p { color: var(--ink-soft); font-size: 0.925rem; }
.cta .btn { margin-top: 0.5rem; }

.foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  border-top: 1px solid var(--border);
  color: var(--ink-faint);
  font-size: 0.85rem;
}
.foot p { margin: 0; }

[hidden] { display: none !important; }
