/* waywise.coach/coach-survey — the questionnaire's look. The tokens are the homepage's and the consent
   page's (paper, ink, accent), the fonts the self-hosted ones in ../fonts/. Light only, as the site is. */

:root {
  --paper: #f5eee1;
  --paper-lift: #fbf7ef;
  --veil: #ece2cf;
  --ink: #221c14;
  --ink-soft: #51473a;
  --ink-faint: #6f6352;
  --rule: #dccfb6;
  --rule-soft: #e8dec9;
  --accent: #2c5a72;
  --accent-wash: #e4ebeb;
  --error: #9b2c1f;
  --display: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --measure: 40rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-weight: 400; font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 0.18em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.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;
}
[hidden] { display: none !important; }

/* ── Frame ──────────────────────────────────────────────────────── */
.top { max-width: var(--measure); margin: 0 auto; padding: 22px 16px 0; }
.wordmark {
  font-family: var(--display); font-size: 1.15rem; letter-spacing: 0.08em; color: var(--ink); text-decoration: none;
}
.survey { max-width: var(--measure); margin: 0 auto; padding: 0 16px 72px; }

/* ── Progress ───────────────────────────────────────────────────── */
.progress {
  position: sticky; top: 0; z-index: 5; background: var(--paper);
  padding: 18px 0 14px; margin-bottom: 8px; border-bottom: 1px solid var(--rule-soft);
}
.parts { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; list-style: none; margin: 0; padding: 0; }
.part .bar { display: block; height: 4px; border-radius: 2px; background: var(--rule); transition: background-color 0.3s; }
.part.done .bar, .part.current .bar { background: var(--accent); }
.part.current .bar { box-shadow: 0 0 0 2px var(--accent-wash); }
.part .label {
  display: block; margin-top: 7px; font-size: 12.5px; line-height: 1.2; color: var(--ink-faint); letter-spacing: 0.01em;
}
.part.current .label { color: var(--ink); font-weight: 600; }
.part.done .label { color: var(--ink-soft); }
.left { margin: 10px 0 0; font-size: 13.5px; color: var(--ink-soft); }
/* "Part 3 of 7" is read out everywhere and shown where the labels are not. */
.left .part-of { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 719px) {
  .part .label { display: none; }
  .left .part-of { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .progress { padding-top: 14px; }
}

/* ── Page ───────────────────────────────────────────────────────── */
.page { animation: pageIn 0.35s var(--ease-out); }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.title {
  font-family: var(--display); font-style: italic; font-weight: 400; font-size: clamp(1.9rem, 5.2vw, 2.6rem);
  line-height: 1.12; margin: 28px 0 14px; letter-spacing: -0.005em;
}
.intro { margin: 0 0 8px; color: var(--ink-soft); font-size: 1.04rem; line-height: 1.65; }
.section-heading {
  font-family: var(--display); font-weight: 500; font-size: 1.45rem; line-height: 1.25; margin: 34px 0 6px;
}
.section-heading:focus { outline: none; }
.section-heading:focus-visible { outline: 2px solid var(--accent); }

.lead { margin: 18px 0 6px; }
.lead.quote, .lead.concept {
  padding: 18px 20px; background: var(--paper-lift); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0;
  font-size: 1.04rem; line-height: 1.7;
}
.lead.quote p, .lead.concept p { margin: 0; }
.lead.quote p { font-family: var(--display); font-style: italic; font-size: 1.12rem; }
.packages { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.packages li {
  padding: 14px 18px; background: var(--paper-lift); border: 1px solid var(--rule); border-radius: 10px; line-height: 1.55;
}
.packages strong { font-weight: 600; }

/* ── Questions ──────────────────────────────────────────────────── */
.q { border: 0; margin: 0; padding: 26px 0 0; min-width: 0; }
.q + .q { border-top: 1px solid var(--rule-soft); margin-top: 26px; }
/* Floated, a legend stops sitting inside the fieldset's top border, so the divider runs above it. */
.q-text { display: block; float: left; width: 100%; padding: 0; font-weight: 600; font-size: 1.04rem; line-height: 1.45; margin: 0 0 12px; }
.q > :not(.q-text) { clear: both; }
.q-tag {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--veil);
  font-size: 12.5px; font-weight: 500; color: var(--ink-soft); vertical-align: 2px;
}
.q-hint { margin: -6px 0 10px; font-size: 14.5px; color: var(--ink-soft); }
.q-note { margin: 10px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-faint); }
.q-problem { margin: 10px 0 0; font-size: 14.5px; font-weight: 500; color: var(--error); }
.q.invalid .q-text { color: var(--error); }

.options { display: grid; gap: 8px; }
.opt {
  display: flex; align-items: flex-start; gap: 12px; padding: 11px 14px; min-height: 46px;
  background: var(--paper-lift); border: 1px solid var(--rule); border-radius: 10px; cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.opt:hover { border-color: var(--ink-faint); }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
.opt:has(input:disabled) { cursor: not-allowed; opacity: 0.55; }
.opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt input { flex: none; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--accent); }
.opt input:focus-visible { outline: none; }
.opt span { line-height: 1.45; }

.text-input, .select-input {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper-lift);
  border: 1px solid var(--rule); border-radius: 10px; padding: 11px 14px;
}
.text-input:hover, .select-input:hover { border-color: var(--ink-faint); }
.text-input:focus-visible, .select-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
textarea.text-input { min-height: 96px; resize: vertical; line-height: 1.5; }
.select-input { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }

/* A row of numbers (0–10, 1–10) */
.scale { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; }
.scale .pt { position: relative; display: block; cursor: pointer; }
.scale .pt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.scale .pt span {
  display: grid; place-items: center; height: 44px; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--paper-lift); font-variant-numeric: tabular-nums; font-weight: 500; transition: background-color 0.15s, border-color 0.15s;
}
.scale .pt:hover span { border-color: var(--ink-faint); }
.scale .pt input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--paper-lift); }
.scale .pt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.ends { display: flex; justify-content: space-between; gap: 16px; margin-top: 7px; font-size: 13.5px; color: var(--ink-soft); }
/* A labelled five-point scale lies flat where there is room */
@media (min-width: 720px) {
  .options.flat { grid-auto-flow: column; grid-auto-columns: 1fr; }
  .options.flat .opt { flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 12px 8px; }
  .options.flat .opt input { margin: 0; }
  .options.flat .opt span { font-size: 14.5px; }
}

/* Grid: one radio group per row */
.grid-head, .grid-row { display: grid; gap: 6px; align-items: center; }
.grid-head { display: none; }
.grid-row { padding: 12px 0; border-top: 1px solid var(--rule-soft); }
.grid-row:first-of-type { border-top: 0; }
.row-label { font-size: 15.5px; line-height: 1.4; margin-bottom: 4px; }
.cells { display: grid; gap: 6px; }
.cell {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--paper-lift); cursor: pointer; font-size: 15px;
}
.cell:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
.cell:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.cell input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex: none; }
.cell input:focus-visible { outline: none; }
@media (min-width: 720px) {
  /* Equal columns across the whole width, each row's label on its own line above its radios: six columns
     then still give every heading room for its longest word ("Uncomfortable"), which wraps between words only. */
  .grid-head { display: grid; align-items: end; padding-bottom: 8px; font-size: 12.5px; line-height: 1.25; color: var(--ink-soft); text-align: center; }
  .grid-head span { min-width: 0; padding: 0 2px; overflow-wrap: break-word; }
  .grid-head span:first-child { display: none; }
  .grid-head, .grid-row { grid-template-columns: var(--cols); }
  .grid-row .cells { display: contents; }
  .row-label { grid-column: 1 / -1; margin: 0; }
  .cell { justify-content: center; padding: 10px 0; border: 0; background: none; border-radius: 8px; }
  .cell:hover { background: var(--accent-wash); }
  .cell:has(input:checked) { background: none; }
  .cell .cell-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cell input { width: 20px; height: 20px; }
}

/* ── Navigation ─────────────────────────────────────────────────── */
.nav { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-top: 40px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 24px;
  border-radius: 999px; border: 1px solid var(--accent); font: inherit; font-weight: 600; font-size: 16px;
  cursor: pointer; text-decoration: none; transition: background-color 0.15s, color 0.15s, transform 0.15s;
}
.btn-primary { background: var(--accent); color: var(--paper-lift); margin-left: auto; }
.btn-primary:hover { background: #234a5e; }
.btn-primary:disabled { opacity: 0.6; cursor: progress; }
.btn-quiet { background: transparent; color: var(--accent); }
.btn-quiet:hover { background: var(--accent-wash); }
.send-msg { margin: 16px 0 0; font-size: 15px; color: var(--error); }
.privacy-line { margin: 44px 0 0; padding-top: 16px; border-top: 1px solid var(--rule-soft); font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.privacy-line a { color: var(--ink-soft); }

/* Off-screen field that only bots fill in */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ── End page ───────────────────────────────────────────────────── */
.end { text-align: center; padding-top: 40px; }
.figure { width: 132px; height: 114px; overflow: visible; margin: 0 auto 10px; display: block; }
.figure .arm-wave, .figure .mouth-big { display: none; }
.figure.wave .arm-wave, .figure.wave .mouth-big { display: inline; }
.figure.wave .arm-down, .figure.wave .mouth { display: none; }
.figure .arm-wave { transform-box: fill-box; transform-origin: 0% 100%; }
.figure.wave .arm-wave { animation: wave 0.55s ease-in-out 3; }
.figure.wave > g { transform-box: fill-box; transform-origin: 50% 100%; animation: hop 0.5s var(--ease-out) 1; }
@keyframes wave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(22deg); } }
@keyframes hop { 0%, 100% { transform: none; } 35% { transform: translateY(-16%) scale(1.04, 0.97); } 60% { transform: translateY(0) scale(1.03, 0.95); } }
.end h1 { font-family: var(--display); font-style: italic; font-weight: 400; font-size: clamp(2rem, 6vw, 2.6rem); margin: 6px 0 12px; }
.end h1:focus { outline: none; }
.end .about { max-width: 30rem; margin: 0 auto; font-size: 1.1rem; line-height: 1.6; color: var(--ink-soft); }
.end .about strong { color: var(--ink); font-weight: 600; }
.end .actions { margin: 28px 0 0; }
.end .actions .btn-primary { margin: 0; }
.button-note { margin: 10px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.closing { margin: 44px auto 0; max-width: 30rem; font-family: var(--display); font-style: italic; font-size: 1.15rem; color: var(--ink); }
.end-privacy { margin: 14px 0 0; font-size: 13px; color: var(--ink-soft); }
.end-privacy a { color: var(--ink-soft); }
.talk { margin: 44px auto 0; max-width: 30rem; padding-top: 24px; border-top: 1px solid var(--rule-soft); }
.talk p { margin: 0; }
.link-button {
  font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 0.18em;
}
.talk-form { margin-top: 18px; text-align: left; }
.talk-form label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.talk-row { display: flex; gap: 10px; }
.talk-row .text-input { flex: 1; min-width: 0; }
.talk-row .btn-primary { margin: 0; flex: none; }
.talk-msg { margin: 12px 0 0; font-size: 15px; }
.talk-msg.err { color: var(--error); }
@media (max-width: 420px) { .talk-row { flex-direction: column; } }

@media (prefers-reduced-motion: reduce) {
  .page, .figure.wave .arm-wave, .figure.wave > g { animation: none; }
  .part .bar, .opt, .scale .pt span, .btn { transition: none; }
}

/* ── The privacy notice (privacy.html) ──────────────────────────── */
.notice { padding-bottom: 96px; }
.notice p, .notice li { color: var(--ink-soft); line-height: 1.7; }
.notice strong { color: var(--ink); font-weight: 600; }
.notice ul { padding-left: 1.2em; }
.notice li + li { margin-top: 6px; }
.notice .section-heading { font-size: 1.25rem; margin-top: 30px; }
.draft-banner {
  margin: 24px 0 0; padding: 12px 16px; border: 2px dashed var(--error); border-radius: 10px;
  background: #f7e3dc; color: var(--ink) !important; font-size: 15px;
}
.notice .open { padding: 10px 14px; background: var(--veil); border-radius: 8px; font-size: 15px; }
