/* ═══════════════════════════════════════════════════════════════
   The Shop page's own parts: the Put Me in the Game section, its ladder,
   and the order form. Loaded after css/style.css, which owns the tokens,
   both themes, .section, .shead, .proj, .btn, .soon, and the focus ring.

   Rules for this file, all held by tests/shop-page.test.mjs:
   - Tokens only. The one exception is the error red below, which the
     site's sheets do not have.
   - Nothing moves. This sheet adds no animation and no transition, so
     there is nothing for the Pause animations switch to answer.
   - A text color holds 4.5:1 on every surface it can sit on, and the edge
     of a control holds 3:1, in both themes.
   ═══════════════════════════════════════════════════════════════ */

/* The error red. #B3261E is 6:1 on the cream and 5.7:1 on the band. On
   near-black it turns to a salmon, because the dark red is a bruise there. */
:root {
  --bad:      #B3261E;
  --bad-soft: rgba(179, 38, 30, .08);
}
:root[data-theme="dark"] {
  --bad:      #FF8F7A;
  --bad-soft: rgba(255, 143, 122, .12);
}

/* ── The section ────────────────────────────────────────────── */
.pmig { max-width: 820px; }
.pmig > * + * { margin-top: clamp(26px, 3.4vw, 40px); }

.pmig__intro {
  max-width: 60ch;
  font-family: var(--serif);
  font-size: clamp(17px, 1.3vw, 21px);
  line-height: 1.6;
  color: var(--ink-2);
}

.pmig h3 {
  font-family: var(--mono);
  font-size: 13px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 14px;
}

.pmig p { max-width: 64ch; color: var(--ink-2); }
.pmig__fine { margin-top: 14px; }

/* The numbered steps. list-style is none sitewide, which makes Safari drop
   the list role, so the markup says role="list" and the numbers are drawn
   here. */
.steps { display: grid; gap: 12px; counter-reset: step; max-width: 64ch; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 48px;
  min-height: 34px;
  color: var(--ink-2);
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--lilac);
  color: var(--violet-deep);
  font-family: var(--mono); font-size: 14px; font-weight: 700; line-height: 1;
}

/* The ground rules: the lines that matter most are set apart. */
.callout {
  max-width: 64ch;
  padding: 16px 20px;
  border-left: 4px solid var(--violet);
  border-radius: 0 var(--r) var(--r) 0;
  background: var(--lilac);
}
.callout p { color: var(--ink); max-width: none; }
.callout p + p { margin-top: 10px; }

/* ── The ladder ─────────────────────────────────────────────── */
/* The wrapper scrolls on its own if a reader's text size is large enough to
   outgrow the screen, and takes the keyboard when it does. At 320px the
   table fits: the header cells and the tier names wrap. */
.ladder-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.ladder { width: 100%; border-collapse: collapse; }
.ladder caption {
  text-align: left;
  padding: 12px 14px 10px;
  background: var(--band);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em;
  color: var(--ink-2);
}
.ladder th, .ladder td {
  text-align: left;
  padding: 11px clamp(8px, 2vw, 16px);
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px; line-height: 1.4;
  color: var(--ink-2);
}
.ladder thead th {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--violet-deep);
  background: var(--lilac);
  border-bottom: 1px solid var(--line);
}
.ladder tbody th { color: var(--ink); font-weight: 700; }
.ladder td:nth-child(n+3) { font-family: var(--mono); font-weight: 700; color: var(--ink); }
.ladder tbody tr:last-child th, .ladder tbody tr:last-child td { border-bottom: 0; }

/* ── The order form ─────────────────────────────────────────── */
.orderform {
  display: grid; gap: clamp(20px, 3vw, 30px);
  padding: clamp(20px, 3.4vw, 36px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.orderform > *, .fset, .field { min-width: 0; }

/* A fieldset keeps a border, padding, and a min-content width of its own that
   refuse to shrink in a grid. All three go. Block flow, not a grid: browsers
   disagree about whether a legend is a grid item. */
.fset { border: 0; padding: 0; margin: 0; }
.fset > * + * { margin-top: 12px; }
.fset__legend {
  padding: 0; margin-bottom: 2px;
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink);
}

.field { display: grid; gap: 6px; align-content: start; }
.field__label {
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink);
}
.field__hint { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--muted); max-width: 60ch; }
.field__error {
  margin: 0;
  font-size: 15px; font-weight: 600; line-height: 1.5;
  color: var(--bad);
}
.field__error::before { content: 'Error: '; }

.field__input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  font-family: var(--sans); font-size: 16.5px; line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--muted);
  border-radius: 12px;
}
textarea.field__input { min-height: 120px; resize: vertical; }
select.field__input { cursor: pointer; }
.field__input:hover { border-color: var(--violet); }
.field__input[aria-invalid="true"] { border-color: var(--bad); border-width: 2px; padding: 9.5px 13.5px; }

/* The dropdown list is painted by the operating system. Naming both colors
   keeps a dark-theme reader from getting dark text on a dark list. */
.field__input option { background: var(--paper); color: var(--ink); }

/* ── Choices: games, tiers, who, age, and the three promises ── */
.choices {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.choices--tiers { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.choices--stack { grid-template-columns: minmax(0, 1fr); }

/* The whole tile is the target, and the input inside it stays a real radio or
   checkbox: focusable, announced, and ticked by its label. */
.choice {
  display: flex; align-items: flex-start; gap: 12px;
  min-height: 48px;
  padding: 11px 14px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  cursor: pointer;
}
.choice:hover { border-color: var(--violet); }
.choice:has(input:checked) { background: var(--lilac); border-color: var(--violet); }
.choice input {
  flex: none;
  width: 24px; height: 24px; margin: 0;
  accent-color: var(--violet);
  cursor: pointer;
}
.choice input[type="radio"]:focus-visible { border-radius: 50%; }
.choice input[aria-invalid="true"] { outline: 2px solid var(--bad); outline-offset: 2px; }
.choice__text { display: grid; gap: 2px; min-width: 0; line-height: 1.4; }
.choice__name { font-weight: 700; color: var(--ink); }
.choice__sub { font-size: 14.5px; color: var(--ink-2); }
.choice--plain { font-size: 15.5px; line-height: 1.5; color: var(--ink); }
.choice--plain a {
  color: var(--violet-deep); font-weight: 600;
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px;
}
.choice--plain a:hover { color: var(--violet); }

/* ── The price, the notes, the button ───────────────────────── */
.orderprice {
  display: block;
  padding: 14px 18px;
  background: var(--lilac);
  border-radius: 12px;
  font-family: var(--serif); font-size: clamp(19px, 2vw, 24px); font-weight: 600; line-height: 1.35;
  color: var(--ink);
}

.stack { display: grid; gap: clamp(20px, 3vw, 30px); }
.stack > * { min-width: 0; }

.formnote { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink-2); max-width: 62ch; }

.formgo { width: 100%; justify-content: center; }
.formgo[disabled] { opacity: .6; cursor: not-allowed; }
.formgo[disabled]:hover { transform: none; }

.formstatus { min-height: 1.6em; margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--ink); }
.formstatus:empty { min-height: 0; }

/* ── The error summary: it takes focus, so it shows a ring ──── */
.errsum {
  padding: 14px 18px;
  border-left: 4px solid var(--bad);
  border-radius: 0 12px 12px 0;
  background: var(--bad-soft);
  color: var(--ink);
}
.errsum:focus { outline: 3px solid var(--violet); outline-offset: 3px; }
.errsum h3 { margin-bottom: 6px; color: var(--ink); }
.errsum ul { display: grid; gap: 0; }
.errsum li { color: var(--ink); }
.errsum a {
  display: inline-block; padding: 4px 0;
  font-weight: 600; color: var(--ink);
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px;
}
.errsum a:hover { color: var(--violet-deep); }

/* ── The notices after a payment ────────────────────────────── */
.notice {
  max-width: 64ch;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 0 var(--r) var(--r) 0;
  background: var(--paper);
  color: var(--ink);
}
.notice:focus { outline: 3px solid var(--violet); outline-offset: 3px; }
.pmig .notice h3 { color: var(--ink); }
.pmig .notice p { color: var(--ink); }

.pmig .soon { justify-self: start; }
.orderform .soon { justify-self: start; }

@media (max-width: 480px) {
  .choice { padding: 10px 12px; }
}

/* Print: the form is not something to print, the ladder is. */
@media print {
  .orderform, .notice { display: none; }
}
