/* =============================================================================================
   checkout-ux2.css — the checkout upgrades (local feature branch feat/checkout-upgrades-local).
   Loaded LAST on checkout.html, after checkout-type.css, so it wins without !important.
   Proposal: https://claude.ai/artifact/StsHsjYMmDvpJn4pbSurfv (23 Oct 2026)

   6 · one look: TT Commons and the customer-kit tokens (house-style, customer mode) instead of the
       Poppins/Shopify parity set (Marko 2026-08-12) — OPEN DECISION, see the proposal.
   2 · the price on a pill Pay button, docked under the thumb on phones.
   4 · per-field checks with the message under the field.
   7 · Mist summary bar with the product; the dead discount field hidden.
   1 · the processing stage (Charcoal, Teal ring, twelve points) and its hand-off into the upsell.
   ============================================================================================= */

/* ---- tokens: house-style customer kit (customer-tokens.css), only what this page uses ---- */
.co2-checkout {
  --qs-charcoal: #212428; --qs-charcoal-50: #8b8c8e; --qs-mist: #f6f6f7; --qs-teal: #c7e5db;
  --qs-teal-ink: #12513f; --qs-promo: #ff5429; --qs-muted: #6d6d6d; --qs-line: #e6e6e6;
  --qs-error: #d0342c; --qs-ease: cubic-bezier(.2, .8, .2, 1);
  --qs-text: "TT Commons", "TT Commons Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --qs-display: Canela, "Canela Fallback", Georgia, serif;
}

/* ---- 6 · type: TT Commons everywhere on the page (the Airwallex card frame gets it via init({fonts})) ---- */
body.up-page.co2-checkout,
body.up-page.co2-checkout input,
body.up-page.co2-checkout select,
body.up-page.co2-checkout button,
body.up-page.co2-checkout textarea { font-family: var(--qs-text); }
/* Bold like today's checkout, so each section reads as its own (Marko 2026-10-27). Today's Poppins 700 / 20px sets
   larger than TT Commons, so the kit's DemiBold at its h4 size (22px) matches it by eye; "Shipping method" stays a step
   smaller, as today. */
.co2-checkout .co2-block h2 { font-family: var(--qs-text); font-size: 22px; line-height: 26px; font-weight: 600; letter-spacing: 0; color: var(--qs-charcoal); }
.co2-checkout .co2-block--sub h2 { font-size: 18px; line-height: 22px; }
.co2-checkout .co2-summary h3 { font-family: var(--qs-text); font-size: 22px; line-height: 26px; font-weight: 500; }
.co2-checkout .co2-header__count { font-weight: 600; }   /* as bold as today's header (Matt 2026-10-26: keep the top Shopify-like) */
.co2-checkout .co2-trust span { font-weight: 500; }

/* fields: 52px, 10px corners, 16px text at every width (customer kit) */
.co2-checkout .co2-fl input,
.co2-checkout .co2-fl select { height: 52px; border-radius: 10px; font-size: 16px; padding: 22px 14px 6px;
  border-color: #d9d9d9; color: var(--qs-charcoal); }
.co2-checkout .co2-fl label { font-size: 16px; left: 15px; color: var(--qs-muted); }
.co2-checkout .co2-fl input:focus ~ label,
.co2-checkout .co2-fl input:not(:placeholder-shown) ~ label,
.co2-checkout .co2-fl select ~ label { top: 8px; font-size: 12px; }
.co2-checkout .co2-fl input:focus,
.co2-checkout .co2-fl select:focus { border-color: var(--qs-charcoal); box-shadow: inset 0 0 0 1px var(--qs-charcoal); }
.co2-checkout .co2-row3,
.co2-checkout .co2-row2 { gap: 10px; margin-bottom: 10px; }
.co2-checkout .co2-fl { margin-bottom: 10px; }

/* ---- 4 · field checks: the message under the field when wrong. No tick when right: Matt (27 Oct huddle),
   "keep it same as Shopify", and Shopify marks only what is wrong. ---- */
@media (max-width: 480px) { .co2-checkout .co2-row3 { grid-template-columns: .85fr 1.35fr 1fr; } }
.co2-checkout .co2-fl.is-invalid :is(input, select) { border-color: var(--qs-error); box-shadow: inset 0 0 0 1px var(--qs-error); }
.co2-checkout .co2-fl.is-invalid label { color: var(--qs-error); }
.qs-ferr { display: flex; gap: 6px; align-items: flex-start; margin: 6px 2px 0; font-size: 14px; line-height: 18px; color: var(--qs-error); animation: qsDrop .22s var(--qs-ease); }
.qs-ferr svg { flex: 0 0 auto; width: 15px; height: 15px; margin-top: 1px; }
.qs-ferr button { margin-left: 4px; padding: 0; border: 0; background: none; color: var(--qs-charcoal); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.qs-cardmsg { display: none; margin: 8px 2px 0; }
.qs-cardmsg.on { display: flex; }
@keyframes qsPop { from { transform: scale(.4); opacity: 0 } to { transform: scale(1); opacity: 1 } }
@keyframes qsDrop { from { transform: translateY(-4px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes qsShake { 0%,100% { transform: none } 20% { transform: translateX(-6px) } 45% { transform: translateX(5px) } 70% { transform: translateX(-3px) } }
.qs-shake { animation: qsShake .36s var(--qs-ease); }

/* ---- 2 · the Pay button: a pill that carries the total, presses, and fills as the progress ---- */
.co2-checkout .co2-paynow {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 9px;
  height: 60px; padding: 0 24px; border-radius: 999px; background: var(--qs-charcoal);
  font: 600 19px/1 var(--qs-text); letter-spacing: 0; font-variant-numeric: tabular-nums; margin-top: 16px;
  -webkit-tap-highlight-color: transparent; transition: transform .09s ease-out, background .2s;
}
.co2-checkout .co2-paynow:active { transform: scale(.97); transition-duration: .04s; }
.co2-checkout .co2-paynow:disabled { opacity: 1; cursor: default; }
.co2-checkout .co2-paynow svg { width: 18px; height: 18px; flex: 0 0 auto; position: relative; }
.co2-checkout .co2-paynow .qs-lbl { position: relative; display: inline-flex; align-items: center; gap: 9px; }
.qs-fill { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(199,229,219,0) 0%, rgba(199,229,219,.34) 100%);
  transform: scaleX(0); transform-origin: left; pointer-events: none; }
.co2-checkout .co2-fineprint { font-size: 14px; color: var(--qs-muted); }
#payErr { font-size: 14px !important; line-height: 19px; color: var(--qs-error) !important; }

/* the dock (phones): one full-width button with the price, under the thumb (house-style customer default) */
.qs-dock { display: none; }
@media (max-width: 900px) {
  .qs-dock {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--qs-line);
    transform: translateY(110%); transition: transform .32s var(--qs-ease); will-change: transform;
  }
  .qs-dock.on { transform: none; }
  .qs-dock .co2-paynow { margin-top: 0; width: 100%; }
  .qs-dock__trust { display: flex; justify-content: center; gap: 16px; margin-top: 7px; font-size: 13px; color: var(--qs-muted); }
  .qs-dock__trust span { display: inline-flex; align-items: center; gap: 5px; }
  .qs-dock__trust svg { width: 14px; height: 14px; }
  body.co2-checkout.qs-docked .co2-footer { padding-bottom: 110px; }
}

/* ---- 3 · express wallets: equal 48px buttons, PayPal full width under them ---- */
.co2-checkout .co2-express { min-height: 48px; }
.co2-checkout .co2-wallet { height: 48px; border-radius: 10px; }
.co2-checkout .co2-express__label { font-size: 14px; color: var(--qs-muted); }
.co2-checkout .co2-or span { font-size: 13px; color: var(--qs-muted); letter-spacing: 0; text-transform: lowercase; }

/* reservation strip (device kept): Mist, Charcoal clock figure */
.co2-checkout .co2-reserve { background: var(--qs-mist); color: var(--qs-charcoal); font-size: 14px; border-radius: 10px; }
.co2-checkout .co2-reserve svg { color: var(--qs-charcoal); }

/* ---- 7 · summary: no dead discount field (the phone bar stays today's "Order summary ▾ $X", Matt 2026-10-26). The panel keeps today's mint
   (rgb(203,228,222) from checkout-type.css) — Marko 2026-10-23: keep the original summary colour. ---- */
.co2-checkout .co2-disc, .co2-checkout #discNote { display: none !important; }
.co2-checkout .co2-savings { color: var(--qs-promo); }
.co2-checkout .co2-trow { color: var(--qs-charcoal); font-size: 15px; }
.co2-checkout .co2-total { color: var(--qs-charcoal); }
/* the totals in DemiBold: 700 is outside the TT Commons the kit carries (customer check), and reads the same here */
.co2-checkout .co2-total, .co2-checkout .co2-sumbar__total, .co2-checkout .co2-recur--sub, .co2-checkout :is(b, strong) { font-weight: 600; }

/* =============================================================================================
   1 · THE PROCESSING STAGE. Built by checkout-stage.js on the Pay tap; the old #processing overlay
   stays in the page as the fallback when the stage script is missing.
   ============================================================================================= */
.qs-stage { position: fixed; inset: 0; z-index: 300; visibility: hidden; pointer-events: none; font-family: var(--qs-text); }
.qs-stage.on { visibility: visible; pointer-events: auto; }
.qs-portal { position: absolute; inset: 0; overflow: hidden; color: #fff;
  background: radial-gradient(120% 70% at 50% 38%, #2c3036 0%, #212428 46%, #181a1d 100%); clip-path: circle(0px at 50% 50%); }
.qs-grid { position: absolute; inset: 0; opacity: 0;
  background-image: radial-gradient(rgba(199,229,219,.10) 1px, transparent 1.4px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(60% 46% at 50% 40%, #000 0%, transparent 100%); mask-image: radial-gradient(60% 46% at 50% 40%, #000 0%, transparent 100%); }
.qs-core { position: absolute; left: 50%; top: 36%; width: 220px; height: 220px; margin: -110px 0 0 -110px; }
@media (min-width: 901px) { .qs-core { top: 38%; width: 250px; height: 250px; margin: -125px 0 0 -125px; } }
.qs-halo { position: absolute; inset: -40px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, rgba(199,229,219,.22) 0%, rgba(199,229,219,0) 62%); }
.qs-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.qs-ring circle { fill: none; }
.qs-ring .trk { stroke: rgba(255,255,255,.08); stroke-width: 1.5; }
.qs-ring .arc { stroke: var(--qs-teal); stroke-width: 2; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(199,229,219,.7)); transition: stroke .3s; }
.qs-ring .scan { stroke: rgba(199,229,219,.35); stroke-width: 1; stroke-dasharray: 2 7; transform-origin: 110px 110px; }
.qs-dots { position: absolute; inset: 0; }
.qs-dots i { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  background: var(--qs-teal); box-shadow: 0 0 12px rgba(199,229,219,.85); opacity: 0; }
.qs-prod { position: absolute; left: 50%; top: 50%; width: 132px; height: 132px; margin: -66px 0 0 -66px; border-radius: 50%; overflow: hidden;
  background: #fff; display: grid; place-items: center; opacity: 0; box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 20px 60px rgba(0,0,0,.45); }
.qs-prod img { width: 112%; height: 112%; object-fit: contain; }
.qs-tick { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; opacity: 0; }
.qs-tick path { fill: none; stroke: var(--qs-charcoal); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; }
.qs-copy { position: absolute; left: 24px; right: 24px; top: calc(36% + 150px); text-align: center; }
@media (min-width: 901px) { .qs-copy { top: calc(38% + 165px); } }
.qs-copy h3 { margin: 0; min-height: 36px; font: 300 30px/1.18 var(--qs-display); letter-spacing: -.01em; color: #fff; }
.qs-copy h3 span { display: inline-block; }
.qs-copy p { margin: 10px 0 0; min-height: 20px; font-size: 15px; line-height: 20px; color: rgba(255,255,255,.62); }
.qs-chk { list-style: none; margin: 26px auto 0; padding: 0; display: flex; flex-direction: column; gap: 12px; width: 260px; text-align: left; }
.qs-chk li { display: flex; align-items: center; gap: 12px; font-size: 15px; line-height: 20px; color: rgba(255,255,255,.46); opacity: 0; transform: translateY(10px); transition: color .25s; }
.qs-chk li.done { color: #fff; }
.qs-chk li.bad { color: #ffb4a9; }
.qs-chk .b { position: relative; width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.22); transition: background .25s, box-shadow .25s; }
.qs-chk .b::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid transparent; border-top-color: var(--qs-teal); opacity: 0; animation: qsSpin .9s linear infinite; }
.qs-chk li.run .b::before { opacity: 1; }
.qs-chk li.done .b { background: var(--qs-teal); box-shadow: none; }
.qs-chk li.bad .b { box-shadow: inset 0 0 0 1.5px #ff8a80; }
.qs-chk .b svg { position: absolute; inset: 5px; width: 12px; height: 12px; opacity: 0; }
.qs-chk li.done .b svg { opacity: 1; }
.qs-chk .b path { fill: none; stroke: var(--qs-teal-ink); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.qs-slow { position: absolute; left: 24px; right: 24px; bottom: calc(40px + env(safe-area-inset-bottom)); text-align: center; font-size: 14px; line-height: 19px; color: rgba(255,255,255,.6); opacity: 0; transition: opacity .4s; }
.qs-slow.on { opacity: 1; }
/* the bank's check (3-D Secure), hosted INSIDE the stage via the Drop-in's authFormContainer */
.qs-bank { position: absolute; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 4; width: min(460px, calc(100% - 20px));
  transform: translate(-50%, 115%); border-radius: 22px; background: #fff; color: var(--qs-charcoal); padding: 14px 14px 16px;
  box-shadow: 0 -10px 50px rgba(0,0,0,.4); transition: transform .5s cubic-bezier(.2,.9,.25,1); }
.qs-stage.bank-on .qs-bank { transform: translate(-50%, 0); }
.qs-stage.bank-on .qs-copy { opacity: .25; }
.qs-stage.bank-on .qs-core { transform: translateY(-70px) scale(.72); }
.qs-core, .qs-copy { transition: transform .5s var(--qs-ease), opacity .3s; }
.qs-bank__h { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; font-size: 14px; color: var(--qs-muted); }
.qs-bank__h svg { width: 15px; height: 15px; }
#qsBankFrame { min-height: 360px; max-height: 70vh; overflow: auto; border-radius: 12px; }
#qsBankFrame iframe { display: block; width: 100% !important; min-height: 360px; border: 0; }
@keyframes qsSpin { to { transform: rotate(360deg) } }

/* ---- the WHITE stage (default since 27 Oct; checkout-stage.js adds .qs-stage--white unless ?stage=motion) ----
   Production's overlay with a little motion (Marko: "vanilla, motioned a bit, a clear transition"): the same white
   veil, 46px spinner and "Processing your order…", a fade in, the spinner turning into a Teal tick, a fade out.
   Everything else on the stage (ring, kit, orbiting points, step list) is the motion look's and stays hidden. */
.qs-stage--white .qs-portal { background: rgba(255,255,255,.96); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); color: var(--qs-charcoal); clip-path: none; }
.qs-stage--white .qs-grid, .qs-stage--white .qs-halo, .qs-stage--white .qs-dots, .qs-stage--white .qs-ring,
.qs-stage--white .qs-prod, .qs-stage--white .qs-chk { display: none; }
.qs-stage--white .qs-core, .qs-stage--white.qs-stage .qs-core { top: 42%; width: 64px; height: 64px; margin: -32px 0 0 -32px; }
.qs-stage--white .qs-core::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; border: 3px solid #e7e8e9;
  border-top-color: var(--qs-charcoal); animation: qsSpin .8s linear infinite; transition: opacity .2s, transform .2s; }
.qs-stage--white.qs-done .qs-core::before { opacity: 0; transform: scale(.6); }
.qs-stage--white .qs-tick { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
.qs-stage--white .qs-copy { top: calc(42% + 52px); }
.qs-stage--white .qs-copy h3 { font-size: 26px; color: var(--qs-charcoal); }
.qs-stage--white .qs-copy p { margin-top: 8px; color: var(--qs-muted); }
.qs-stage--white .qs-slow { color: var(--qs-muted); }
.qs-stage--white .qs-bank { box-shadow: 0 -6px 40px rgba(33,36,40,.14), 0 0 0 1px var(--qs-line, #e6e6e6); }
@media (min-width: 901px) { .qs-stage--white .qs-core { top: 42%; width: 64px; height: 64px; margin: -32px 0 0 -32px; } .qs-stage--white .qs-copy { top: calc(42% + 52px); } }
@media (prefers-reduced-motion: reduce) { .qs-stage--white .qs-core::before { animation-duration: 2.4s; } }

/* the hand-off: the whole stage becomes the upsell's top bar (cross-document View Transitions;
   upsell.css carries the other half). Browsers without them simply load the next page. */
@view-transition { navigation: auto; }
.qs-stage.handoff .qs-portal { view-transition-name: qstage; }
::view-transition-group(qstage) { animation-duration: .56s; animation-timing-function: cubic-bezier(.65, 0, .25, 1); }
::view-transition-old(qstage) { animation: none; opacity: 1; object-fit: cover; object-position: top; height: 100%; }
::view-transition-new(qstage) { animation: qsVtIn .56s cubic-bezier(.65, 0, .25, 1) both; height: 100%; object-fit: cover; object-position: top; }
@keyframes qsVtIn { 0%, 60% { opacity: 0 } 100% { opacity: 1 } }

@media (prefers-reduced-motion: reduce) {
  .qs-chk .b::before { animation: none; }
  .qs-dock, .qs-core, .qs-copy, .qs-bank { transition: none; }
  ::view-transition-group(qstage), ::view-transition-new(qstage) { animation-duration: .01s; }
}
