/* Get a quote: the request page (docs/docs-plan-revision-dec2.md 1.7). The shared page hero is pages.css; here the hero
   holds the whole page: the copy, the form card and the steps. Stacked below 60rem with the art at the foot; from 60rem
   two columns, the card on the right, and the art mirrored so the star and the limb sit bottom left under the steps. */

.page-hero--book { min-height: 0; }
.page--book .page-hero--book { padding-bottom: min(60vw, 16rem); }
/* the art runs to the hero's foot (pages.css fades it out above where the old card began) */
.page-hero--book .page-art {
  -webkit-mask-image: linear-gradient(var(--nav-calm) calc(var(--header-h) - .5rem), #000 calc(var(--header-h) + 6rem));
  mask-image: linear-gradient(var(--nav-calm) calc(var(--header-h) - .5rem), #000 calc(var(--header-h) + 6rem)); }
.page-hero--book.grain::after { -webkit-mask-image: none; mask-image: none; }

.page-hero-in.book { gap: var(--s-7); justify-items: stretch; }
.book > * { min-width: 0; max-width: 38rem; }
.book-intro .label { margin-bottom: var(--s-5); }

@media (min-width: 60rem) {
  .page--book .page-hero--book { padding-bottom: var(--s-8); }
  .page-hero--book .page-hero-in { padding-top: clamp(1.5rem, 4svh, 3rem); }
  .page-hero-in.book { grid-template-columns: minmax(0, 1fr) minmax(0, min(38rem, 56%)); grid-template-rows: auto 1fr; gap: var(--s-7) clamp(3rem, 6vw, 6rem); align-items: start; }
  .book > * { max-width: none; }
  .book-intro { grid-area: 1 / 1; }
  .req-card { grid-area: 1 / 2 / 3; }
  /* room under the steps for the art: about the height of the limb's crest, which scales with the art box below */
  .book-next { grid-area: 2 / 1; padding-bottom: calc(min(62vw, 56rem) * .22); }
  /* the art box narrows to the left part of the hero, so the limb and the star (both sized by its width in pages.css and
     pages.js) come out small enough to sit under the steps; then mirrored so the limb rises from the bottom left */
  .page-hero--book .page-art { right: auto; width: min(62%, 56rem); transform: scaleX(-1); }
}

/* The card: the no-JS block, the form, or one of its two results */
.req-card { container-type: inline-size; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(1.25rem, 4vw, 2rem); }
.req[hidden], .req-state[hidden], .req-nojs[hidden] { display: none; }
.req-nojs { display: grid; gap: var(--s-5); justify-items: start; }
.req-nojs p { font-size: var(--t-lg); line-height: 1.45; letter-spacing: -.01em; }

/* Form: one column of questions */
.req { display: grid; gap: var(--s-5); }
.req-set { min-width: 0; margin: 0; padding: 0; border: 0; display: grid; gap: var(--s-2); }
.field { display: grid; gap: var(--s-2); min-width: 0; align-content: start; }
.field > label, .req-q { padding: 0; font-size: 1rem; font-weight: 500; line-height: 1.3; color: var(--paper); }
.req-q { margin-bottom: var(--s-2); }
/* Phone and Email: the two answers to one question, side by side when there is room */
.req-pair { display: grid; gap: var(--s-3) var(--s-4); }
.req-pair .field > label { font-weight: 400; color: var(--mist); }
@container (min-width: 24rem) { .req-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.req :is(input[type="text"], input[type="email"], input[type="tel"], textarea) {
  display: block; width: 100%; min-width: 0; margin: 0; min-height: 56px; padding: 0 16px;
  background: var(--ink); color: var(--paper); font-size: 1.0625rem; line-height: 1.4;
  border: 1px solid var(--control); border-radius: var(--r-sm); transition: border-color var(--t-fast) var(--ease); }
.req textarea { padding: 14px 16px; resize: vertical; line-height: 1.5; min-height: calc(4lh + 30px); }
.req :is(input, textarea):hover { border-color: var(--mist); }
.req :is(input, textarea):focus-visible { border-color: var(--paper); }
.req :is(input, textarea)[aria-invalid="true"] { border-color: var(--err); }
.req :is(input, textarea):disabled { opacity: .6; }
.hint { font-size: .9375rem; line-height: 1.45; color: var(--mist); }
.req-count { margin-left: .5em; color: var(--paper); }
.err { font-size: .9375rem; line-height: 1.4; color: var(--err); }
.err:empty { display: none; }
/* Honeypot: off screen for people, still in the form for bots */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Best time: real radios drawn as pills; the whole pill is the target and arrow keys move between them */
.pills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
@container (min-width: 30rem) { .pills { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pill { position: relative; display: flex; align-items: center; justify-content: center; gap: .5rem; min-height: 52px; padding: 0 12px;
  font-size: 1.0625rem; line-height: 1.2; text-align: center; color: var(--paper); cursor: pointer;
  border: 1px solid var(--control); border-radius: var(--r-pill);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.pill input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pill:hover { border-color: var(--mist); }
.pill:has(:checked) { background: var(--paper); color: var(--ink); border-color: var(--paper); }
/* a tick on the chosen one, so the choice does not rest on the fill alone */
.pill:has(:checked)::before { content: ""; flex: none; width: 6px; height: 11px; margin: -3px 2px 0 0;
  border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.pill:has(:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.req:has(:disabled) .pill { cursor: progress; opacity: .6; }

/* Send: one wide button */
.req-send { display: grid; gap: var(--s-3); margin-top: var(--s-2); }
.req-send .btn, .req-wide { width: 100%; min-height: 56px; justify-content: space-between; font-size: 1.0625rem; }
.req[aria-busy="true"] .req-send .btn { cursor: progress; }

/* Results: Sent, or One last step (the email path) */
.req-state { display: grid; gap: var(--s-4); justify-items: start; }
.req-state h2 { font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.25rem); line-height: 1.1; letter-spacing: -.03em; max-width: 18ch; }
.req-state h2:focus { outline: none; }
.req-state h2:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.req-first { font-size: 1.0625rem; line-height: 1.5; color: var(--mist); }
.req-first[hidden] { display: none; }
.req-first strong { color: var(--paper); font-weight: 500; overflow-wrap: anywhere; }
.req-fail { color: var(--paper); padding-left: var(--s-3); border-left: 2px solid var(--err); }
.req-wide { margin-block: var(--s-2); }
.req-addr { color: var(--paper); user-select: all; overflow-wrap: anywhere; }
.req-copies { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.req-msg { width: 100%; margin: var(--s-2) 0 0; max-height: 16rem; overflow: auto; padding: var(--s-4);
  background: var(--ink); color: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm);
  font: 400 .9375rem/1.55 var(--f-sans); white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
.req-edit { min-height: 44px; padding: 0; background: none; border: 0; cursor: pointer; font-size: 1rem; }

/* What happens next: three steps on hairlines */
.book-next { display: grid; gap: var(--s-4); align-content: start; }
.book-next h2 { font: 500 var(--t-lg)/1.3 var(--f-sans); letter-spacing: -.015em; max-width: none; }
.book-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.book-steps li { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); padding: var(--s-3) 0; border-top: 1px solid var(--line);
  font-size: 1.0625rem; line-height: 1.45; color: var(--mist); }
.book-steps li::before { counter-increment: step; content: counter(step); grid-row: 1 / span 2; font: 500 1rem/1.55 var(--f-mono); color: var(--dim); }
.book-steps strong { color: var(--paper); font-weight: 500; }
.book-steps li > * { grid-column: 2; }
.book-write { font-size: 1.0625rem; color: var(--mist); overflow-wrap: anywhere; }

@media (forced-colors: active) {
  .pill, .req-card { border-color: CanvasText; }
  .pill:has(:checked) { forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight; }
}
