/* ==========================================================================
   SCREENING — the qualifying form on /book/

   A card on paper holding four fieldsets. Each step is one question with big
   serif type, because the person filling this in is nervous and a wall of
   twelve labelled inputs reads as an application form, not a conversation.

   Fails open: no JavaScript and every step is visible at once, still a working
   form. `novalidate` is not in the markup either, so a no-JS submit is checked
   by the browser. The stepper adds `is-stepped` from JS and only then do the
   inactive steps disappear.
   ========================================================================== */

.screen-hero__h1 { max-width: 18ch; margin-top: var(--s-4); }
.screen-hero .lead { margin-top: var(--s-4); }
.screen-hero .eyebrow { margin: 0; }
.screen-hero__meta {
  display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5);
  margin-top: var(--s-8);
  font-family: var(--font-mono); font-size: var(--t-mono);
  letter-spacing: var(--tr-mono); text-transform: uppercase;
  color: var(--text-invert-muted);
}
/* the dot belongs to the item BEFORE the break, so a wrapped meta line never
   starts with a stray bullet */
.screen-hero__meta span:not(:last-child)::after {
  content: ""; display: inline-block; vertical-align: middle;
  width: 3px; height: 3px; border-radius: 50%;
  background: currentColor; margin-left: var(--s-5); opacity: .8;
}

.screen {
  max-width: 44rem; margin-inline: auto;
  padding: clamp(1.25rem, 4vw, 3rem);
  background: var(--paper-100);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lift);
}
.screen__trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.screen__head { margin-bottom: var(--s-8); }
.screen__count {
  font-family: var(--font-mono); font-size: var(--t-mono);
  letter-spacing: var(--tr-mono); text-transform: uppercase;
  color: var(--text-faint); margin: 0 0 var(--s-3);
}
.screen__rail { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.screen__rail span {
  display: block; height: 100%; width: 25%;
  background: var(--ink-900);
  transition: width var(--dur) var(--ease);
}

.screen__step { border: 0; margin: 0; padding: 0; min-width: 0; }
.screen__q {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.125rem);
  line-height: 1.1; letter-spacing: var(--tr-heading);
  padding: 0; margin: 0 0 var(--s-3);
}
.screen__hint {
  font-size: var(--t-small); line-height: 1.6;
  color: var(--text-muted); max-width: 52ch; margin: 0 0 var(--s-6);
}
.screen__nav {
  display: flex; flex-wrap: wrap; gap: var(--s-3);
  justify-content: space-between; align-items: center;
  margin-top: var(--s-8); padding-top: var(--s-6);
  border-top: 1px solid var(--line);
}
.screen__nav .btn--primary { margin-left: auto; }
.btn--back { padding-inline: 0; border-color: transparent; }
.btn--back:hover { background: none; color: var(--text-invert); }
.screen__legal {
  font-size: 0.8125rem; line-height: 1.55; color: var(--text-faint);
  max-width: 56ch; margin: var(--s-5) 0 0;
}

/* — fields — */
.field { margin-top: var(--s-6); }
.field:first-of-type { margin-top: 0; }
.field__label {
  display: block; margin-bottom: var(--s-3);
  font-family: var(--font-mono); font-size: var(--t-mono);
  letter-spacing: var(--tr-mono); text-transform: uppercase;
  color: var(--text-muted);
}
.field__opt { text-transform: none; letter-spacing: 0; color: var(--text-faint); }
.field-row { display: grid; gap: var(--s-4); grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 34rem) { .field-row { grid-template-columns: 1fr; } }

.field__input, .field__select select {
  width: 100%; display: block;
  padding: var(--s-3) var(--s-4);
  min-height: 48px;
  font-family: var(--font-sans); font-size: var(--t-body);
  color: var(--text); background: var(--paper-100);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
.field__input::placeholder { color: var(--text-faint); }
.field__input:hover, .field__select select:hover { border-color: var(--ink-900); }
.field__input:focus, .field__select select:focus {
  outline: none; border-color: var(--ink-900);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.field__area { resize: vertical; min-height: 96px; line-height: 1.5; }

.field__select { position: relative; }
.field__select select {
  appearance: none; -webkit-appearance: none;
  padding-right: var(--s-10); cursor: pointer;
}
.field__select::after {
  content: ""; position: absolute; right: var(--s-4); top: 50%;
  width: 8px; height: 8px; margin-top: -6px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(45deg); pointer-events: none;
}

/* — tiles: a real radio/checkbox, dressed as a card — */
.opts { display: grid; gap: var(--s-2); }
.opts--cols2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 34rem) { .opts--cols2 { grid-template-columns: 1fr; } }

.opt { position: relative; display: block; }
.opt input {
  position: absolute; opacity: 0; width: 1px; height: 1px;
  margin: 0; pointer-events: none;
}
.opt__face {
  display: flex; align-items: center; gap: var(--s-3);
  min-height: 52px; padding: var(--s-3) var(--s-4);
  font-size: var(--t-small); line-height: 1.35;
  color: var(--text); background: var(--paper-100);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}
.opt__face::before {
  content: ""; flex: none; width: 14px; height: 14px;
  border: 1px solid var(--line-strong); border-radius: 50%;
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
input[type="checkbox"] + .opt__face::before { border-radius: 3px; }
.opt__body { display: grid; gap: 2px; }
.opt__t { font-weight: 500; }
.opt__s { font-size: 0.8125rem; line-height: 1.3; color: var(--text-muted); }
.opt:hover .opt__face { border-color: var(--ink-900); }
.opt input:checked + .opt__face {
  background: var(--ink-900); border-color: var(--ink-900); color: var(--text-invert);
}
.opt input:checked + .opt__face::before {
  border-color: var(--text-invert);
  box-shadow: inset 0 0 0 3px var(--ink-900), inset 0 0 0 9px var(--text-invert);
}
input[type="checkbox"]:checked + .opt__face::before {
  background: var(--text-invert);
  box-shadow: none;
}
/* A ticked checkbox is a set, not a verdict: filling the whole tile black turns
   a five-item list into five competing buttons. The box fills, the tile only
   firms up its edge. Radios keep the ink fill because one of them IS the answer. */
input[type="checkbox"]:checked + .opt__face {
  background: var(--paper-300);
  border-color: var(--ink-900);
  color: var(--text);
}
input[type="checkbox"]:checked + .opt__face::before {
  background: var(--ink-900);
  border-color: var(--ink-900);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.6l4.5-5' fill='none' stroke='%23fbfaf8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 12px 12px;
  background-position: center;
  background-repeat: no-repeat;
}
.opt input:focus-visible + .opt__face {
  outline: 2px solid var(--accent-ink); outline-offset: 2px;
}

/* — consent — */
.consent {
  display: flex; align-items: flex-start; gap: var(--s-3);
  margin-top: var(--s-6); font-size: var(--t-small); line-height: 1.5;
  color: var(--text-muted); cursor: pointer;
}
.consent input {
  flex: none; width: 18px; height: 18px; margin-top: 2px;
  accent-color: var(--ink-900); cursor: pointer;
}
.consent input:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

/* the stepper only hides things once JS owns the form */
.screen.is-stepped .screen__step { display: none; }
.screen.is-stepped .screen__step.is-active { display: block; }
.screen.is-stepped .screen__step + .screen__step { margin-top: 0; }

@media (max-width: 48rem) {
  .screen { padding: var(--s-5) var(--s-4); border-radius: var(--r-sm); }
  .screen__nav .btn { flex: 1 1 auto; justify-content: center; }
  .screen__nav .btn--back { flex: 0 0 auto; }
}
