/* Fast Flow Plumbing · job form. His navy is the page, the question sits on it, one orange action. */

@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("assets/fonts/Barlow-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("assets/fonts/Barlow-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url("assets/fonts/Barlow-700.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 500; font-display: swap; src: url("assets/fonts/BarlowSemiCondensed-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-display: swap; src: url("assets/fonts/BarlowSemiCondensed-600.woff2") format("woff2"); }

:root {
  /* the field: his navy, deepest at the top where the logo sits */
  --field-deep: #061a3a;
  --field: #08234d;
  --field-light: #0b2b5c;
  --sky-pale: #dcefff;     /* lead lines and the Back link on the field */
  --sky: #9fc9ee;          /* labels, the counter, the foot: tinted from the hue, never gray */
  --line: rgba(255, 255, 255, 0.34);       /* chip outlines on the field */
  --line-strong: rgba(255, 255, 255, 0.62);
  --wash: rgba(255, 255, 255, 0.07);       /* chip fill on the field */
  --wash-hover: rgba(255, 255, 255, 0.13);
  --track: rgba(255, 255, 255, 0.16);      /* the empty part of the progress line */
  /* white paper, only where someone types */
  --paper: #ffffff;
  --ink: #12213a;
  --ink-faint: #5b6b85;
  --blue: #0068a8;         /* logo blue: the caret and icons on paper */
  --orange: #ff6d00;       /* the one action, with ink on it (5.7:1); white on it would be 2.8:1 */
  --orange-hover: #f26300;
  --err: #ffb8ad;          /* errors on the field */
  --err-paper: #c9321f;
  --r: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sans: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --cond: "Barlow Semi Condensed", "Arial Narrow", Arial, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root { --field-deep: #04132c; --field: #061c40; --field-light: #08234d; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 500;
  color: #fff;
  background: var(--field);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--orange); color: var(--ink); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 6px; }
h1:focus, h2:focus { outline: none; }   /* focus is moved here for screen readers; no ring needed */
svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ── The field is the page ─────────────────────────────────────────── */
.field {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(180deg, var(--field-deep) 0, var(--field) 42%, var(--field-light) 100%);
  padding: calc(18px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
}
.sheet {
  flex: 1 0 auto;
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
}

/* ── Top bar: his logo at the size a logo is, the step, a line of progress ── */
.top {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}
.brand { display: block; border-radius: 8px; }
.brand img { display: block; width: 142px; height: auto; }
.steps {
  font: 600 13px/1 var(--cond);
  letter-spacing: 0.06em;
  color: var(--sky);
  text-transform: uppercase;
}
.bar {
  grid-column: 1 / -1;
  height: 3px; margin-top: 14px;
  background: var(--track);
  border-radius: 2px; overflow: hidden;
}
.bar i {
  display: block; height: 100%; width: 100%;
  background: var(--orange);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.45s var(--ease);
}
.field[data-step="0"] .bar { background: transparent; }   /* no empty track before the first question */

/* ── The question, straight on the field ───────────────────────────── */
/* It sits the same distance down on every step: a step with fewer answers
   must not slide the question up the screen. The drop is deep enough that
   the page never reads as pinned to the top. */
.stage {
  flex: 1;
  width: 100%;
  padding: clamp(28px, 11vh, 104px) 0 8px;
}
/* The welcome and the thank-you are covers: one short block, centred in what
   is left of the screen. Every question keeps the anchored drop above, so the
   question itself never moves from step to step. */
.field[data-step="0"] .stage, .field[data-step="6"] .stage {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 24px;
}
.back {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 0; color: var(--sky-pale);
  font: 600 15px/1 var(--sans); padding: 8px 10px 8px 2px; margin: 0 0 4px -2px;
  border-radius: 8px; cursor: pointer;
}
.back:hover { color: #fff; }
.back[hidden] { display: none; }
.screen[hidden] { display: none; }
.screen { animation: rise 0.32s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

h1, h2 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.04;
  margin: 4px 0 14px;
  text-wrap: balance;
  overflow-wrap: anywhere;   /* "Thanks, Wolfeschlegelstein…" breaks inside the word instead of running off a phone (2026-10-18) */
}
h1 { font-size: clamp(36px, 9vw, 52px); }
h2 { font-size: clamp(30px, 7.5vw, 42px); }
.lead { font-size: 17px; line-height: 1.5; color: var(--sky-pale); margin: 0 0 22px; max-width: 34em; }
.lead.small { font-size: 16px; margin-top: 18px; margin-bottom: 0; }
.sub { font: 600 13px/1 var(--cond); text-transform: uppercase; letter-spacing: 0.06em; color: var(--sky); margin: 22px 0 10px; }
.inline-link { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--orange); border-radius: 6px; }

/* Chips: outlined on the field; the chosen one floods orange */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 50px; padding: 0 16px;
  border-radius: var(--r);
  border: 1.5px solid var(--line);
  background: var(--wash);
  color: #fff; font: 600 16px/1 var(--sans);
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.15s var(--ease);
}
.chip svg { color: var(--sky); width: 20px; height: 20px; }
.chip:hover { background: var(--wash-hover); border-color: var(--line-strong); }
.chip:active { transform: scale(0.97); }
.chip[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.chip[aria-pressed="true"] svg { color: var(--ink); }

/* Fields: label on the field, paper where they type */
.fld { display: block; margin: 16px 0 0; }
.lbl { display: block; font: 600 13px/1 var(--cond); letter-spacing: 0.05em; text-transform: uppercase; color: var(--sky); margin: 0 0 8px; }
.lbl em { font: 500 13px/1 var(--sans); font-style: normal; text-transform: none; letter-spacing: 0; color: var(--sky); opacity: 0.85; margin-left: 6px; }
input[type="text"], input[type="tel"], input[type="email"], textarea {
  width: 100%;
  font: 500 17px/1.3 var(--sans);
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid transparent;
  border-radius: var(--r);
  padding: 14px 16px;
  min-height: 54px;
  caret-color: var(--blue);
  transition: box-shadow 0.2s var(--ease);
}
textarea { resize: none; min-height: 90px; }
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input:focus, textarea:focus { outline: none; box-shadow: 0 0 0 3px var(--orange); }
.fld.bad input, .fld.bad textarea { box-shadow: 0 0 0 3px var(--err-paper); }

.err { color: var(--err); font: 600 15px/1.35 var(--sans); margin: 12px 0 0; }
.err[hidden] { display: none; }

/* Actions: the orange button, full width on a phone */
.actions { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 24px;
  border-radius: var(--r); border: 0;
  font: 700 17px/1 var(--sans);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease);
}
.btn.primary { background: var(--orange); color: var(--ink); box-shadow: 0 10px 26px -12px rgba(255, 109, 0, 0.9); }
.btn.primary:hover { background: var(--orange-hover); }
.btn.primary:active { transform: translateY(1px) scale(0.99); }
.btn.primary[disabled] { opacity: 0.75; cursor: progress; }
.btn.primary.busy svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; margin: 2px 0 4px; }
.photos .add {                     /* a real button (the keyboard reaches it: Tab, Enter), drawn as the dashed tile */
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  aspect-ratio: 1; border-radius: var(--r); padding: 0; background: transparent;
  border: 1.5px dashed var(--line-strong); color: var(--sky-pale);
  font: 600 14px/1 var(--sans); cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.photos .add[hidden] { display: none; }        /* five is the limit: the tile goes once they are in */
.photos .add:hover { border-color: #fff; background: var(--wash); }
.photos .add svg { width: 26px; height: 26px; color: var(--sky); }
.thumb { position: relative; aspect-ratio: 1; border-radius: var(--r); overflow: hidden; background: var(--field-light); animation: pop 0.36s var(--ease) both; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button {
  position: absolute; top: 6px; right: 6px;
  width: 30px; height: 30px; border-radius: 50%; border: 0;
  background: rgba(6, 26, 58, 0.85); color: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.thumb button svg { width: 16px; height: 16px; }
@keyframes pop { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }

/* Done */
.done-mark { width: 60px; height: 60px; border-radius: 50%; background: var(--orange); color: var(--ink); display: grid; place-items: center; margin: 0 0 18px; animation: pop 0.4s var(--ease) both; }
.done-mark svg { width: 32px; height: 32px; stroke-width: 2.6; }

/* The phone, pinned to the bottom, for anyone who'd rather talk */
.foot { margin: auto 0 0; padding-top: 24px; color: var(--sky); font: 500 15px/1.4 var(--sans); }
.foot a { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--orange); border-radius: 6px; }
.field[data-step="6"] .foot { display: none; }   /* the thank-you already offers the call */

/* Honeypot */
.hp { position: absolute; left: -9999px; top: 0; width: 1px; height: 1px; overflow: hidden; }

/* Phones: a tighter rhythm so the longest step fits the screen */
@media (max-width: 599px) {
  .chips { gap: 8px; }
  .chip { min-height: 48px; padding: 0 14px; }
  textarea { min-height: 80px; }
  .actions { margin-top: 20px; }
  .foot { padding-top: 20px; }
}

/* Small phones (320-360px): tighter gutters, smaller mark */
@media (max-width: 360px) {
  .field { padding-left: 16px; padding-right: 16px; }
  .brand img { width: 122px; }
  .chip { font-size: 15px; }
}

/* Tablets and up: more air, the button stops stretching */
@media (min-width: 600px) {
  .field { padding-left: 32px; padding-right: 32px; }
  .brand img { width: 152px; }
  .actions { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .btn { width: auto; min-width: 190px; }
}

/* Desktop: a little more room at the top and bottom */
@media (min-width: 900px) {
  .field { padding-top: clamp(24px, 5vh, 44px); padding-bottom: 40px; }
  .brand img { width: 165px; }
}

/* A window too short for a question and its button (a phone on its side, a small laptop window): the orange button
   stays in view at the foot while the answers above it scroll, on a band of the field so chips fade under it.
   On a screen that fits, it sits where it always did. (2026-10-18: Next was below the screen on 4 of the 5 questions
   at 844×390 and on 2 of 5 at 1280×600.)
   The band takes the foot of the window, so the box being typed in and its red message are always brought up above
   it, never left behind it (2026-10-19, the re-test's N1: Tab into Email at 1366×657 put the box under the band, and
   a bad email's message sat wholly behind it). `scroll-padding-bottom` tells the browser the band is there for its own
   scrolls (a box taking the keyboard, a message brought into view); form.js `reveal` measures the band and makes sure. */
@media (max-height: 760px) {
  html { scroll-padding-bottom: 92px; }
  .screen .actions {
    position: sticky; bottom: 0; z-index: 2;
    margin-top: 16px; padding: 10px 0 14px;
    background: linear-gradient(180deg, rgba(8, 35, 77, 0) 0, rgba(8, 35, 77, 0.92) 12px, rgba(8, 35, 77, 0.92) 100%);
  }
}

/* Short screens (a phone on its side, small laptops): the type, controls and
   rhythm all shrink so the question and its button fit without scrolling. */
@media (max-height: 560px) {
  html { scroll-padding-bottom: 78px; }    /* the band is shorter here: 46px controls */
  .field { padding-top: 12px; padding-bottom: 16px; }
  .brand img { width: 110px; }
  .stage { padding: 14px 0 6px; }
  h1 { font-size: clamp(26px, 6vh, 36px); }
  h2 { font-size: clamp(22px, 5.5vh, 30px); }
  .lead { font-size: 16px; margin-bottom: 14px; }
  .actions { margin-top: 12px; padding-bottom: 10px; }
  .fld { margin-top: 10px; }
  .sub { margin: 14px 0 8px; }
  .btn, .chip { min-height: 46px; }
  input[type="text"], input[type="tel"], input[type="email"] { min-height: 46px; padding: 10px 14px; }
  textarea { min-height: 68px; }
  .photos { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .done-mark { width: 46px; height: 46px; margin-bottom: 12px; }
  .done-mark svg { width: 26px; height: 26px; }
  .foot { padding-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .screen, .thumb, .done-mark { animation: none; }
  .bar i, .chip, .btn, input, textarea { transition: none; }
}
