/* The inline checkout: the owner's funnel paywall (superwall/components, theme.css) in the funnel's
   own type and tokens. Plan cards, one black wallet button with a quiet "Pay with card" under it,
   the card form inline where no wallet can open, one fine-print row. */
.custom-checkout[hidden] { display: none; }
.checkout-email.custom-mode > h1,
.checkout-email.custom-mode > .lede,
.checkout-email.custom-mode > #safari-way,
.checkout-email.custom-mode > #checkout-email-form,
.checkout-email.custom-mode > .privacy-line { display: none; }
.checkout-email.custom-mode { padding-top: 8px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.custom-checkout {
  display: flex; flex-direction: column; width: 100%;
  padding-bottom: env(safe-area-inset-bottom);
}
.custom-checkout h1 { margin: 6px 0 22px; font-size: 34px; line-height: 1.08; }
.custom-checkout h1 .accent { display: block; color: var(--blue); }
.custom-checkout-sandbox {
  align-self: flex-start; margin: 0 0 6px; padding: 5px 10px; border-radius: 999px;
  background: #fff4e5; color: #8a4b00; font-size: 12px; font-weight: 500; line-height: 1.2;
}

/* Plans: radios dressed as the paywall's cards. */
.custom-checkout-plans {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  min-width: 0; margin: 0 0 20px; padding: 14px 0 0; border: 0;
}
.custom-checkout-plans[data-count='1'] { grid-template-columns: 1fr; }
.custom-checkout-plans[disabled] { opacity: 1; }
.custom-checkout-plan {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  padding: 18px 14px 14px; border: 2px solid #d9e4f2; border-radius: 18px; background: #fff;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform 200ms cubic-bezier(0.23, 1, 0.32, 1), background-color 150ms ease, border-color 150ms ease;
}
.custom-checkout-plan:active { transform: scale(0.97); transition-duration: 80ms; }
.custom-checkout-plan:has(input:checked) { border-color: var(--blue); background: #f1f8ff; }
.custom-checkout-plan:has(input:focus-visible) { outline: 3px solid #075baf; outline-offset: 3px; }
.custom-checkout-plans[disabled] .custom-checkout-plan { cursor: default; }
/* Loading or switching plans: the chosen card's check turns into a small spinner, nothing greys out. */
.custom-checkout[data-state='busy'] .custom-checkout-plan:has(input:checked) .plan-check {
  background: #fff; border-color: #e4f1ff; border-top-color: var(--blue);
  animation: plan-spin 0.8s linear infinite;
}
.custom-checkout[data-state='busy'] .custom-checkout-plan:has(input:checked) .plan-check svg { opacity: 0; }
@keyframes plan-spin { to { transform: rotate(360deg); } }
.custom-checkout-plan.is-placeholder { height: 116px; border-color: #eef1f5; background: #fafbfc; }
.custom-checkout-plan input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.plan-badge {
  position: absolute; top: -12px; left: 12px; padding: 5px 9px; border-radius: 999px;
  background: var(--blue); color: #fff; font-size: 11px; font-weight: 600; line-height: 1; white-space: nowrap;
}
.plan-period { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--lead); }
.plan-price {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; margin: 6px 0 4px;
  font-size: 26px; letter-spacing: -0.03em; line-height: 1.1;
}
.plan-price b { font-weight: 600; font-variant-numeric: tabular-nums; }
.plan-label { font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.plan-was { font-size: 18px; letter-spacing: -0.02em; color: #9aa0a8; }
.plan-note { font-size: 12px; line-height: 1.3; color: var(--muted); }
.plan-check {
  position: absolute; top: 14px; right: 14px; display: grid; place-items: center;
  width: 22px; height: 22px; border: 2px solid #d9e4f2; border-radius: 50%;
}
.plan-check svg { opacity: 0; transition: opacity 150ms ease; }
.custom-checkout-plan:has(input:checked) .plan-check { border-color: var(--blue); background: var(--blue); }
.custom-checkout-plan:has(input:checked) .plan-check svg { opacity: 1; }
/* The offer: one card, the offer page's stamp and price falling from the struck one. */
.custom-checkout-plans.is-offer .custom-checkout-plan { padding: 20px 18px 18px; }
.custom-checkout-plans.is-offer .plan-badge {
  left: auto; right: 14px; top: -10px; padding: 6px 11px; border-radius: 10px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  box-shadow: 0 10px 22px -8px rgb(18 147 255 / 0.7); transform: rotate(-8deg);
}
.custom-checkout-plans.is-offer .plan-price { font-size: 34px; margin: 8px 0 6px; }
.custom-checkout-plans.is-offer .plan-note { font-size: 14px; }
.custom-checkout-plans.is-offer .plan-check { display: none; }

/* Status: shown only for problems (with Try again). While loading or switching it's for screen
   readers only, so nothing below it moves; the spinner in the plan card shows the wait. */
.custom-checkout-status { margin: 0 0 10px; font-size: 14px; text-align: center; color: var(--muted); }
.custom-checkout-status:empty { display: none; }
.custom-checkout[data-state='busy'] .custom-checkout-status {
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* The wallet door: Stripe's black button in a slot of its own height. While Stripe loads it, a
   faint black pill holds the place (where Apple Pay is likely); a switch keeps the old button. */
/* Stripe's currency switch (Adaptive Pricing): only when the shown session offers a choice. */
.custom-checkout-currency { position: relative; margin: 0 0 12px; }
.custom-checkout-currency[hidden] { display: none; }
.custom-checkout-wallets { position: relative; min-height: 55px; }
.custom-checkout-wallets[hidden] { display: none; }
.custom-checkout-wallets::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 55px; border-radius: 999px;
  background: #0c0b11; opacity: 0; transition: opacity 200ms ease;
}
.custom-checkout[data-wallet='pending'][data-wallet-hint='likely'] .custom-checkout-wallets::before {
  opacity: 0.12; animation: checkout-wait 1.4s ease-in-out infinite alternate;
}
@keyframes checkout-wait { to { opacity: 0.05; } }
.custom-checkout[data-wallet='pending'][data-wallet-hint='unlikely'] .custom-checkout-wallets { display: none; }
#custom-checkout-express, #custom-checkout-payment { position: relative; }
/* Plans not shown: laid out (Stripe keeps them ready) under the shown one, but invisible, inert
   and out of the accessibility tree. A switch flips this class; nothing remounts or fades. */
.stripe-host.is-hidden { position: absolute; inset: 0 0 auto; visibility: hidden; pointer-events: none; }
.custom-checkout[data-wallet='no'] .custom-checkout-wallets { display: none; }
.custom-checkout-card-toggle {
  display: none; width: 100%; min-height: 44px; margin: 6px 0 0; padding: 0;
  border: 0; background: none; color: var(--muted); font-size: 16px; font-weight: 500;
}
.custom-checkout-card-toggle:active { opacity: 0.6; }
.custom-checkout[data-wallet='yes']:not(.card-open) .custom-checkout-card-toggle { display: block; }

/* The card door: inline where no wallet can open, under the wallet after "Pay with card". */
.custom-checkout-card { margin: 0 !important; }
.custom-checkout[data-wallet='pending'][data-wallet-hint='likely']:not(.card-open) .custom-checkout-card,
.custom-checkout[data-wallet='yes']:not(.card-open) .custom-checkout-card { display: none; }
.custom-checkout.card-open[data-wallet='yes'] .custom-checkout-card { margin-top: 20px !important; }
.custom-checkout-card label { font-size: 15px; }
/* The email field focuses like Stripe's fields under it. */
.checkout-email .custom-checkout-card input { padding: 16px; }
.checkout-email .custom-checkout-card input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgb(18 147 255 / 0.18); }
/* Reserved at the card fields' height (number, expiry/CVC, country, mandate) so Pay now stays put. */
.custom-checkout-payment { margin-top: 16px; min-height: 310px; }
.custom-checkout .custom-checkout-card .primary { margin-top: 20px; }
.custom-checkout .custom-checkout-card .primary:disabled { opacity: 0.5; }
.custom-checkout[data-state='busy'] :is(.custom-checkout-card .primary, .custom-checkout-card-toggle):disabled { opacity: 1; }

.custom-checkout > .error { margin: 12px 0 0; text-align: center; font-size: 14px; color: #c2362b; }
.custom-checkout-retry {
  width: 100%; min-height: 52px; margin: 14px 0 0; border: 2px solid #d9e4f2; border-radius: 999px;
  background: #fff; color: var(--ink); font-size: 17px; font-weight: 500;
}

/* The fine print: what's due today and what it renews at, then cancel anytime and the terms. */
.custom-checkout-fine {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  margin: 14px 0 8px; font-size: 12px; line-height: 1.45; text-align: center; color: #8b94a3;
}
.custom-checkout-fine:has(.custom-checkout-total:empty) { visibility: hidden; }
.custom-checkout-fine .sep { opacity: 0.7; }
.custom-checkout-fine a { color: inherit; text-underline-offset: 2px; }
.custom-checkout-total { color: var(--ink); font-weight: 500; }

@media (prefers-reduced-motion: reduce) {
  .custom-checkout-wallets::before, .custom-checkout-plan .plan-check { animation: none !important; }
  .custom-checkout-plan { transition: none; }
}

/* Checkout couldn't load or a payment is being checked: only the message and "Try again". */
.custom-checkout:has(#custom-checkout-retry:not([hidden])) :is(.custom-checkout-wallets, .custom-checkout-card-toggle, .custom-checkout-card) {
  display: none !important;
}
