/* Checkout: the order on the left, Paddle's payment form on the right (inline, in our own frame).
   Same room as the rest of the site; the form sits on a slightly lifted panel. */
.checkout { width: min(100% - 2 * var(--margin), 1200px); margin: 0 auto; padding: 132px 0 96px;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 96px); align-items: start; }

/* the order */
.order { display: grid; gap: 20px; position: sticky; top: 112px; }
.order .step { color: var(--muted); font-size: var(--step-small); letter-spacing: 0.04em; }
.order h1 { font-size: clamp(2.6rem, 1.4rem + 3vw, 4.2rem); line-height: 0.98; letter-spacing: -0.035em; font-weight: 650; }
.order .what { color: var(--muted); max-width: 40ch; }

/* a cart with beats: its lines, one per row, split by hairlines */
.lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.lines li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.lines li:not(:has(img)) { grid-template-columns: 1fr auto; }
.lines img { width: 40px; height: 40px; object-fit: cover; }
.lines .nm { font-weight: 600; }
.lines .nm small { display: block; color: var(--muted); font-weight: 400; font-size: var(--step-small); }
.lines .pr { font-variant-numeric: tabular-nums; }

.totals { display: grid; gap: 10px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.totals div { display: flex; justify-content: space-between; gap: 16px; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.totals .total { align-items: baseline; }
.totals .total dd { display: grid; justify-items: end; gap: 2px; }
.totals .total small { color: var(--muted); font-size: var(--step-small); font-weight: 400; letter-spacing: 0; font-stretch: 100%; }
.totals .total dt { color: var(--ink); font-weight: 600; }
.totals .total dd { font-size: clamp(1.8rem, 1.3rem + 1.2vw, 2.4rem); font-weight: 650; letter-spacing: -0.02em; font-stretch: 112%; }



/* promo code: a plain field and a button, always visible */
.promo { display: flex; margin-top: 4px; border: 1px solid #2e2a36; background: #1f1c26; transition: border-color 200ms; }
.promo:focus-within { border-color: rgba(255, 255, 255, 0.6); }
.promo input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; background: none; border: 0; color: var(--ink);
  font: inherit; font-size: var(--step-small); letter-spacing: 0.06em; text-transform: uppercase; }
.promo input:focus { outline: none; }
.promo input::placeholder { color: #6e6879; text-transform: none; letter-spacing: 0; }
.promo button { padding: 0 18px; background: none; border: 0; border-left: 1px solid #2e2a36; color: var(--muted); font: inherit; font-size: var(--step-small); font-weight: 600; cursor: pointer; transition: color 200ms; }
.promo button:hover { color: #fff; }
.promo-note { font-size: var(--step-small); color: var(--ink); }
.promo-note.bad { color: #e58a9b; }
.refund-note { margin-top: 12px; font-size: var(--step-small); color: var(--muted); }
.refund-note[hidden] { display: none; }


/* express option above Paddle's form, inset like its fields (13 px inside the frame) */
.express { margin: 0 13px 4px; display: grid; gap: 18px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
.tg-pay { display: flex; align-items: center; justify-content: center; gap: 10px; height: 52px; background: #1f1c26; border: 1px solid #2e2a36;
  color: #efedf3; text-decoration: none; font-size: 16px; font-weight: 600; transition: border-color 200ms, background-color 200ms; }
.tg-pay .tg-icon { width: 20px; height: 20px; flex: none; }
.tg-pay:hover { border-color: rgba(255, 255, 255, 0.6); background: #24202c; }
/* locked like the frame below until the consent box is ticked (checkout.js sets aria-disabled) */
.tg-pay[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.tg-pay[aria-disabled="true"]:hover { border-color: #2e2a36; background: #1f1c26; }
.or { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; color: #6e6879; font-size: 13px; }
.or::before, .or::after { content: ""; height: 1px; background: #2e2a36; }
.pay[data-mode="missing"] .express, .pay[data-mode="error"] .express, .pay[data-mode="empty"] .express,
.pay[data-mode="signin"] .express, .pay[data-mode="email"] .express, .pay[data-mode="gone"] .express { display: none; }
/* the consent box above the payment form (the same look as the sign-up and download consent boxes of the account) */
.pay-consent { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 12px; align-items: start; margin: 0 13px 18px; font-size: 14px; line-height: 1.5; color: #a7a2b3; cursor: pointer;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
.pay-consent input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); color-scheme: dark; cursor: pointer; }
.pay-consent a { color: #efedf3; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, 0.35); }
.pay-consent a:hover { text-decoration-color: currentColor; }
.pay[data-mode="missing"] .pay-consent, .pay[data-mode="error"] .pay-consent, .pay[data-mode="empty"] .pay-consent,
.pay[data-mode="signin"] .pay-consent, .pay[data-mode="email"] .pay-consent, .pay[data-mode="gone"] .pay-consent { display: none; }
/* locked until the box is ticked: the frame cannot be clicked or tabbed into (the `inert` attribute is set by checkout.js) */
.frame-wrap[inert] { opacity: 0.45; }

/* the payment panel: Paddle's frame, or one of our states in its place */
.pay { position: relative; min-height: 520px; background: rgba(23, 21, 28, 0.86); padding: clamp(16px, 2.4vw, 32px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35); }
.checkout-frame { min-height: 450px; }
/* empty cart: just the note and the way back, no order column, no tall panel */
.checkout:has(.order[hidden]) { grid-template-columns: minmax(0, 560px); justify-content: center; }
.pay[data-mode="empty"] { min-height: 0; }
.state { display: grid; gap: 16px; justify-items: start; padding: 24px 8px; }
.state h2 { font-size: clamp(1.6rem, 1.2rem + 1vw, 2.2rem); line-height: 1.05; font-weight: 650; letter-spacing: -0.02em; }
.state p { color: var(--muted); max-width: 44ch; }
.state-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.state.loading { position: absolute; inset: auto 0 50%; justify-items: center; text-align: center; color: var(--muted); }
.state.loading::before { content: ""; width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--ink); animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.done h2::before { content: ""; display: block; width: 44px; height: 2px; margin-bottom: 18px; background: var(--accent); }
.pay[data-mode="error"] .checkout-frame, .pay[data-mode="missing"] .checkout-frame, .pay[data-mode="empty"] .checkout-frame,
.pay[data-mode="signin"] .checkout-frame, .pay[data-mode="email"] .checkout-frame, .pay[data-mode="gone"] .checkout-frame { display: none; }

/* after payment: a dialog over the page */
.done { width: min(460px, calc(100vw - 32px)); padding: 32px; border: 0; background: #17151c; color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.done::backdrop { background: rgba(5, 4, 8, 0.72); }
.done h2 { font-size: clamp(1.6rem, 1.2rem + 1vw, 2.2rem); line-height: 1.05; font-weight: 650; letter-spacing: -0.02em; }
.done p { margin-top: 14px; color: var(--muted); }
.done-actions { display: flex; align-items: center; gap: 20px; margin-top: 26px; }
.done-close { background: none; border: 0; padding: 8px 0; color: var(--muted); font: inherit; cursor: pointer; transition: color 200ms; }
.done-close:hover { color: #fff; }

/* the legal name dialog: the account's dialog (account.css .dialog) with its underlined fields */
.legal { width: min(520px, calc(100vw - 32px)); padding: 28px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 0; background: var(--ground-2); color: var(--ink); font-size: 1rem; }
.legal::backdrop { background: rgba(5, 4, 8, 0.7); }
.legal-title { margin-bottom: 12px; font-size: 1.25rem; line-height: 1.3; font-weight: 650; }
.legal p { color: var(--muted); font-size: 0.875rem; line-height: 1.55; }
.legal .field { margin: 20px 0 0; }
.legal .label { display: block; color: var(--muted); font-size: var(--step-small); }
.legal .input { display: block; width: 100%; min-height: 40px; margin-top: 2px; padding: 0 2px; background: none; border: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.28); border-radius: 0;
  color: var(--ink); font: inherit; transition: border-color 200ms; }
.legal .input:focus, .legal .input:focus-visible { outline: none; border-bottom-color: rgba(255, 255, 255, 0.6); }
.legal .legal-preview { margin-top: 20px; color: var(--ink); font-size: 0.9375rem; overflow-wrap: anywhere; }
.legal .legal-note { margin-top: 12px; }
.legal .legal-error { margin-top: 12px; color: #e0867a; }
.legal [hidden] { display: none; }
.legal-buttons { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.legal .button { min-height: 40px; padding: 0 18px; font-size: 0.9375rem; font-family: inherit; }
.legal .button.quiet { background: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28); transition: background-color 160ms, box-shadow 160ms; }
.legal .button.quiet::before { display: none; }
.legal .button.quiet:hover { background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55); }
.legal .button:disabled { opacity: 0.45; cursor: not-allowed; }
.legal :focus-visible { outline: 2px solid rgba(255, 255, 255, 0.55); outline-offset: 2px; }
.legal .input:focus-visible { outline: none; }

@media (max-width: 900px) {
  .checkout { grid-template-columns: 1fr; padding-top: 104px; gap: 40px; }
  .order { position: static; }
}
@media (max-width: 760px) {
  .legal { padding: 24px 20px; }
  .legal-buttons .button { flex: 1; justify-content: center; }
  .checkout { width: auto; margin: 0 16px; }
  .pay { margin: 0 -16px; padding: 16px 12px; }
  .express { margin-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) { .state.loading::before { animation: none; } }
