/* SDR checkout and order pages. Loaded after site.css and marketing.css, so the
 * header, footer, type, buttons, cards, inputs, focus rings and the light and
 * dark palettes all come from the site. This file only adds what the buying
 * flow needs: the two-column layout, selectable payment cards, the Lightning
 * step, the receipt, and the invoice sheet.
 *
 * Contrast: every colour here is a marketing.css token, so the AA checks on
 * that palette cover this file. The invoice sheet and the QR frame are paper
 * on purpose (fixed #fff and #111) in both modes, because they are documents
 * and a scan target.
 */

.co { padding-block: clamp(1.5rem, 4vw, 3rem) clamp(2.5rem, 6vw, 4.5rem); }
.co-narrow { max-width: 40rem; margin-inline: auto; }
.co-wide { max-width: 56rem; margin-inline: auto; }
.co .co-title { font-size: clamp(1.75rem, 4.2vw, 2.4rem); line-height: 1.15; margin: 0 0 0.6rem; }
.co .co-lede { font-size: 1.1rem; color: var(--muted); max-width: 52ch; margin: 0 0 1.4rem; }
.co .co-center { text-align: center; max-width: none; }
.co .co-center .co-lede, .co .co-center p { margin-inline: auto; }
.co-order-id { display: inline-block; margin: 0 0 0.6rem; padding: 0.2rem 0.8rem; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); font: 600 0.9rem var(--sans); color: var(--muted); letter-spacing: 0.02em; }
.co-order-id:empty { display: none; }

/* States */
.co-loading { padding: 3rem 0; text-align: center; color: var(--muted); }

/* Catalog */
.co-skus { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 28rem); justify-content: center; margin-top: 1.5rem; }
.co-sku { display: flex; flex-direction: column; text-align: left; }
.co-sku h2 { margin: 0 0 0.3rem; }
.co-sku .co-price { margin-bottom: 0.6rem; }
.co-sku .checks { margin-block: 0.8rem 1.4rem; }
.co-sku .btn { align-self: flex-start; }

.co-price { font: 700 2.2rem/1.1 var(--serif); margin: 0.4rem 0 0.2rem; color: var(--ink); }
.co-price small { font: 500 1rem var(--sans); color: var(--muted); }

/* Form layout: form on the left, the product summary on the right */
.co-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.co-summary { position: sticky; top: 1rem; padding: 1.2rem 1.2rem 1.3rem; }
.co-summary .device { max-width: 100%; margin-bottom: 0.4rem; }
.co-summary .device figcaption { display: none; }
.co-summary h2 { font-size: 1.4rem; margin: 0.8rem 0 0.1rem; }
.co-summary .co-price { margin-top: 0.2rem; }
.co-summary .checks { margin: 0.9rem 0 0.9rem; gap: 0.45rem; font-size: 0.98rem; }
.co-summary .co-ship { margin: 0.5rem 0 0; font-weight: 600; }
.co-summary .co-total-note { margin: 0.6rem 0 0; padding-top: 0.6rem; border-top: 1px solid var(--line); font-size: 0.98rem; color: var(--muted); }
.co-summary .co-total-note b { color: var(--ink); }
@media (max-width: 899px) {
  .co-layout { grid-template-columns: minmax(0, 1fr); }
  .co-summary { position: static; order: -1; display: grid; grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr); gap: 0 1rem; align-items: start; }
  .co-summary .device { grid-row: 1 / span 3; margin: 0; }
  .co-summary > * { grid-column: 2; }
  .co-summary .device { grid-column: 1; }
  .co-summary h2 { margin-top: 0; }
  .co-summary .checks, .co-summary .co-total-note { grid-column: 1 / -1; }
}
@media (max-width: 479px) {
  .co-summary { grid-template-columns: minmax(0, 6.5rem) minmax(0, 1fr); }
  .co-summary .co-price { font-size: 1.7rem; }
}

.co-form { max-width: none; gap: 1.4rem; }
.co-section { padding: 1.3rem 1.3rem 1.4rem; display: grid; gap: 1.1rem; }
.co-section > h2 { font-size: 1.3rem; margin: 0; }
.co-section .field .hint { margin: 0; }
.form .co-radio { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; padding: 0; margin: 0; border: 0; }
.co-form input[readonly] { background: var(--tint); }
.co-form .field-err, .co-field-err { color: var(--danger); font-weight: 600; font-size: 0.95rem; margin: 0; }
.co-field-err:empty, .co-alert:empty { display: none; }
.co-opt-label { font-weight: 400; color: var(--muted); }
.co-req-note { margin: 0; }

/* Alerts: the site's error styling, kept in the DOM so assistive tech announces the text */
.co-alert { background: var(--alert-bg); border: 1.5px solid var(--danger); color: var(--alert-ink); border-radius: 10px; padding: 0.8rem 1rem; margin: 0; font-weight: 600; font-size: 0.98rem; line-height: 1.5; }
.co-alert-slot:not(:empty) { background: var(--alert-bg); border: 1.5px solid var(--danger); color: var(--alert-ink); border-radius: 10px; padding: 0.8rem 1rem; margin: 0; font-weight: 600; font-size: 0.98rem; line-height: 1.5; }
.co-alert-slot:empty { padding: 0; border: 0; margin: 0; min-height: 0; }

/* Callout, same look as the site's foundation box */
.co-callout { margin: 0 0 1rem; text-align: left; }
.co-callout p { margin: 0 0 0.6rem; max-width: none; }
.co-callout input { width: 100%; min-height: 48px; padding: 0.6rem 0.8rem; font: 400 0.95rem ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--ink); background: var(--surface); border: 1.5px solid var(--field-line); border-radius: 10px; }
.co-callout input:focus { border-color: var(--focus); outline: 3px solid var(--focus); outline-offset: 1px; }
.co-callout .co-actions { margin-top: 0.7rem; }

/* Payment choices: selectable cards. The radio stays focusable; the card shows the ring. */
.co-pay { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 0.75rem; }
.co-pay > legend { padding: 0; font: 600 1.3rem/1.2 var(--serif); margin: 0 0 0.8rem; float: left; width: 100%; }
.co-pay > legend + * { clear: both; }
.co-opts { display: grid; gap: 0.75rem; }
.co-opt { position: relative; display: block; cursor: pointer; margin: 0; }
.co-opt[hidden] { display: none !important; }
.co-opt-body { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); gap: 0.2rem 0.85rem; align-items: start; min-height: 44px; padding: 1rem 1.1rem; background: var(--surface); border: 1.5px solid var(--field-line); border-radius: 14px; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s; }
.co-opt:hover .co-opt-body { border-color: var(--btn); }
.co-opt-mark { grid-row: 1 / span 2; width: 1.3rem; height: 1.3rem; margin-top: 0.15rem; border: 2px solid var(--field-line); border-radius: 50%; background: var(--surface); position: relative; }
.co-opt .t { font: 700 1.1rem/1.3 var(--sans); color: var(--ink); }
.co-opt .d { grid-column: 2; font-size: 0.97rem; color: var(--muted); line-height: 1.45; }
.co-radio:checked + .co-opt-body { border-color: var(--btn); background: var(--tint); box-shadow: inset 0 0 0 1.5px var(--btn); }
.co-radio:checked + .co-opt-body .co-opt-mark { border-color: var(--btn); }
.co-radio:checked + .co-opt-body .co-opt-mark::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--btn); }
.co-radio:focus-visible + .co-opt-body { outline: 3px solid var(--focus); outline-offset: 3px; }
/* Bitcoin is the smallest option and sits last */
.co-opt--small .co-opt-body { padding: 0.65rem 1rem; border-radius: 12px; }
.co-opt--small .t { font-size: 1rem; font-weight: 600; }
.co-opt--small .d { font-size: 0.9rem; }
.co-opt--small .co-opt-mark { width: 1.1rem; height: 1.1rem; margin-top: 0.2rem; }
.co-opts + .co-opts { margin-top: 0; }
.co-sub { border: 0; margin: 0 0 0 1.5rem; padding: 0; display: grid; gap: 0.6rem; min-width: 0; }
.co-sub > legend { font-weight: 600; font-size: 0.98rem; padding: 0; margin: 0 0 0.4rem; }
.co-sub[hidden] { display: none !important; }

/* NDIS block, opens under the invoice choice */
.co-ndis { margin: 0 0 0 1.5rem; padding: 1.1rem 1.2rem 1.2rem; border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper); display: grid; gap: 1rem; }
.co-ndis[hidden] { display: none !important; }
.co-ndis h3 { margin: 0; font-size: 1.15rem; }
.co-ndis .hint { margin: 0; }
.co-ndis .co-stop { margin: 0; }
.co-ndis .co-stop a { color: inherit; font-weight: 700; }
.co-ndis-fields { display: grid; gap: 1rem; }
.co-ndis-fields[hidden], .co-ndis [hidden] { display: none !important; }
@media (max-width: 479px) { .co-ndis, .co-sub { margin-left: 0; } .co-ndis { padding: 1rem; } }

.co-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }
.co-actions--center { justify-content: center; }
.co .co-mt { margin-top: 1.2rem; }
.co-form .btn { min-width: 0; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn[hidden] { display: none !important; }
.co-linkbtn { appearance: none; background: none; border: 0; padding: 0.6rem 0.4rem; min-height: 44px; font: 600 1rem var(--sans); color: var(--link); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; border-radius: 8px; }
.co-linkbtn:hover { color: var(--btn-hover); text-decoration-thickness: 2px; }
.co-linkbtn[hidden] { display: none !important; }

/* Pay steps (Lightning, card) */
.co-step { text-align: center; padding: 1.6rem 1.4rem 1.5rem; }
.co-step .co-title { margin-top: 0.2rem; }
.co-step .co-callout { max-width: 34rem; margin-inline: auto; }
.co-step .co-callout p { text-align: left; }
.co-kicker { display: inline-block; margin: 0 0 0.3rem; font: 700 0.85rem var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.co-kicker[hidden] { display: none !important; }
.co-qr { width: min(100%, 18.5rem); margin: 1.2rem auto 1rem; padding: 0.9rem; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; color: #111; }
.co-qr svg, .co-qr img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; }
.co-qr p { margin: 0; color: #444; font-size: 0.95rem; }
.co-amount { font: 700 1.5rem/1.2 var(--serif); margin: 0.5rem 0; }
.co-amount small { font: 500 1rem var(--sans); color: var(--muted); margin-left: 0.3em; }
.co-amount .btc { display: block; font: 500 0.95rem var(--sans); color: var(--muted); margin-top: 0.2rem; }
.co-amount .btc[hidden] { display: none !important; }
.co-bolt { display: block; width: 100%; min-height: 48px; margin: 0.8rem 0 0; padding: 0.7rem 0.9rem; text-align: left; font: 400 0.82rem/1.4 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--ink); background: var(--tint); border: 1.5px solid var(--field-line); border-radius: 10px; word-break: break-all; overflow-wrap: anywhere; cursor: pointer; max-height: 7.5rem; overflow: auto; }
.co-bolt:hover { border-color: var(--btn); }
.co-bolt:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.co-status { margin: 1.1rem 0 0; display: flex; align-items: center; justify-content: center; gap: 0.6rem; color: var(--muted); font-size: 1rem; }
.co-status:empty { display: none; }
.co-dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--orange); flex: none; animation: co-pulse 1.4s ease-in-out infinite; }
.co-dot.ok { background: var(--btn); animation: none; }
.co-dot.err { background: var(--danger); animation: none; }
.co-dot.seen { background: var(--blue); animation: none; }
@keyframes co-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
.co-meta { margin: 0.9rem 0 0; color: var(--muted); font-size: 0.97rem; }
.co-meta:empty { display: none; }
.co-card-container { min-height: 96px; margin: 1.2rem 0 0; text-align: left; }
.co-note { margin: 1.1rem auto 0; max-width: 34rem; color: var(--muted); font-size: 0.95rem; }
.co-step .co-alert-slot { margin-top: 0.8rem; text-align: left; }

/* Success and ended */
.co-success { text-align: center; padding: 2rem 1.4rem 1.6rem; border-color: var(--btn); }
.co-tick { width: 4rem; height: 4rem; margin: 0 auto 1rem; border-radius: 50%; display: grid; place-items: center; background: var(--btn); color: var(--btn-text); }
.co-tick svg { width: 2rem; height: 2rem; }
.co-success p { margin-inline: auto; }
.co-receipt { text-align: left; margin: 1.4rem 0 0; padding: 1rem 1.1rem; background: var(--tint); border: 1.5px solid var(--line); border-radius: 12px; font-size: 0.98rem; }
.co-receipt h2 { font-size: 1.15rem; margin: 0 0 0.5rem; }
.co-receipt h2[hidden] { display: none !important; }
.co-receipt dl { margin: 0; display: grid; gap: 0.5rem; }
.co-receipt dl > div { display: grid; grid-template-columns: minmax(7rem, 10rem) minmax(0, 1fr); gap: 0.2rem 1rem; }
.co-receipt dl > div[hidden] { display: none !important; }
.co-receipt dt { font-weight: 700; }
.co-receipt dd { margin: 0; overflow-wrap: anywhere; word-break: break-word; }
.co-receipt .co-tracking dd { font-weight: 700; }
@media (max-width: 479px) { .co-receipt dl > div { grid-template-columns: minmax(0, 1fr); } }
.co-ended { text-align: center; padding: 2rem 1.4rem; }
.co-ended p { margin-inline: auto; }

/* Order status page: invoice, quote */
.co-toolbar { margin-bottom: 1.2rem; }
.co-toolbar .foundation { max-width: none; margin-bottom: 1rem; }
.co-toolbar .foundation input { margin-top: 0.3rem; }
.co-status-note { max-width: none; }
.inv-sheet { background: #fff; color: #111; border: 1.5px solid var(--line); border-radius: 8px; padding: 2rem 2rem 1.5rem; max-width: 56rem; margin: 0 auto; font-size: 1rem; line-height: 1.5; box-shadow: 0 10px 28px var(--shadow); }
.co .inv-sheet h1, .co .inv-sheet h2 { font-family: var(--serif); color: #111; letter-spacing: 0; text-wrap: balance; }
.co .inv-sheet h1 { font-size: 1.7rem; font-weight: 700; margin: 0 0 0.2rem; line-height: 1.2; }
.co .inv-sheet h2 { font: 700 0.8rem var(--sans); text-transform: uppercase; letter-spacing: 0.08em; color: #444; margin: 0 0 0.25rem; }
.co .inv-sheet p { margin: 0; max-width: none; color: #111; }
.inv-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem 2rem; margin-top: 1.2rem; }
@media (max-width: 560px) { .inv-grid { grid-template-columns: minmax(0, 1fr); } .inv-sheet { padding: 1.3rem 1.1rem; } }
.inv-sheet table { width: 100%; border-collapse: collapse; margin-top: 1.4rem; }
.inv-sheet th { text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: #444; border-bottom: 2px solid #111; padding: 0.4rem 0.3rem; }
.inv-sheet td { padding: 0.6rem 0.3rem; border-bottom: 1px solid #ccc; vertical-align: top; color: #111; }
.inv-sheet .num { text-align: right; white-space: nowrap; }
.inv-sheet ul.contents { margin: 0.2rem 0 0 1.1rem; padding: 0; font-size: 0.92rem; color: #333; }
.inv-total { margin-top: 1rem; text-align: right; font-size: 1.1rem; font-weight: 700; color: #111; }
.co .inv-terms { margin-top: 1.4rem; padding-top: 0.8rem; border-top: 1px solid #111; overflow-wrap: anywhere; }
.co .inv-foot { margin-top: 1.2rem; padding-top: 0.7rem; border-top: 1px solid #ccc; font-size: 0.86rem; color: #333; }

@media print {
  @page { size: A4; margin: 14mm; }
  body.m { background: #fff; color: #000; font-size: 10.5pt; line-height: 1.4; }
  .co { padding: 0; }
  .co .wrap { padding: 0; max-width: none; }
  .co-narrow, .co-wide { max-width: none; }
  .co-success { border: 0; padding: 0; background: #fff; }
  #success-panel, #success-panel * { color: #000 !important; background: transparent !important; }
  #success-panel .co-tick { display: none; }
  .co-receipt { border: 1px solid #000; border-radius: 0; }
  #state-invoice { margin: 0; }
  .inv-sheet { box-shadow: none; border: 0; border-radius: 0; padding: 0; max-width: none; font-size: 10.5pt; }
  .inv-sheet table, .inv-terms, .inv-foot, .inv-grid { break-inside: avoid; }
}

/* Headings take focus when a step changes; they are not controls, so no ring */
.co h1[tabindex="-1"]:focus, .co h2[tabindex="-1"]:focus { outline: none; }
