/*
 * auth.css — PumpkinTime authentication page
 * Covers: shell, hero, login panel, reset states, wizard
 * No framework dependency — Bootstrap 5.3 is loaded separately by the page.
 */

/* ── Reset / base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left,     #A8DFFD, transparent 55%),
    radial-gradient(circle at bottom right, #20425E, transparent 55%),
    linear-gradient(135deg, #A8DFFD 0%, #4E8EC7 40%, #20425E 100%);
  min-height: 100vh;
}

/* ── Auth shell (glassmorphism) ───────────────────────────────────────────── */
.auth-shell {
  max-width: 1400px;
  margin: 32px auto;
  padding: 28px;
  background: rgba(255, 255, 255, .15);
  backdrop-filter: blur(22px);
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, .35);
}

/* ── Tab switcher ─────────────────────────────────────────────────────────── */
.auth-tabs {
  width: 340px;
  margin: 0 auto 28px;
  position: relative;
  background: #f3f4f6;
  border-radius: 999px;
  padding: 4px;
  display: flex;
}

.auth-tab {
  flex: 1;
  border: none;
  background: none;
  padding: 10px 0;
  font-weight: 650;
  z-index: 2;
  cursor: pointer;
  color: #334155;
  transition: color .2s;
}
.auth-tab.active { color: #0f172a; }

#auth-slider {
  position: absolute;
  inset: 4px auto 4px 4px;
  width: calc(50% - 4px);
  background: #fff;
  border-radius: 999px;
  transition: transform .25s ease;
  z-index: 1;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .12);
}

/* ── Panel base ───────────────────────────────────────────────────────────── */
.auth-row > [class^="col-"] { display: flex; }

.panel {
  width: 100%;
  background: #fff;
  border-radius: 22px;
  padding: 32px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, .15);
}

/* ── Hero panel ───────────────────────────────────────────────────────────── */
.hero-panel {
  background: linear-gradient(135deg, #20425e, #0f172a);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 520px;
}

.hero-top img { height: 36px; width: auto; }

.hero-body { display: flex; flex-direction: column; gap: 14px; }

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0;
  line-height: 1.15;
}

.hero-subtitle {
  margin: 0;
  color: rgba(255, 255, 255, .82);
  max-width: 52ch;
  line-height: 1.5;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.hero-metric {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 14px;
  padding: 12px;
}

.hero-metric-value {
  font-weight: 800;
  margin-bottom: 2px;
}

.hero-metric-label {
  font-size: .875rem;
  color: rgba(255, 255, 255, .72);
}

.hero-footer {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-pill {
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .9);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: .9rem;
}

/* ── Login panel ──────────────────────────────────────────────────────────── */
.login-panel { max-width: 420px; margin: auto; }

.panel-logo {
  max-width: 200px;
  display: block;
  margin: 0 auto 16px;
}

.login-title {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.login-subtitle {
  text-align: center;
  color: #64748b;
  margin: 0 0 20px;
  font-size: .9rem;
}

/* ── Primary auth button ──────────────────────────────────────────────────── */
.btn-primary-auth {
  width: 100%;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #4e8ec7, #20425e);
  color: #fff;
  padding: 12px 16px;
  font-size: .9375rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: filter .2s, opacity .2s;
}
.btn-primary-auth:hover:not(:disabled) { filter: brightness(1.08); }
.btn-primary-auth:disabled { opacity: .65; cursor: not-allowed; }

/* ── Auth links / footnotes ───────────────────────────────────────────────── */
.auth-link { color: #4e8ec7; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }

.auth-footnote {
  text-align: center;
  font-size: .85rem;
  color: #64748b;
}
.auth-footnote a { color: #4e8ec7; text-decoration: none; }
.auth-footnote a:hover { text-decoration: underline; }

/* ── Auth inline alerts ───────────────────────────────────────────────────── */
.alert-auth {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .875rem;
  margin-bottom: 16px;
}
.alert-auth-danger  { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.alert-auth-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #16a34a; }
.alert-auth-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #2563eb; }

/* ── Auth state machine ───────────────────────────────────────────────────── */
.auth-state-container { position: relative; }

.auth-state { display: none; }

.auth-state.active {
  display: block;
  animation: fadeInSlide .3s ease;
}

@keyframes fadeInSlide {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Reset panel ──────────────────────────────────────────────────────────── */
.reset-panel { max-width: 420px; margin: auto; }

.auth-state-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  text-decoration: none;
  font-size: .875rem;
  transition: color .2s;
}
.auth-state-back:hover { color: #20425e; }

/* ── Reset progress steps ─────────────────────────────────────────────────── */
.reset-progress {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: 18px 0 26px;
  position: relative;
}
.reset-progress::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 12%;
  right: 12%;
  height: 2px;
  background: #e5e7eb;
  z-index: 0;
}
.reset-progress-step { text-align: center; flex: 1; z-index: 1; }

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #e5e7eb;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
  font-weight: 600;
  font-size: .875rem;
}
.reset-progress-step.active  .step-circle { background: #20425e; color: #fff; border-color: #20425e; }
.reset-progress-step.complete .step-circle { background: #22c55e; color: #fff; border-color: #22c55e; }

.step-label { font-size: .72rem; color: #94a3b8; }
.reset-progress-step.active .step-label,
.reset-progress-step.complete .step-label { color: #1e293b; font-weight: 600; }

/* ── 6-digit code input ───────────────────────────────────────────────────── */
.code-input {
  font-size: 1.75rem !important;
  letter-spacing: .5rem !important;
  text-align: center !important;
  font-weight: 700 !important;
}

/* ── Wizard ───────────────────────────────────────────────────────────────── */
.wizard-panel { display: flex; flex-direction: column; gap: 20px; }
/* ── Wizard ───────────────────────────────────────────────────────────────── */
.wizard-panel { display: flex; flex-direction: column; gap: 20px; }

/* Facts rail */
.wizard-facts-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding: 10px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  font-size: .8rem;
}
.wf-row { display: flex; align-items: baseline; gap: 5px; }
.wf-label { color: #15803d; font-weight: 600; white-space: nowrap; }
.wf-label::after { content: ':'; }
.wf-value { color: #1f2937; }

/* Postal-locked fields */
.wizard-panel .form-control[readonly] {
  background-color: #f3f4f6;
  color: #374151;
  cursor: not-allowed;
  border-color: #d1d5db;
}

.wizard-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.wizard-logo { height: 34px; width: auto; }
.wizard-title { font-size: 1.1rem; font-weight: 700; color: #111827; margin-bottom: 2px; }
.wizard-subtitle { font-size: .8rem; color: #6b7280; }

/* Step tabs */
.wizard-steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, .08);
}

.wizard-step {
  border: 1px solid rgba(15, 23, 42, .12);
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: .8125rem;
  font-weight: 600;
  cursor: default;
  transition: background .2s, color .2s, border-color .2s;
}
.wizard-step.active { background: #20425e; border-color: #20425e; color: #fff; }
.wizard-step.done   { background: #f0fdf4; border-color: #86efac; color: #16a34a; }

/* Wizard pages */
.wizard-pages {
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 16px;
  padding: 24px;
}
.wizard-page { display: none; }
.wizard-page.active { display: block; animation: fadeInSlide .25s ease; }

.wizard-actions {
  margin-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* ── Plan cards ───────────────────────────────────────────────────────────── */
.plan-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  height: 100%;
  border: 2px solid rgba(0, 0, 0, .08);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 16px rgba(0, 0, 0, .07);
  cursor: pointer;
  transition: box-shadow .2s, transform .2s, border-color .2s;
  display: flex;
  flex-direction: column;
}
.plan-card:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,.10), 0 12px 28px rgba(0,0,0,.12); }
.plan-card.selected { border-color: #4e8ec7; box-shadow: 0 0 0 3px rgba(78,142,199,.2), 0 10px 28px rgba(0,0,0,.12); }
.plan-card.featured { border-color: #f59e0b; }

.plan-card-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.plan-card-name { font-size: 1rem; font-weight: 700; color: #111827; }
.plan-card-desc { color: #64748b; font-size: .8125rem; margin-top: 4px; line-height: 1.4; }

.plan-card-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  margin: 10px 0;
}
.plan-card-price small { font-size: .875rem; font-weight: 400; color: #64748b; }

.plan-features {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  flex: 1;
}
.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 5px;
  font-size: .8125rem;
  color: #374151;
}
.plan-features li::before {
  content: "✓";
  color: #22c55e;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Billing toggle ───────────────────────────────────────────────────────── */
.billing-toggle {
  display: inline-flex;
  position: relative;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 4px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
}
.billing-btn {
  position: relative;
  z-index: 2;
  border: none;
  background: transparent;
  padding: 8px 20px;
  font-size: .875rem;
  font-weight: 600;
  color: #475569;
  border-radius: 999px;
  cursor: pointer;
  transition: color .2s;
  white-space: nowrap;
}
.billing-btn.active { color: #0f172a; }
.billing-toggle::before {
  content: '';
  position: absolute;
  top: 4px; bottom: 4px; left: 4px;
  width: calc(50% - 4px);
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .12);
  transition: transform .25s ease;
  z-index: 1;
}
.billing-toggle:has(.billing-btn[data-cycle="annual"].active)::before {
  transform: translateX(100%);
}

/* ── Review summary ───────────────────────────────────────────────────────── */
.review-summary { display: flex; flex-direction: column; gap: 10px; }

.review-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, .06);
  gap: 16px;
}
.review-label {
  font-size: .75rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
  flex-shrink: 0;
}
.review-value { font-size: .875rem; color: #1e293b; text-align: right; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  #hero-col { display: none !important; }
  .auth-shell { margin: 16px; padding: 18px; }
  .auth-tabs  { width: 100%; }
}

@media (max-width: 575.98px) {
  .billing-btn { padding: 8px 14px; font-size: .8rem; }
  .hero-metrics { grid-template-columns: 1fr; }
  .wizard-pages { padding: 16px; }
}
