*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--color-bg-base);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }

.wrap-narrow {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding-left: var(--wrapper-padding);
  padding-right: var(--wrapper-padding);
}

.page {
  position: relative;
  background: var(--atmosphere-aurora);
  padding: var(--space-2xl) 0 var(--space-3xl);
  min-height: 100vh;
}

/* ─── Top utility bar ──────────────────────────────────────── */
.top-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding-bottom: 14px;
  margin-bottom: var(--space-xl);
  border-bottom: 1px solid rgba(245,239,230,0.08);
  font-size: var(--fs-body-sm);
  color: var(--color-text-muted);
}
.top-bar a {
  color: var(--warm-gold);
  border-bottom: 1px solid rgba(244,199,109,0.4);
  font-weight: var(--fw-medium);
  transition: border-color 0.2s ease;
  white-space: nowrap;
}
.top-bar a:hover { border-bottom-color: var(--warm-gold); }
@media (max-width: 480px) {
  .top-bar { font-size: var(--fs-small); gap: 4px 10px; }
}

/* ─── Logo above the card ──────────────────────────────────── */
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: var(--space-xl);
}
.logo .logo__mascot { width: 36px; height: 36px; }
.logo .word {
  font-weight: var(--fw-bold);
  font-size: 22px;
  letter-spacing: -0.015em; line-height: 1;
  color: var(--warm-cream);
}

/* ─── Form card ────────────────────────────────────────────── */
.form-card {
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
  backdrop-filter: blur(40px) saturate(140%);
  -webkit-backdrop-filter: blur(40px) saturate(140%);
  border: 1px solid var(--color-border-soft);
  box-shadow: var(--shadow-card);
}
@media (max-width: 480px) {
  .form-card { padding: var(--space-lg) var(--space-md); border-radius: var(--radius-md); }
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  font-size: var(--fs-body-sm);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--warm-gold);
  font-weight: var(--fw-bold);
}
.form-card h1 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-black);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 var(--space-sm);
  color: var(--warm-cream);
}
.form-intro {
  margin: 0 0 var(--space-lg);
  color: var(--color-text-soft);
  font-size: var(--fs-body);
}
.form-intro em { font-style: normal; color: var(--warm-gold); font-weight: var(--fw-medium); }

/* ─── Social login buttons ────────────────────────────────── */
.social-stack {
  display: flex; flex-direction: column;
  gap: 10px; margin-bottom: var(--space-md);
}
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  padding: 13px 18px;
  font-family: var(--font-body);
  font-weight: var(--fw-medium);
  font-size: var(--fs-body-sm);
  color: var(--warm-cream);
  background: rgba(245,239,230,0.04);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.btn-ghost:hover { border-color: rgba(244,199,109,0.4); background: rgba(244,199,109,0.06); }
.btn-ghost svg { width: 18px; height: 18px; }

.divider {
  display: flex; align-items: center; gap: 12px;
  margin: var(--space-md) 0;
  color: var(--color-text-faint);
  font-size: var(--fs-small);
}
.divider::before, .divider::after {
  content: ""; flex: 1;
  height: 1px;
  background: rgba(245,239,230,0.08);
}

/* ─── Email input ──────────────────────────────────────────── */
.row {
  position: relative;
  margin-bottom: var(--space-md);
}
.row > svg.lead-ic {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  pointer-events: none;
  color: var(--color-text-muted);
  z-index: 2;
}
.row > svg.lead-ic [stroke="#999999"] { stroke: currentColor; }
.row > svg.lead-ic [fill="#999999"] { fill: currentColor; }
.form-control {
  width: 100%;
  padding: 14px 16px 14px 44px;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  color: var(--warm-cream);
  background: rgba(245,239,230,0.04);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}
.form-control::placeholder { color: var(--color-text-faint); }
.form-control:hover { border-color: rgba(244,199,109,0.25); }
.form-control:focus {
  border-color: var(--warm-gold);
  background: rgba(245,239,230,0.06);
  box-shadow: 0 0 0 3px rgba(244,199,109,0.15);
}
.row:focus-within > svg.lead-ic { color: var(--warm-gold); }

.form-control.has-error {
  border-color: #E25571;
  background-color: rgba(226,85,113,0.10);
  box-shadow: 0 0 0 3px rgba(226,85,113,0.28);
}
.row.has-error > svg.lead-ic { color: #E25571; }

/* ─── Inline form error ───────────────────────────────────── */
.form-error {
  display: none;
  margin-bottom: var(--space-md);
  padding: 12px 14px;
  background: rgba(226,85,113,0.10);
  border: 1px solid rgba(226,85,113,0.5);
  border-radius: var(--radius-sm);
  color: #E25571;
  font-size: var(--fs-body-sm);
  line-height: 1.45;
  align-items: flex-start;
  gap: 10px;
}
.form-error.is-visible { display: flex; }
.form-error svg {
  width: 18px; height: 18px;
  flex-shrink: 0; margin-top: 1px;
  stroke: currentColor; fill: none;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

/* ─── Submit ──────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  padding: 18px 32px;
  font-family: var(--font-body); font-weight: var(--fw-bold); font-size: var(--fs-body);
  color: var(--warm-cream);
  background: var(--gradient-cta);
  border: none; border-radius: var(--radius-pill);
  box-shadow: var(--shadow-cta);
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.2,0.8,0.2,1), background 0.4s, box-shadow 0.4s;
}
.btn-primary:hover { background: var(--gradient-cta-hover); box-shadow: var(--shadow-cta), var(--shadow-glow-purple); }
.btn-primary:active { transform: scale(0.98); }

@keyframes lv-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}
.btn-primary.is-shaking { animation: lv-shake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97); }

/* ─── Consent checkbox ─────────────────────────────────────── */
.consent {
  position: relative;
  margin-bottom: var(--space-md);
}
.consent input {
  position: absolute;
  opacity: 0;
  width: 22px; height: 22px;
  margin: 0;
  top: 1px; left: 0;
  cursor: pointer;
  z-index: 1;
}
.consent label {
  display: block;
  position: relative;
  padding-left: 34px;
  min-height: 22px;
  cursor: pointer;
  font-size: var(--fs-micro);
  color: var(--color-text-muted);
  line-height: 1.45;
}
.consent label::before {
  content: "";
  position: absolute;
  left: 0; top: 1px;
  width: 22px; height: 22px;
  border: 1.5px solid rgba(244,199,109,0.5);
  border-radius: 6px;
  background: rgba(244,199,109,0.06);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.consent label:hover::before {
  border-color: var(--warm-gold);
  background: rgba(244,199,109,0.14);
}
.consent input:focus-visible + label::before {
  box-shadow: 0 0 0 3px rgba(244,199,109,0.25);
}
.consent input:checked + label::before {
  background-color: var(--warm-gold);
  border-color: var(--warm-gold);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2324223E' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-size: 14px 14px;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 0 12px rgba(244,199,109,0.3);
}
.consent.has-error label::before {
  border-color: #E25571;
  background-color: rgba(226,85,113,0.10);
  box-shadow: 0 0 0 3px rgba(226,85,113,0.28);
}
.consent.has-error label { color: #E25571; }
.consent label a {
  color: inherit;
  border-bottom: 1px solid rgba(245,239,230,0.25);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.consent label a:hover {
  color: var(--warm-cream);
  border-bottom-color: rgba(245,239,230,0.55);
}

/* ─── Fine print ──────────────────────────────────────────── */
.fine-print {
  margin-top: var(--space-md);
  text-align: center;
  font-size: var(--fs-small);
  color: var(--color-text-muted);
  line-height: 1.5;
}
.fine-print a {
  color: var(--color-text-soft);
  border-bottom: 1px solid rgba(245,239,230,0.18);
}

/* ─── Subscription checkout (pay/subscription) ─────────────── */
.subscription-total {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(245,239,230,0.1);
  font-size: var(--fs-body);
  color: var(--color-text-soft);
}
.subscription-total__title {
  font-weight: var(--fw-bold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: var(--fs-micro);
  color: var(--warm-gold);
}
.subscription-total__price {
  text-align: right;
  line-height: 1.2;
}
.subscription-total__currency {
  font-size: var(--fs-body-sm);
  color: var(--color-text-muted);
  font-weight: var(--fw-medium);
  margin-right: 6px;
}
.subscription-total__old {
  text-decoration: line-through;
  color: var(--color-text-muted);
  margin-right: 8px;
}
.subscription-total__new {
  font-size: var(--fs-h3);
  font-weight: var(--fw-black);
  color: var(--warm-cream);
}

.pay-submit-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-top: var(--space-sm);
}
.pay-submit-row .btn-primary {
  flex: 1 1 200px;
  min-width: 0;
}
.pay-submit-row .pay-cards-img {
  height: 22px;
  width: auto;
  opacity: 0.85;
}
@media (max-width: 480px) {
  .pay-submit-row { flex-direction: column; align-items: stretch; }
  .pay-submit-row .pay-cards-img { margin: 0 auto; }
}

.btn-primary { position: relative; }
.btn-primary .btn-preloader {
  display: none;
  width: 22px;
  height: 22px;
  vertical-align: middle;
}
.btn-primary.is-loading .btn-preloader { display: inline-block; }
.btn-primary.is-loading .btn-primary__text { display: none; }

.consent-error {
  display: none;
  margin-top: 6px;
  padding-left: 34px;
  font-size: var(--fs-small);
  color: #E25571;
}
.consent.has-error .consent-error { display: block; }
