/* ══════════════════════════════════════════════════════════════
   PrepFlow — auth shell
   Shared by every page in /auth/: login, registration,
   forgot-password, verify-account, payment. Centred card, form
   fields, background glow, submit button, corner controls and
   the multi-step progress indicator.
   ══════════════════════════════════════════════════════════════ */

/* Guard against author rules (e.g. .field{display:flex}) beating the
   UA stylesheet's [hidden]{display:none} by specificity. */
[hidden] { display: none !important; }

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 76px 16px 32px;
}

/* ── Background glows ── */
.bg-glow { position: fixed; pointer-events: none; z-index: -1; border-radius: 50%; filter: blur(90px); }
.bg-glow-1 { top: -100px; right: -80px; width: 360px; height: 360px; background: rgba(26,60,110,0.07); }
.bg-glow-2 { bottom: -80px; left: -80px; width: 280px; height: 280px; background: rgba(0,110,37,0.04); }

/* ── Corner controls (exit / theme toggle) ── */
.auth-corner-btn {
  position: fixed; top: 16px; z-index: 50;
}
.exit-btn { left: 16px; }
.theme-toggle-standalone { right: 16px; }

/* ── Branding ── */
.brand { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 28px; text-align: center; }
.brand-logo { display: flex; align-items: center; gap: 10px; }
.brand-logo svg { width: 32px; height: 32px; }
.brand-name { font-size: 26px; font-weight: 700; color: var(--primary); letter-spacing: -0.02em; }
.brand-tagline { font-size: 15px; color: var(--on-surface-var); line-height: 1.6; max-width: 380px; }

/* ── Step indicator (registration → verify → payment) ── */
.auth-steps {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; width: 100%; max-width: 440px;
  margin-bottom: 28px;
}
.auth-step { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }
.auth-step-circle {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: var(--surface); color: var(--on-surface-var);
  border: 2px solid var(--outline);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.auth-step-circle svg { width: 13px; height: 13px; }
.auth-step-label { font-size: 11px; font-weight: 600; color: var(--on-surface-var); white-space: nowrap; }
.auth-step.current .auth-step-circle { background: var(--primary); border-color: var(--primary); color: #fff; }
.auth-step.current .auth-step-label { color: var(--primary); }
.auth-step.completed .auth-step-circle { background: var(--secondary); border-color: var(--secondary); color: #fff; }
.auth-step-line { flex: 1; height: 2px; background: var(--outline); margin-bottom: 18px; min-width: 20px; }
.auth-step-line.completed { background: var(--secondary); }

/* ── Card ── */
.card {
  width: 100%; max-width: 440px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 4px 28px rgba(26,60,110,0.09);
  border: 1px solid rgba(196,198,208,0.3);
  padding: 36px 32px 32px;
}

/* ── Form fields ── */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 18px; }
.field:last-of-type { margin-bottom: 0; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; }
label { font-size: 13px; font-weight: 600; color: var(--on-surface-var); letter-spacing: 0.01em; }
.field-hint { font-size: 12px; color: var(--on-surface-var); line-height: 1.5; }
.forgot-link { font-size: 13px; font-weight: 500; color: var(--accent-link); text-decoration: none; transition: opacity 0.2s; }
.forgot-link:hover { opacity: 0.75; text-decoration: underline; }

/* Input with leading icon */
.input-wrap { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 14px; display: flex; align-items: center; color: var(--on-surface-var); pointer-events: none; }
.input-icon svg { width: 18px; height: 18px; }

input[type="text"], input[type="password"], input[type="email"], input[type="tel"], select {
  width: 100%;
  padding: 13px 14px 13px 44px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--on-surface);
  background: var(--surface-input);
  border: none;
  border-bottom: 2px solid var(--outline);
  border-radius: 8px 8px 0 0;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none; appearance: none;
}
input.no-icon { padding-left: 14px; }
input::placeholder { color: #9aa0a8; }
input:focus, select:focus { border-bottom-color: var(--outline-focus); box-shadow: 0 0 0 3px rgba(26,60,110,0.08); }
input.error, select.error { border-bottom-color: var(--error); }

/* ── Server-side form-level alert (CSRF/rate-limit/generic errors) ── */
.form-alert {
  background: var(--error-bg); border: 1px solid rgba(186,26,26,0.25);
  color: var(--on-error-bg); border-radius: 8px;
  padding: 10px 14px; font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 18px;
}

/* password toggle */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--on-surface-var);
  display: flex; align-items: center; padding: 4px;
  transition: color 0.2s;
}
.pw-toggle:hover { color: var(--primary); }
.pw-toggle svg { width: 19px; height: 19px; }

/* error msg */
.err-msg { font-size: 12px; font-weight: 500; color: var(--error); display: none; margin-top: 2px; }
.err-msg.visible { display: block; }

/* ── Submit ── */
.btn-submit {
  width: 100%; padding: 14px;
  background: var(--primary); color: var(--on-primary);
  font-family: 'Inter', sans-serif; font-size: 15px; font-weight: 600;
  border: none; border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 12px rgba(0,38,83,0.25);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn-submit:hover { background: var(--primary-mid); box-shadow: 0 6px 18px rgba(0,38,83,0.3); }
.btn-submit:active { transform: scale(0.98); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-submit svg { width: 18px; height: 18px; }

.btn-outline {
  width: 100%; padding: 13px;
  background: none; color: var(--on-surface);
  font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600;
  border: 1.5px solid var(--outline); border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: border-color 0.2s, color 0.2s;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-outline:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Cross-links under the card ── */
.auth-switch-link { text-align: center; font-size: 14px; color: var(--on-surface-var); margin-top: 22px; }
.auth-switch-link a { color: var(--primary); font-weight: 700; text-decoration: none; }
.auth-switch-link a:hover { text-decoration: underline; }
.auth-back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--on-surface-var);
  text-decoration: none; margin-top: 18px;
}
.auth-back-link:hover { color: var(--primary); }
.auth-back-link svg { width: 14px; height: 14px; }

/* ── Inline success panel (used after an action completes on the page itself) ── */
.success-panel { display: none; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 8px 0 4px; }
.success-panel.visible { display: flex; }
.success-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--secondary-bg); color: var(--secondary);
  display: flex; align-items: center; justify-content: center;
}
.success-icon svg { width: 28px; height: 28px; }
.success-panel h3 { font-size: 17px; font-weight: 700; }
.success-panel p { font-size: 14px; color: var(--on-surface-var); line-height: 1.5; }

@media (max-width: 480px) {
  body { padding: 68px 16px 24px; }
  .card { padding: 28px 20px 24px; }
  .auth-steps { max-width: 320px; }
  .auth-step-label { font-size: 10px; }
}
