:root {
  --checkout-blue: #2563eb;
  --checkout-blue-dark: #1d4ed8;
  --checkout-green: #15803d;
  --checkout-green-soft: #f0fdf4;
  --checkout-gold: #d4af37;
  --checkout-ink: #111827;
  --checkout-muted: #64748b;
  --checkout-line: #e2e8f0;
  --checkout-bg: #f8fafc;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body.checkout-page {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 50% -10%, rgba(37, 99, 235, .12), transparent 32rem),
    var(--checkout-bg);
  color: var(--checkout-ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.checkout-nav {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 7px 16px;
  border-bottom: 1px solid rgba(226, 232, 240, .9);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
}
.checkout-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  text-decoration: none;
}
.checkout-brand img {
  display: block;
  width: auto;
  max-width: 150px;
  max-height: 26px;
}
.checkout-nav-link {
  color: #475569;
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
}

.checkout-shell {
  width: min(620px, 100%);
  margin: 0 auto;
  padding: 16px 12px 40px;
}
.checkout-hero {
  margin: 0 auto 12px;
  padding: 14px 16px;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  background:
    radial-gradient(circle at 90% 10%, rgba(14, 165, 233, .12), transparent 12rem),
    white;
  box-shadow: 0 12px 36px rgba(15, 23, 42, .06);
}
.checkout-hero h1 {
  margin: 0;
  color: #030712;
  font-size: clamp(1.55rem, 6vw, 2.35rem);
  font-weight: 950;
  line-height: 1.04;
  letter-spacing: -.055em;
  text-align: center;
  text-transform: uppercase;
}
.checkout-hero h1 > span { display: block; }
.checkout-hero h1 strong { color: var(--checkout-blue); }
.checkout-hero h1 em {
  display: inline-block;
  margin-top: 5px;
  padding: 4px 12px 6px;
  border-radius: 12px;
  background: linear-gradient(100deg, #6366f1, #06b6d4);
  color: white;
  font-style: normal;
}
.checkout-benefits {
  display: grid;
  width: fit-content;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 16px auto 2px;
  padding: 0;
  list-style: none;
}
.checkout-benefits li {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  color: #1e293b;
  font-size: 1rem;
  font-weight: 750;
}
.benefit-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 11px;
  background: var(--benefit-color);
  color: white;
}
.benefit-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* The payment step needs every pixel once Stripe's form is mounted. */
body.is-paying .checkout-hero { display: none; }

.checkout-card {
  border: 1px solid var(--checkout-line);
  border-radius: 20px;
  background: white;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .08);
}
.checkout-step {
  padding: 16px;
}
.checkout-step[hidden] { display: none !important; }
.checkout-step-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.checkout-step-title {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.checkout-step-label {
  color: var(--checkout-muted);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.billing-toggle {
  display: flex;
  width: 100%;
  margin: 0 auto 10px;
  padding: 3px;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--checkout-line);
  border-radius: 12px;
  background: #f1f5f9;
}
.billing-toggle button {
  min-height: 34px;
  min-width: 0;
  flex: 1 1 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #475569;
  font: inherit;
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
}
.billing-toggle button[aria-pressed="true"] {
  background: white;
  color: var(--checkout-blue-dark);
  box-shadow: 0 3px 10px rgba(15, 23, 42, .1);
}
.billing-save {
  display: block;
  margin-top: 1px;
  color: #15803d;
  font-size: .56rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .015em;
}
.sale-badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 9px;
  background: linear-gradient(135deg, #fb7185, #f97316);
  color: white;
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .045em;
  line-height: 1.15;
  text-transform: uppercase;
  white-space: nowrap;
}

.plan-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.plan-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 12px;
  border: 2px solid var(--checkout-line);
  border-radius: 14px;
  background: white;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.plan-option[hidden] { display: none !important; }
.plan-option:hover { border-color: #93c5fd; }
.plan-option.is-selected {
  border-color: var(--checkout-green);
  background: var(--checkout-green-soft);
  box-shadow: 0 0 0 3px rgba(21, 128, 61, .11);
}
.plan-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.plan-main {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
  gap: 2px;
}
.plan-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -.01em;
}
.plan-crown {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, #fff7cc, #fbbf24);
  box-shadow: 0 5px 12px rgba(217, 119, 6, .22);
  color: #a16207;
}
.plan-crown svg {
  width: 17px;
  height: 17px;
  fill: #f59e0b;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.plan-badge {
  padding: 3px 7px;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--checkout-blue-dark);
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.plan-meta {
  color: var(--checkout-muted);
  font-size: .74rem;
}
.plan-meta-included {
  color: #15803d;
  font-weight: 700;
}
.plan-billed {
  color: #94a3b8;
  font-size: .68rem;
}
.plan-cost {
  display: flex;
  flex: 0 0 auto;
  align-items: baseline;
  gap: 4px;
  text-align: right;
}
.plan-list-price {
  color: #94a3b8;
  font-size: .78rem;
  font-weight: 700;
  text-decoration: line-through;
}
.plan-price {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -.035em;
}
.plan-unit {
  color: var(--checkout-muted);
  font-size: .72rem;
  font-weight: 700;
}
.plan-check {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  color: transparent;
  font-size: .72rem;
}
.is-selected .plan-check,
.is-current .plan-check {
  border-color: var(--checkout-green);
  background: var(--checkout-green);
  color: white;
}
.plan-option.is-current {
  border-color: var(--checkout-green);
  background: var(--checkout-green-soft);
  cursor: default;
}
.checkout-google { margin: 0 0 16px; }
.checkout-google[hidden] { display: none !important; }
.checkout-google-button {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100% !important;
  min-height: 52px !important;
  padding: 0 16px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .05);
  color: #1e293b !important;
  font-size: .95rem !important;
  font-weight: 800 !important;
  text-decoration: none !important;
}
.checkout-google-button:hover {
  border-color: #93c5fd !important;
  background: #f8fbff !important;
}
.checkout-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 0;
  color: var(--checkout-muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.checkout-divider::before,
.checkout-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #e2e8f0;
}
.checkout-auth-notice { margin-top: 16px; }
.checkout-email-block { margin: 0 0 16px; }
.checkout-email-block[hidden] { display: none !important; }
.checkout-label {
  display: block;
  margin-bottom: 7px;
  font-size: .84rem;
  font-weight: 800;
}
.checkout-label span { color: var(--checkout-muted); font-weight: 600; }
.checkout-input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: white;
  color: var(--checkout-ink);
  font: inherit;
  font-size: 1rem;
}
.checkout-input:focus {
  border-color: var(--checkout-blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
  outline: none;
}
.checkout-help {
  margin: 7px 0 0;
  color: var(--checkout-muted);
  font-size: .76rem;
  line-height: 1.45;
}
.checkout-expired-alert {
  margin: 18px 0 6px;
  padding: 18px 20px;
  border: 2px solid #16a34a;
  border-radius: 14px;
  background: #dcfce7;
  color: #14532d;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
}
.checkout-password-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.checkout-password-grid .checkout-label { margin-top: 0; }
.checkout-alert {
  margin: 14px 0 0;
  padding: 11px 13px;
  border-radius: 10px;
  background: #fef2f2;
  color: #991b1b;
  font-size: .84rem;
  line-height: 1.45;
}
.checkout-alert:empty { display: none; }

.checkout-primary,
.checkout-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  text-decoration: none;
}
.checkout-primary {
  width: 100%;
  margin-top: 16px;
  background: linear-gradient(135deg, var(--checkout-blue), var(--checkout-blue-dark));
  box-shadow: 0 10px 24px rgba(37, 99, 235, .25);
  color: white;
}
.checkout-primary:hover { filter: brightness(.97); }
.checkout-primary:disabled { cursor: not-allowed; opacity: .55; box-shadow: none; }
.checkout-secondary {
  padding: 0 16px;
  background: #eef2ff;
  color: #3730a3;
}
.checkout-saved-card {
  margin: 16px 0 0;
  padding: 18px 20px;
  border: 2px solid #16a34a;
  border-radius: 14px;
  background: #dcfce7;
  color: #14532d;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
}
.checkout-saved-actions {
  display: grid;
  gap: 10px;
}
.checkout-saved-actions .checkout-primary { margin-top: 12px; }
.checkout-saved-actions .checkout-secondary {
  width: 100%;
  border: 2px solid #3730a3;
  background: white;
  color: #312e81;
}
.checkout-legal {
  max-width: 600px;
  margin: 12px auto 0;
  color: var(--checkout-muted);
  font-size: .7rem;
  line-height: 1.55;
  text-align: center;
}
.checkout-legal a { color: inherit; }

.payment-layout {
  display: grid;
  gap: 14px;
}
.payment-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--checkout-line);
  border-radius: 12px;
  background: #f8fafc;
}
.payment-summary-plan { display: grid; min-width: 0; gap: 2px; }
.payment-summary strong { font-size: .95rem; }
.payment-summary-email {
  overflow: hidden;
  color: var(--checkout-muted);
  font-size: .76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.payment-summary-email[hidden] { display: none; }
.payment-summary-price {
  flex: 0 0 auto;
  font-size: 1.05rem;
  font-weight: 900;
}
.checkout-back {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--checkout-blue-dark);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
#payment-form[hidden] { display: none; }
#payment-element {
  min-height: 220px;
  padding: 14px;
  border: 1px solid var(--checkout-line);
  border-radius: 14px;
  background: white;
}
.checkout-pay {
  width: 100%;
  margin-top: 16px;
  padding: 14px 16px;
  font-size: 1.15rem;
}
.checkout-loading {
  display: grid;
  min-height: 300px;
  place-items: center;
  color: var(--checkout-muted);
  font-weight: 700;
}

.checkout-information {
  margin-top: 28px;
  padding: 20px;
  border: 1px solid var(--checkout-line);
  border-radius: 18px;
  background: white;
  box-shadow: 0 16px 42px rgba(15, 23, 42, .06);
}
.checkout-information > h2 {
  margin: 0 0 16px;
  font-size: 1.1rem;
  letter-spacing: -.02em;
}
.checkout-information-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}
.checkout-information article {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}
.information-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 11px;
  color: white;
  font-size: 1rem;
  font-weight: 900;
}
.information-icon-blue { background: #0ea5e9; }
.information-icon-green { background: #22c55e; }
.information-icon-pink { background: #ec4899; }
.information-icon-purple { background: #a855f7; }
.checkout-information h3 {
  margin: 0 0 4px;
  font-size: .84rem;
  line-height: 1.25;
}
.checkout-information p {
  margin: 0;
  color: var(--checkout-muted);
  font-size: .72rem;
  line-height: 1.5;
}

.checkout-success {
  width: min(560px, calc(100% - 24px));
  margin: 36px auto;
  padding: 24px;
}
.checkout-success-icon {
  display: grid;
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 50%;
  background: #dcfce7;
  color: var(--checkout-green);
  font-size: 1.6rem;
  font-weight: 900;
}
.checkout-success h1 { margin: 0 0 8px; font-size: 1.8rem; letter-spacing: -.035em; }
.checkout-success > p { color: var(--checkout-muted); line-height: 1.6; }
.checkout-success .checkout-email-confirmation {
  padding: 10px 12px;
  border-radius: 10px;
  background: #eff6ff;
  color: var(--checkout-text);
  overflow-wrap: anywhere;
}

@media (max-width: 699px) {
  .checkout-shell { padding-top: 10px; }
  .checkout-fold { min-height: calc(100svh - 62px); }
  .checkout-hero { margin-bottom: 10px; padding: 12px; }
  .checkout-benefits { gap: 9px; margin-top: 14px; }
  .checkout-benefits li { font-size: .92rem; }
  .checkout-step { padding: 14px 12px; border-radius: 16px; }
  .checkout-password-grid { grid-template-columns: 1fr; }
  .checkout-information {
    margin-top: 24px;
    padding: 16px 14px;
  }
  .checkout-information-grid { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 430px) {
  .checkout-nav-link { font-size: .72rem; text-align: right; }
  .checkout-hero h1 { font-size: 1.5rem; }
  .checkout-benefits li { font-size: .86rem; }
  .benefit-icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    border-radius: 9px;
  }
  .sale-badge { padding-inline: 7px; font-size: .56rem; }
  .sale-badge-long { display: none; }
  .plan-option { gap: 7px; padding-inline: 9px; }
  .plan-list-price { display: none; }
}

@media (min-width: 700px) {
  .checkout-nav { padding-inline: 28px; }
  .checkout-shell { padding: 32px 24px 56px; }
  .checkout-step { padding: 22px 24px; }
}
