/* The Pro checkout page (/checkout): a payment card beside a "what happens next" timeline
   built from calendar tiles. Stripe draws the card fields and wallet buttons inside its own
   frames (styled from js/checkout.js to match); everything else here is ours. */

.checkout-page { background: #f3f2f7; }
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme="light"])) .checkout-page { background: var(--page); } }
:where(:root[data-theme="dark"]) .checkout-page { background: var(--page); }

.checkout-header { justify-content: space-between; }
.checkout-back { font-weight: 600; color: var(--brand); text-decoration: none; }
.checkout-back:hover { text-decoration: underline; }

.checkout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(32px, 5vw, 72px);
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 28px 20px 72px;
}

/* ---------- the payment card ---------- */

.pay {
  flex: 0 1 460px;
  min-width: 0;
  background: var(--card);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(23, 32, 51, 0.06), 0 40px 80px -30px rgba(23, 32, 51, 0.35);
}

.pay__steps {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 14px 18px 0;
  list-style: none;
}
.pay__steps li { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--slate); }
.pay__steps li::before { content: ""; height: 5px; border-radius: 999px; background: var(--line); }
.pay__steps li.is-done::before,
.pay__steps li.is-current::before { background: var(--brand); }
.pay__steps li.is-current { color: var(--ink); }

.pay__body { display: flex; flex-direction: column; gap: 18px; padding: 22px 32px 30px; }
@media (max-width: 480px) { .pay__body { padding: 20px 20px 26px; } }

.pay__title { margin: 0; font-size: 36px; line-height: 1.02; font-weight: 800; font-stretch: 85%; letter-spacing: -0.015em; color: var(--ink); }

.pay__perks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; color: var(--text); }
.pay__perks li { position: relative; padding-left: 28px; line-height: 1.4; }
.pay__perks li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 4px;
  width: 11px;
  height: 6px;
  border-left: 2.5px solid var(--green);
  border-bottom: 2.5px solid var(--green);
  transform: rotate(-45deg);
}

.pay-plan {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 2px solid var(--brand);
  background: var(--brand-softer);
}
.pay-plan__dot { flex: none; width: 22px; height: 22px; box-sizing: border-box; border-radius: 999px; border: 6px solid var(--brand); background: var(--card); }
.pay-plan__text { flex: 1; min-width: 0; }
.pay-plan__name { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; color: var(--ink); }
.pay-plan__badge { font-size: 12px; font-weight: 700; color: #ffffff; background: var(--brand); border-radius: 999px; padding: 3px 9px; }
.pay-plan__sub { margin: 3px 0 0; font-size: 14px; color: var(--slate); }
.pay-plan__price { margin: 0; display: flex; flex-direction: column; align-items: flex-end; }
.pay-plan__price strong { font-size: 24px; font-weight: 800; font-stretch: 85%; color: var(--ink); }
.pay-plan__price span { font-size: 13px; color: var(--slate); }

.pay__loading { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 120px; color: var(--slate); }
.pay__spinner { width: 20px; height: 20px; border-radius: 999px; border: 3px solid var(--line); border-top-color: var(--brand); animation: pay-spin 0.8s linear infinite; }
@keyframes pay-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pay__spinner { animation-duration: 2.4s; } }

.pay__failed { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px 18px; border-radius: 16px; background: var(--soft); color: var(--text); }
.pay__failed p { margin: 0; }

.pay__fields { display: flex; flex-direction: column; gap: 18px; }
.pay__fields[hidden], .pay__loading[hidden], .pay__failed[hidden], .pay__express[hidden], .pay__error[hidden] { display: none; }

.pay__express { display: flex; flex-direction: column; gap: 16px; }
.pay__or { margin: 0; display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--slate); }
.pay__or::before, .pay__or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.field { display: flex; flex-direction: column; gap: 7px; }
.field__label { font-size: 15px; font-weight: 600; color: var(--ink); }
.field__input {
  height: 48px;
  box-sizing: border-box;
  border-radius: 14px;
  border: 1px solid #d6dae3;
  background: var(--card);
  color: var(--ink);
  padding: 0 16px;
  font: inherit;
  font-size: 16px;
}
.field__input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.field__input[aria-invalid="true"] { border-color: var(--red); }
.field__hint { font-size: 13px; color: var(--slate); }
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme="light"])) .field__input { border-color: #2f3749; } }
:where(:root[data-theme="dark"]) .field__input { border-color: #2f3749; }

.pay__sum { margin: 4px 0 0; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.pay__sum div { display: flex; justify-content: space-between; }
.pay__sum dt { color: var(--slate); }
.pay__sum dd { margin: 0; color: var(--slate); }
.pay__due dt, .pay__due dd { color: var(--ink); font-weight: 700; }

.pay__error { margin: 0; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--red) 10%, var(--card)); color: var(--ink); font-size: 15px; }

.pay__button { height: 56px; font-size: 18px; }
.pay__button[disabled] { opacity: 0.55; cursor: not-allowed; }
.pay__button.is-busy { opacity: 0.8; cursor: progress; }

.pay__legal { margin: 0; font-size: 13px; line-height: 1.45; color: var(--slate); text-align: center; }
.pay__legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.pay__legal a:hover { color: var(--brand); }

/* ---------- what happens next ---------- */

.next { flex: 0 1 440px; min-width: 0; padding-top: 8px; }
.next__title { margin: 0 0 26px; font-size: 22px; font-weight: 800; font-stretch: 88%; color: var(--ink); }
.next__list { margin: 0; padding: 0; list-style: none; }
.next__item { position: relative; display: flex; gap: 18px; padding-bottom: 26px; }
.next__item:last-child { padding-bottom: 0; }
/* the line joining one tile to the next */
.next__item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 28px;
  top: 70px;
  bottom: 2px;
  width: 3px;
  border-radius: 3px;
  background: #c9d4ff;
}
.next__item:first-child::before { background: var(--brand); }
.next__item:has(.next__mark)::before { top: 62px; }
.next__item h3 { margin: 8px 0 4px; font-size: 18px; font-weight: 700; color: var(--ink); }
.next__item p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--text); }

.next__tile {
  flex: none;
  width: 58px;
  height: 64px;
  border-radius: 13px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  color: #12151c;
  box-shadow: 0 4px 0 #12151c, 0 0 0 2px #12151c;
}
.next__tile b { background: var(--red); color: #ffffff; font-size: 11px; letter-spacing: 0.08em; text-align: center; padding: 4px 0 3px; text-transform: uppercase; }
.next__tile > span { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 800; font-stretch: 62%; }
.next__tile--ink { align-items: center; justify-content: center; background: #12151c; color: #ffffff; font-size: 28px; font-weight: 800; font-stretch: 75%; box-shadow: none; }
.next__mark { flex: none; width: 58px; height: 64px; object-fit: contain; }

/* Dark: the device setting unless "light" was chosen with the header button, or "dark" chosen.
   :where() keeps each rule at its old weight. */
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .next__item:not(:last-child)::before { background: #34417a; }
  :where(:root:not([data-theme="light"])) .next__item:first-child::before { background: var(--brand); }
  :where(:root:not([data-theme="light"])) .next__tile--ink { background: #ffffff; color: #12151c; }
}
:where(:root[data-theme="dark"]) .next__item:not(:last-child)::before { background: #34417a; }
:where(:root[data-theme="dark"]) .next__item:first-child::before { background: var(--brand); }
:where(:root[data-theme="dark"]) .next__tile--ink { background: #ffffff; color: #12151c; }

@media (max-width: 960px) {
  .next { flex-basis: 460px; }
}
