:root {
  color-scheme: dark;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101010;
  color: #fff;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background: #101010;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.035), transparent 34rem), #101010;
  color: #fff;
}

button, input, select { font: inherit; }
button, a, input, label { -webkit-tap-highlight-color: transparent; }

.checkout-shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: 52px 20px;
}

.checkout-card {
  width: min(100%, 610px);
  padding: 44px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: linear-gradient(100deg, #141414 0%, #0d0d0d 100%);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
}

.brand-logo {
  display: block;
  width: min(100%, 280px);
  height: auto;
  margin: 0 auto 27px;
}

.step-indicator {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  margin: 0 0 23px;
  list-style: none;
}

.step-indicator__item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  padding: 0 0 10px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 180ms ease, color 180ms ease;
}

.step-indicator__item.is-active {
  border-color: rgba(255, 255, 255, 0.88);
  color: #fff;
}

.step-indicator__item.is-complete {
  border-color: rgba(255, 255, 255, 0.36);
  color: rgba(255, 255, 255, 0.68);
}

.step-indicator__number {
  display: grid;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.68rem;
  letter-spacing: 0;
}

.step-indicator__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step[hidden], [hidden] { display: none !important; }

.step { animation: step-in 220ms ease both; }

@keyframes step-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

h1 {
  margin: 0 0 10px;
  color: #fff;
  font-size: clamp(2rem, 7vw, 2.375rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.lead {
  max-width: 33rem;
  margin: 0 0 28px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 1rem;
  line-height: 1.55;
}

form { display: grid; gap: 17px; }

.field-group { display: grid; min-width: 0; gap: 7px; }

.field-label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.93rem;
  font-weight: 600;
}

.field, .field-with-action { width: 100%; }

.field {
  min-width: 0;
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  outline: none;
  background: #1a1a1a;
  color: #fff;
  font-size: 1rem;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.field::placeholder { color: rgba(255, 255, 255, 0.34); }
.field:hover { border-color: rgba(255, 255, 255, 0.34); }
.field:focus {
  border-color: rgba(255, 255, 255, 0.76);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
  background: #1d1d1d;
}
.field[aria-invalid="true"] { border-color: #ef5350; }

.field-with-action { position: relative; display: block; }
.field-with-action .field { padding-right: 54px; }

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  transform: translateY(-50%);
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.password-toggle svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.password-toggle:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }

.field-hint, .field-error { font-size: 0.79rem; line-height: 1.4; }
.field-hint { color: rgba(255, 255, 255, 0.47); }
.field-error { min-height: 0; color: #ff7774; }
.field-error:empty { display: none; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.phone-fields {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
}

.phone-country-code {
  padding-inline: 12px;
  text-align: center;
}

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

.email-warning {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 11px;
  align-items: start;
  margin-top: -5px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.82rem;
  line-height: 1.5;
}

.email-warning__icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.78rem;
  font-weight: 700;
}

.email-warning p { margin: 0; }
.email-warning strong { display: block; margin-bottom: 1px; color: rgba(255, 255, 255, 0.88); font-weight: 600; }

.email-summary {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.email-summary > span { display: grid; min-width: 0; gap: 2px; }
.email-summary small { color: rgba(255, 255, 255, 0.44); font-size: 0.73rem; }
.email-summary strong { overflow: hidden; color: rgba(255, 255, 255, 0.86); font-size: 0.9rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }

.email-summary button, .change-plan-button, .secondary-link {
  flex: 0 0 auto;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.76);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.email-summary button:hover, .change-plan-button:hover, .secondary-link:hover { color: #fff; }

.primary-button {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 150ms ease, transform 150ms ease;
}

.primary-button--compact { width: fit-content; min-width: 158px; padding-inline: 28px; }
.primary-button:hover { background: #fff; }
.primary-button:active { transform: translateY(1px); }
.primary-button:disabled, .change-plan-button:disabled { cursor: wait; opacity: 0.45; }

.primary-button:focus-visible, .back-button:focus-visible, .password-toggle:focus-visible,
.email-summary button:focus-visible, .change-plan-button:focus-visible, .plan-option:focus-visible,
.plan-picker__close:focus-visible, .billing-period-picker button:focus-visible,
.secondary-link:focus-visible,
.dialog-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 18px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.57);
  cursor: pointer;
  font-weight: 600;
}
.back-button:hover { color: #fff; }

.plan-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 24px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.plan-summary__details, .plan-price { display: grid; gap: 2px; }
.plan-summary__details > strong, .plan-price strong { color: rgba(255, 255, 255, 0.9); font-size: 0.95rem; }
.plan-summary small, .plan-option small { color: rgba(255, 255, 255, 0.44); font-size: 0.76rem; }
.plan-price { text-align: right; }
.change-plan-button { width: fit-content; margin: 5px 0 0; }

.plan-picker {
  display: grid;
  gap: 14px;
  margin: -10px 0 24px;
  padding: 17px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 16px;
  background: #151515;
  animation: step-in 180ms ease both;
}

.plan-picker__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.plan-picker__heading > span { display: grid; gap: 3px; }
.plan-picker__heading strong { color: rgba(255, 255, 255, 0.92); font-size: 0.94rem; }
.plan-picker__heading small { color: rgba(255, 255, 255, 0.48); font-size: 0.76rem; line-height: 1.45; }

.plan-picker__close {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 1.4rem;
}
.plan-picker__close:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.billing-period-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}
.billing-period-picker button {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
}
.billing-period-picker button.is-selected {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}
.plan-options { display: grid; gap: 9px; }

.plan-option {
  display: flex;
  width: 100%;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
  color: rgba(255, 255, 255, 0.76);
  cursor: pointer;
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease;
}
.plan-option:hover { border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.05); }
.plan-option.is-selected { border-color: rgba(255, 255, 255, 0.68); background: rgba(255, 255, 255, 0.08); }
.plan-option > span { display: grid; gap: 2px; }
.plan-option strong { color: rgba(255, 255, 255, 0.92); font-size: 0.88rem; }
.plan-option__price { flex: 0 0 auto; text-align: right; }
.plan-source-note { margin: 0; color: rgba(255, 255, 255, 0.42); font-size: 0.72rem; line-height: 1.5; }

.terms {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 11px;
  align-items: start;
  color: rgba(255, 255, 255, 0.56);
  cursor: pointer;
  font-size: 0.82rem;
  line-height: 1.55;
}
.terms input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: #fff; }
.terms a, .help-text a { color: rgba(255, 255, 255, 0.82); font-weight: 600; text-underline-offset: 3px; }

.payment-note { margin: -2px 0 0; color: rgba(255, 255, 255, 0.45); font-size: 0.78rem; line-height: 1.5; text-align: center; }

.access-notice {
  display: grid;
  gap: 3px;
  margin-top: -2px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.82rem;
  line-height: 1.5;
}
.access-notice strong { color: rgba(255, 255, 255, 0.9); font-weight: 600; }

.help-text { margin: 26px 0 0; color: rgba(255, 255, 255, 0.62); font-size: 0.88rem; line-height: 1.6; text-align: center; }

.global-error {
  margin: 0 0 22px;
  padding: 13px 15px;
  border: 1px solid rgba(239, 83, 80, 0.45);
  border-radius: 14px;
  background: rgba(239, 83, 80, 0.09);
  color: #ffaaa8;
  font-size: 0.86rem;
  line-height: 1.5;
}

.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.payment-step { display: grid; justify-items: center; text-align: center; }
.payment-step .lead { max-width: 27rem; }
.payment-step .access-notice { width: 100%; margin-bottom: 20px; text-align: left; }
.payment-form-view { width: 100%; text-align: left; }
.payment-form-view .lead { max-width: 33rem; }
.payment-status-view { display: grid; width: 100%; justify-items: center; text-align: center; }
.payment-plan-summary { margin-bottom: 22px; }
.security-note {
  display: grid;
  gap: 3px;
  padding: 14px 16px;
  border: 1px solid rgba(101, 210, 145, 0.24);
  border-radius: 14px;
  background: rgba(101, 210, 145, 0.055);
  color: rgba(220, 255, 234, 0.62);
  font-size: 0.79rem;
  line-height: 1.5;
}
.security-note strong { color: #b9e9cc; font-weight: 650; }
.payment-link { margin-top: 4px; }
.secondary-link { margin-top: 18px; font-size: 0.9rem; }
.pending-edit-button { line-height: 1.5; }

.checkout-dialog {
  width: min(calc(100% - 32px), 470px);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: #141414;
  color: #fff;
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.72);
}

.checkout-dialog::backdrop {
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(3px);
}

.checkout-dialog__card { padding: 26px; }

.checkout-dialog h2 {
  margin: 0 0 10px;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.checkout-dialog p {
  margin: 0;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.91rem;
  line-height: 1.6;
}

.checkout-dialog__actions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.dialog-button {
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 13px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
}

.dialog-button:hover { border-color: rgba(255, 255, 255, 0.38); color: #fff; }

.dialog-button--primary {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.91);
  color: #111;
}

.dialog-button--primary:hover { background: #fff; color: #111; }
.dialog-button:disabled { cursor: wait; opacity: 0.48; }

.dialog-error {
  margin-top: 16px;
  padding: 11px 13px;
  border: 1px solid rgba(239, 83, 80, 0.4);
  border-radius: 12px;
  background: rgba(239, 83, 80, 0.09);
  color: #ffaaa8;
  font-size: 0.82rem;
  line-height: 1.5;
}

.spinner {
  width: 38px;
  height: 38px;
  margin: 8px 0 24px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .checkout-shell { align-items: flex-start; padding: 16px 0; }
  .checkout-card { width: 100%; padding: 28px 20px 30px; border-right: 0; border-left: 0; border-radius: 0; box-shadow: none; }
  .brand-logo { width: min(70vw, 240px); margin-bottom: 24px; }
  .field-row { grid-template-columns: 1fr; gap: 17px; }
  .step-indicator { gap: 7px; }
  .step-indicator__item { gap: 5px; font-size: 0.65rem; letter-spacing: 0.045em; }
  .step-indicator__number { width: 20px; height: 20px; font-size: 0.62rem; }
  .primary-button--compact { width: 100%; }
  .checkout-dialog__card { padding: 22px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
