@import url('/assets/css/confirm-button.css');

/* /checkout/ and /checkout/thanks/ (docs/decisions.md GC-13): the one membership path, one page. Tokens from panelab.css;
   the header, footer and fields from auth.css. The form on the left (Plan, Account, Payment, the pay button), the order
   summary on the right; on phones the summary is a bar on top that opens, and the pay button sticks to the bottom. */
.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; }

.co { flex: 1; width: 100%; max-width: 1096px; margin: 0 auto; padding: clamp(24px, 4vh, 40px) 24px 56px; }
.co__grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; }

/* ---------- the form: one white sheet, sections divided by hairlines ---------- */
.co-form { grid-column: 1; grid-row: 1; container-type: inline-size; min-width: 0; padding: 28px clamp(24px, 4vw, 40px) 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sheet); box-shadow: var(--e1); }
.co-title { margin: 0 0 20px; font: 800 clamp(28px, 3.2vw, 36px)/1.08 var(--display); letter-spacing: -.02em; color: var(--ink); }
.co-sec { padding: 20px 0 24px; border-top: 1px solid var(--line); }
.co-sec__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 14px; }
.co-sec__title { margin: 0; font: 700 var(--t-sub)/1.25 var(--body); color: var(--ink); }
.co-sec__aside { margin: 0; font-size: 15px; color: var(--ink-2); }
.co-sec__aside a, .co-consent a { color: var(--link); font-weight: 600; text-underline-offset: 3px; }
.co-sec .auth-error { margin-top: 10px; }

/* plan: two radio cards, side by side when the form is wide enough */
.co-plans { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 12px; }
.co-plan { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; grid-template-areas: "mark name price" ". note note"; align-items: center; gap: 2px 14px; padding: 16px 18px; border: 1.5px solid var(--line-strong); border-radius: var(--r); background: var(--surface); cursor: pointer; transition: border-color .15s, background-color .15s; }
.co-plan:hover { border-color: var(--ink); }
.co-plan__radio { position: absolute; opacity: 0; pointer-events: none; }
.co-plan__mark { grid-area: mark; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--surface); }
.co-plan__name { grid-area: name; font: 700 var(--t-body)/1.25 var(--body); color: var(--ink); }
.co-plan__price { grid-area: price; justify-self: end; font: 800 24px/1.1 var(--display); letter-spacing: -.01em; color: var(--ink); white-space: nowrap; }
.co-plan__unit { margin-left: 2px; font: 600 15px/1 var(--body); letter-spacing: 0; color: var(--ink-3); }
.co-plan__note { grid-area: note; font-size: var(--t-meta); color: var(--ink-3); }
.co-plan:has(:checked) { border-color: var(--ink); background: var(--sun-soft); box-shadow: inset 0 0 0 1px var(--ink); }
.co-plan:has(:checked) .co-plan__mark { border-color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 6px var(--ink); }
.co-plan:has(:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
@container (min-width: 500px) {
  .co-plans { grid-template-columns: 1fr 1fr; }
  .co-plan { grid-template-columns: minmax(0, 1fr) 22px; grid-template-areas: "name mark" "price price" "note note"; align-content: start; gap: 2px 12px; padding: 16px 20px 18px; }
  .co-plan__price { justify-self: start; margin-top: 6px; font-size: 30px; }
}

/* account: the email field, or who is signed in */
.co-signup { display: grid; gap: 16px; }
.co-signup .auth-or { margin-block: 0; }
.co-signup .auth-gnote:empty { display: none; }
.co-who { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 2px 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); }
.co-who__ic { grid-row: span 2; width: 24px; height: 24px; fill: var(--ink); }
.co-who__text { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.co-who__text strong { color: var(--ink); font-weight: 700; }
.co-who__alt { margin: 0; font-size: var(--t-meta); color: var(--ink-3); }
.co-link { display: inline; padding: 0; border: 0; background: none; color: var(--link); font-family: var(--body); font-size: inherit; font-weight: 600; line-height: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.co-link[aria-busy="true"] { cursor: progress; opacity: .6; }
/* State 4, a signup from this device that waits for its email confirmation: the same box, tinted as a notice, with a
   compact resend button and the "Use a different email" link under the text. */
/* Same plain box as "Signed in as": the marigold tint belongs to the selected plan just above (owner, 2026-10-21). */
.co-pending { align-items: start; }
.co-pending .co-who__ic { grid-row: 1 / span 2; margin-top: 1px; color: var(--ink); fill: none; }
.co-pending > :not(.co-who__ic) { grid-column: 2; }
.co-pending__title { margin: 0; font: 700 var(--t-body)/1.3 var(--body); color: var(--ink); }
.co-pending__text { margin: 0; font-size: var(--t-small); line-height: 1.45; color: var(--ink-2); }
.co-pending__text strong { color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.co-pending__act { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin-top: 10px; }
.co-pending__act .co-link { display: inline-flex; align-items: center; min-height: var(--tap); font-size: var(--t-small); }
.co-pending__resend { font-variant-numeric: tabular-nums; }
.co-pending__resend[aria-disabled="true"] { border-color: var(--line); color: var(--ink-3); cursor: default; }
.co-pending__resend[aria-disabled="true"]:hover { background: var(--surface); }
.co-pending__resend[aria-disabled="true"]:active { transform: none; }
.co-pending__resend[aria-busy="true"] { cursor: progress; }
.co-pending__note { margin: 4px 0 0; font-size: var(--t-small); font-weight: 600; color: var(--ink); }
.co-pending__note:empty, .co-pending .auth-error:empty { display: none; }
.co-sec .co-pending .auth-error { margin-top: 4px; }
.co-pending__mail .auth-mail { margin-top: 12px; }

/* payment: the one method, chosen; no card fields */
.co-method { display: grid; grid-template-columns: 22px 24px minmax(0, 1fr); align-items: center; gap: 14px; padding: 16px 18px; border: 1.5px solid var(--ink); border-radius: var(--r); background: var(--surface); }
.co-method__mark { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--surface); box-shadow: inset 0 0 0 6px var(--ink); }
.co-method__ic { width: 24px; height: 24px; fill: var(--ink); }
.co-method__text { display: grid; gap: 2px; min-width: 0; }
.co-method__text b { font-weight: 700; color: var(--ink); }
.co-method__text span { font-size: var(--t-meta); color: var(--ink-3); }

/* The explicit adult affirmation and ordinary pay button. */
.co-act { display: grid; gap: 12px; padding-top: 4px; }
.co-adult { align-items: flex-start; padding-block: 6px; font-size: var(--t-small); line-height: 1.45; cursor: pointer; }
.co-adult input { flex: none; margin: 1px 0 0; }
.co-adult input[aria-invalid=true] { outline: 2px solid var(--bad); outline-offset: 2px; }
.co-pay-error { justify-content: center; }
.co-consent { margin: 0; text-align: center; text-wrap: balance; font-size: var(--t-meta); line-height: 1.45; color: var(--ink-3); }
.co-trust { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; margin: 16px 0 0; padding: 0; font-size: var(--t-meta); color: var(--ink-2); }
.co-trust li + li::before { content: "·"; margin: 0 10px; color: var(--ink-3); }
@media (prefers-reduced-motion: reduce) { .co-hint.is-nudge { animation: none; } }

/* ---------- the order summary ---------- */
.co-sum { grid-column: 2; grid-row: 1; position: sticky; top: 88px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sheet); }
.co-bar { display: none; }
.co-sum__body { display: grid; gap: 16px; padding: 20px; }
.co-sum__art { position: relative; aspect-ratio: 16 / 10; border-radius: var(--r-art); overflow: hidden; background: var(--surface-2); }
.co-sum__art img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.co-badge { position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 6px; background: var(--ink); color: #fff; font: 700 13px/1.3 var(--body); }
.co-badge__ic { width: 14px; height: 14px; fill: currentColor; }
.co-sum__what { display: grid; gap: 2px; }
.co-sum__name { margin: 0; font: 800 21px/1.15 var(--display); letter-spacing: -.01em; color: var(--ink); }
.co-sum__plan { margin: 0; color: var(--ink-2); font-size: 15px; }
.co-sum__incl { list-style: none; margin: 0; padding: 16px 0 0; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.co-sum__incl li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: start; font-size: 15px; line-height: 1.4; color: var(--ink-2); }
.co-sum__incl .ic { width: 22px; height: 22px; color: var(--ink); }
.co-sum__lines { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.co-sum__dl { margin: 0; display: grid; gap: 8px; }
.co-sum__dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 15px; }
.co-sum__dl dt { color: var(--ink-2); }
.co-sum__dl dd { margin: 0; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.co-sum__dl .co-sum__total { padding-top: 10px; border-top: 1px solid var(--line); }
.co-sum__dl .co-sum__total dt { color: var(--ink); font-weight: 700; font-size: var(--t-body); }
.co-sum__dl .co-sum__total dd { font: 800 26px/1 var(--display); letter-spacing: -.01em; }
.co-sum__renew, .co-sum__empty { margin: 0; font-size: var(--t-meta); color: var(--ink-3); }

/* ---------- tablets: two narrower columns ---------- */
@media (max-width: 1023px) {
  .co { padding-inline: 20px; }
  .co__grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; }
  .co-sum__body { padding: 16px; }
}

/* ---------- phones: the summary bar on top, the sheet edge to edge, the pay button stuck to the bottom ---------- */
@media (max-width: 767px) {
  .co { padding: 0 0 8px; }
  .co__grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .co-sum { grid-column: 1; grid-row: 1; position: static; border-width: 0 0 1px; border-radius: 0; }
  .co-bar { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 16px; border: 0; background: none; color: var(--ink); font: 600 var(--t-small)/1.2 var(--body); text-align: left; cursor: pointer; }
  .co-bar:focus-visible { outline-offset: -3px; }
  .co-bar__art { width: 52px; height: 33px; object-fit: cover; border-radius: 6px; }
  .co-bar__text { display: inline-flex; align-items: center; gap: 6px; }
  .co-bar__chev { width: 18px; height: 18px; fill: currentColor; transition: transform .2s; }
  .co-sum.is-open .co-bar__chev { transform: rotate(180deg); }
  .co-bar__total { font: 800 20px/1 var(--display); letter-spacing: -.01em; }
  .co-sum__body { display: none; padding: 4px 16px 20px; }
  .co-sum.is-open .co-sum__body { display: grid; }
  .co-sum__art { aspect-ratio: 16 / 8; }
  .co-form { grid-row: 2; padding: 24px 16px; border-width: 0; border-radius: 0; box-shadow: none; }
  .co-title { margin-bottom: 20px; font-size: 30px; }
  .co-sec { padding: 20px 0 24px; }
  .co-act { position: sticky; bottom: 0; z-index: 5; margin: 0 -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); gap: 10px; background: var(--surface); border-top: 1px solid var(--line); }
  .co-consent { font-size: 13px; }
  .co-trust { margin-top: 16px; }
  .co--closed { padding: 24px 16px 40px; }
}
@media (prefers-reduced-motion: reduce) { .co-bar__chev { transition: none; } }

/* ---------- /checkout/thanks/ ---------- */
.co--thanks { display: grid; justify-items: center; align-items: start; align-content: start; padding-top: 24px; padding-bottom: 32px; }
.co-thanks { width: 100%; max-width: 608px; display: grid; justify-items: center; align-content: start; gap: 16px; text-align: center; padding: 24px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sheet); box-shadow: var(--e1); }
.co-thanks__head { display: flex; justify-content: center; align-items: center; gap: 14px; }
.co-thanks__tally { display: block; width: 76px; height: 76px; object-fit: contain; }
.co-thanks__title { margin: 0; font: 800 clamp(32px, 5vw, 38px)/1.05 var(--display); letter-spacing: -.02em; }
.co-thanks__title:focus { outline: none; }
.co-thanks__lede { margin: 0; max-width: 46ch; color: var(--ink-2); font-size: var(--t-small); line-height: 1.5; }
.co-thanks__list { list-style: none; margin: 0; padding: 14px 16px; width: 100%; display: grid; gap: 12px; text-align: left; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.co-thanks__list li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; padding: 0; font-size: var(--t-small); line-height: 1.45; }
.co-thanks__list .ic { color: var(--ink); }
.co-thanks__list .co-thanks__offer { padding-top: 12px; border-top: 1px solid var(--line); }
.co-thanks__offer b { background: var(--sun-soft); color: var(--ink); box-shadow: 3px 0 0 var(--sun-soft), -3px 0 0 var(--sun-soft); }
.co-thanks__plan { margin: 0; max-width: 54ch; color: var(--ink-3); font-size: var(--t-meta); line-height: 1.45; }
/* QA-1 / owner 2026-10-17: standard .btn (52 px), sized to their words, centred under the text: side by side when they
   fit, stacked (not edge to edge) on phones. The row is a definite width (100%): a column flex container that wraps and
   sizes itself to its content let Safari squeeze the labels onto three lines, so the buttons stood about 85 px tall. */
.co-thanks__actions { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 12px; margin-top: 4px; }
.co-thanks__actions .btn { flex: 0 1 auto; width: auto; max-width: 100%; min-width: 160px; justify-content: center; }
@media (max-width: 767px) {
  .co--thanks { padding: 16px 16px 24px; }
  .co-thanks { padding: 20px 18px; gap: 14px; }
  .co-thanks__head { gap: 10px; }
  .co-thanks__tally { width: 64px; height: 64px; }
  .co-thanks__list { padding: 12px; gap: 10px; }
  .co-thanks__list .co-thanks__offer { padding-top: 10px; }
}

/* a checkout stays calm: no comic backdrop behind the steps (auth.css paints one on the sign-in pages) */
.co-page::before, .co-page::after { display: none; }

/* QA-1 (perf): the footer waits for <main> (hidden until checkout.js has checked the session), so it
   doesn't paint under the header and then jump down the page (CLS). */
.co-page main[hidden] + .auth-foot { display: none; }

/* QA-1: the note when a sign-in link that landed here had expired. */
.co-linknote { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line, #d9d9d6); border-radius: 10px; background: var(--surface-2, #f6f6f4); font-size: 15px; line-height: 1.45; color: var(--ink-2, #3f3f3c); }

/* "Continue to payment · US$9.99" (owner 2026-10-26) stays on one line on phones: the lock icon gives up its room. */
@media (max-width: 420px) { .co-act .co-pay__ic { display: none; } }
