/*
 * checkout.css — /checkout/ and /checkout/success/.
 *
 * Our order summary beside Paddle's inline payment form (owner decision,
 * 2026-09-28). Everything here is built from tokens.css, so the page follows
 * the light/dark theme like the rest of the site.
 */

/* The checkout header: no main navigation, a secure-checkout label instead. */
.checkout-secure {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-inline-start: auto;
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  color: var(--ink-secondary);
}

.checkout-secure svg {
  width: 16px;
  height: 16px;
  color: #1a7f4b;
}

.checkout-section {
  padding-block: var(--space-7);
}

.checkout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-7);
  align-items: start;
}

@media (min-width: 960px) {
  .checkout {
    grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  }
}

.checkout__summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.checkout__summary h1 {
  margin: 0;
}

.checkout__summary .lede {
  margin: calc(var(--space-4) * -1) 0 0;
}

.checkout__back {
  font-size: var(--text-caption);
  text-decoration: none;
}

.checkout-card {
  background: var(--surface);
  border: var(--hairline) solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
}

.checkout-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 var(--space-5);
}

.checkout-users {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.checkout-users__label {
  margin: 0;
  font-weight: var(--weight-semibold);
}

.checkout-users__hint {
  margin: var(--space-1) 0 0;
  font-size: var(--text-caption);
  color: var(--ink-muted);
}

.stepper {
  display: inline-flex;
  align-items: center;
  border: var(--hairline) solid var(--rule-strong);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.stepper__button {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 20px;
  cursor: pointer;
}

.stepper__button:disabled {
  color: var(--ink-muted);
  cursor: not-allowed;
}

.stepper__value {
  min-width: 40px;
  text-align: center;
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}

.checkout-totals {
  margin: var(--space-5) 0 0;
  padding-block-start: var(--space-4);
  border-block-start: var(--hairline) solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.checkout-totals__row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
}

.checkout-totals__row[hidden] {
  display: none;
}

.checkout-totals__row dt {
  color: var(--ink-secondary);
}

.checkout-totals__row dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  text-align: end;
}

.checkout-totals__row--total {
  padding-block-start: var(--space-3);
  border-block-start: var(--hairline) solid var(--rule);
  font-size: var(--text-body-lg);
  font-weight: var(--weight-bold);
}

.checkout-totals__row--total dt {
  color: var(--ink);
}

.checkout-renews {
  margin: var(--space-3) 0 0;
  font-size: var(--text-caption);
  color: var(--ink-muted);
}

.checkout-points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  font-size: 14px;
  color: var(--ink-secondary);
}

.checkout-points li {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.checkout-points svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--accent-fill);
  margin-block-start: 2px;
}

.checkout-pay {
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.checkout-pay__title {
  margin: 0;
  padding: var(--space-4) var(--space-5);
  border-block-end: var(--hairline) solid var(--rule);
  font-size: var(--text-card-title);
  font-weight: var(--weight-semibold);
}

.checkout-pay__frame {
  padding: var(--space-4) var(--space-5) 0;
  min-height: 460px;
}

.checkout-pay__status {
  margin: var(--space-4) 0;
  font-size: 14px;
  color: var(--ink-secondary);
}

.checkout-pay__status--error {
  color: var(--warning-text);
}

.checkout-pay > .checkout-pay__status {
  padding-inline: var(--space-5);
}

.checkout-pay__terms {
  margin: 0;
  padding: var(--space-3) var(--space-5) var(--space-4);
  font-size: var(--text-caption);
  color: var(--ink-muted);
  text-align: center;
}

.checkout-pay__trust {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-4) var(--space-5);
  background: var(--surface-sunken);
  border-block-start: var(--hairline) solid var(--rule);
}

.checkout-pay__trust svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #1a7f4b;
}

.checkout-pay__trust p {
  margin: 0;
  font-size: var(--text-caption);
  line-height: var(--leading-normal);
  color: var(--ink-secondary);
}

.checkout-pay__trust strong {
  color: var(--ink);
}

/* /checkout/success/ */
.checkout-done {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.checkout-done__head {
  display: flex;
  gap: var(--space-4);
  align-items: center;
}

.checkout-done__head h1 {
  margin: 0;
}

.checkout-done__head .lede {
  margin: var(--space-1) 0 0;
}

.checkout-done__mark {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e3f4ea;
  color: #1a7f4b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.checkout-done__mark svg {
  width: 28px;
  height: 28px;
}

.checkout-done__title {
  margin: 0 0 var(--space-4);
  font-size: var(--text-card-title);
}

.checkout-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.checkout-steps li {
  display: flex;
  gap: var(--space-3);
}

.checkout-steps p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-secondary);
}

.checkout-steps .checkout-steps__title {
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  color: var(--ink);
  margin-block-end: var(--space-1);
}

.checkout-steps__number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-wash);
  color: var(--accent);
  font-weight: var(--weight-bold);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.checkout-done .button-row {
  margin-block-start: 0;
}

/* Dark: the success mark on the dark surface. */
:root[data-theme='dark'] .checkout-done__mark {
  background: #143524;
  color: #5fd08f;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme='light'])) .checkout-done__mark {
    background: #143524;
    color: #5fd08f;
  }
}

/* The period switch: the "2 months free" badge stays on one line. */
.checkout-toggle .billing-toggle__option {
  white-space: nowrap;
}

/* Narrow screens: the lock alone says "secure", so the header fits one line. */
@media (max-width: 560px) {
  .checkout-secure span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .checkout-toggle .billing-toggle__badge {
    display: none;
  }
}
