/* ═══════════════════════════════════════════════════════════
   Auth Page — Sign in / Sign up / Forgot Password
   ═══════════════════════════════════════════════════════════ */

.auth-page {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}

/* Warp speed starfield canvas — behind everything */
.auth-warp-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Dim overlay — transparent enough for stars to show through */
.auth-backdrop {
  position: absolute; inset: 0;
  background: rgba(8, 12, 21, .45);
  cursor: pointer;
  z-index: 1;
}

.auth-close {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 32px; height: 32px; border-radius: 10px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); transition: all var(--transition);
}
.auth-close:hover { color: var(--text); background: rgba(255,255,255,.15); }

.auth-card {
  position: relative; z-index: 2;
  width: 100%; max-width: 400px;
  background: rgba(17, 24, 39, .88);
  border: 1px solid rgba(196,113,237,.12);
  border-radius: 20px; padding: 36px 24px 28px;
  box-shadow: 0 8px 60px rgba(0,0,0,.6), 0 0 80px rgba(196,113,237,.06), 0 0 120px rgba(255,107,157,.03);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: authCardIn .35s ease both;
  overflow: visible;
}

@keyframes authCardIn {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-logo {
  font-size: 32px; font-weight: 800; text-align: center;
  letter-spacing: -.03em; margin-bottom: 6px;
}
.auth-logo .vita-gradient {
  background: linear-gradient(135deg, #f5a623, #ff6b9d, #c471ed, #7c9cff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-tagline {
  text-align: center; color: var(--muted); font-size: 14px;
  margin-bottom: 28px; line-height: 1.5;
}

/* ── Galactic orbit decoration ── */
.auth-orbit {
  position: absolute; top: -40px; left: 50%; transform: translateX(-50%);
  width: 80px; height: 80px; pointer-events: none;
}
.auth-orbit-ring {
  position: absolute; inset: 0;
  border: 1px solid rgba(196,113,237,.2);
  border-radius: 50%;
  animation: authOrbitSpin 20s linear infinite;
}
.auth-orbit-ring::after {
  content: '';
  position: absolute; inset: 10px;
  border: 1px dashed rgba(255,107,157,.15);
  border-radius: 50%;
  animation: authOrbitSpin 14s linear infinite reverse;
}
.auth-orbit-dot {
  position: absolute; border-radius: 50%;
  animation: authOrbitSpin 20s linear infinite;
}
.auth-orbit-dot--1 {
  width: 6px; height: 6px; background: #ffb347;
  top: 0; left: 50%; margin-left: -3px;
  box-shadow: 0 0 8px rgba(255,179,71,.6);
}
.auth-orbit-dot--2 {
  width: 4px; height: 4px; background: #ff6b9d;
  bottom: 6px; right: 6px;
  box-shadow: 0 0 6px rgba(255,107,157,.5);
  animation-duration: 14s; animation-direction: reverse;
}
.auth-orbit-dot--3 {
  width: 3px; height: 3px; background: #7c9cff;
  bottom: 10px; left: 8px;
  box-shadow: 0 0 6px rgba(124,156,255,.5);
  animation-duration: 24s;
}
@keyframes authOrbitSpin {
  to { transform: rotate(360deg); }
}

/* Google Button */
.auth-google-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 20px;
  font-size: 15px; font-weight: 600; color: var(--text);
  transition: all var(--transition);
}
.auth-google-btn:hover { border-color: var(--accent); background: var(--surface3); }
.auth-google-btn.small {
  padding: 10px 16px; font-size: 14px; margin-top: 10px;
}

/* Divider */
.auth-divider {
  display: flex; align-items: center; gap: 16px;
  margin: 24px 0; color: var(--muted); font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Form */
.auth-form { display: flex; flex-direction: column; gap: 12px; }

.auth-input {
  width: 100%; padding: 12px 16px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 15px; outline: none;
  transition: border-color var(--transition);
}
.auth-input:focus { border-color: var(--accent); }
.auth-input::placeholder { color: var(--muted); }

.auth-submit {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, #ff6b9d, #c471ed, #7c9cff);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 700;
  transition: filter var(--transition), box-shadow var(--transition),
              max-height .35s ease, opacity .3s ease, padding .35s ease, margin .35s ease;
  margin-top: 4px;
  box-shadow: 0 4px 20px rgba(196,113,237,.2);
  overflow: hidden;
}
.auth-submit:hover { filter: brightness(1.12); box-shadow: 0 6px 28px rgba(196,113,237,.35); }

/* Status messages */
.auth-status { min-height: 20px; text-align: center; font-size: 14px;
  transition: max-height .35s ease, min-height .35s ease, opacity .25s ease, margin .35s ease;
  overflow: hidden;
}
.auth-loading { color: var(--muted); }
.auth-success { color: var(--success); }
.auth-error { color: var(--error); }

.auth-hint {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
  text-align: center;
}
.auth-hint p { color: var(--text-dim); font-size: 14px; margin-bottom: 8px; }

/* Toggles */
.auth-toggles {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  margin-top: 20px;
  transition: max-height .35s ease, opacity .25s ease, margin .35s ease;
  overflow: hidden;
}
.auth-toggle {
  font-size: 13px; color: var(--muted);
  transition: color var(--transition);
}
.auth-toggle:hover { color: var(--accent); }
.auth-toggle strong { color: var(--accent); font-weight: 600; }

/* Email display (after Continue step) */
.auth-email-display {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; color: var(--text);
}
.auth-email-value {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.auth-email-change {
  font-size: 13px; color: var(--accent); font-weight: 600;
  flex-shrink: 0; margin-left: 12px;
  transition: opacity var(--transition);
}
.auth-email-change:hover { opacity: .8; }

/* ── Step transitions (smooth expand/collapse) ── */
.auth-step {
  overflow: hidden;
  max-height: 60px;
  opacity: 1;
  transition: max-height .3s ease, opacity .25s ease, margin .3s ease;
}
.auth-step--hidden {
  max-height: 0;
  opacity: 0;
  margin: 0;
  pointer-events: none;
}

/* ── OTP Code Input ─────────────────────────────────────── */
#authStepOtp:not(.auth-step--hidden) {
  max-height: 180px;
}

.auth-otp-hint {
  font-size: 13px;
  color: rgba(255,255,255,.6);
  text-align: center;
  margin: 0 0 12px;
}

.auth-otp-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}

.auth-otp-digit {
  width: 44px; height: 52px;
  border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.06);
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  caret-color: transparent;
}

.auth-otp-digit:focus {
  border-color: rgba(124,156,255,.6);
  box-shadow: 0 0 0 3px rgba(124,156,255,.15);
}

.auth-otp-resend {
  display: block;
  margin: 0 auto;
  background: none;
  border: none;
  color: rgba(255,255,255,.45);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  transition: color .2s;
}

.auth-otp-resend:not(:disabled):hover {
  color: rgba(255,255,255,.8);
}

.auth-otp-resend:disabled {
  cursor: default;
  opacity: .5;
}

/* ── Compact initial state ─────────────────────────────────
   Card starts small (no submit/status/toggles).
   Expands smoothly when user begins typing their email. ── */
.auth-card--compact .auth-status {
  max-height: 0; min-height: 0; opacity: 0; margin: 0;
}
.auth-card--compact .auth-submit {
  max-height: 0; opacity: 0; padding: 0; margin: 0;
}
.auth-card--compact .auth-toggles {
  max-height: 0; opacity: 0; margin: 0;
}
/* Expanded defaults (when compact class removed) */
.auth-status   { max-height: 80px; }
.auth-submit   { max-height: 60px; }
.auth-toggles  { max-height: 80px; }
