/* ── Auth Page Styles ─────────────────────────────────────────────────────── */
/* Glassmorphism auth page matching the NexusOps landing page aesthetic.      */
/* Uses theme.css CSS vars. Override global reset where needed for glass FX. */

body { min-height: 100vh; }

/* ── Page background — dark gradient w/ subtle radial glow ─────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(52px + 48px) 24px 64px;
  background: radial-gradient(ellipse at 50% 0%, rgba(41,151,255,0.12) 0%, transparent 60%),
              var(--bg);
  position: relative;
  overflow: hidden;
}

/* Subtle animated gradient orbs behind the card */
.auth-page::before,
.auth-page::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}
.auth-page::before {
  width: 500px; height: 500px;
  top: -120px; left: -80px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  animation: authOrbDrift 12s ease-in-out infinite alternate;
}
.auth-page::after {
  width: 400px; height: 400px;
  bottom: -100px; right: -60px;
  background: radial-gradient(circle, rgba(168,85,247,0.6) 0%, transparent 70%);
  animation: authOrbDrift 15s ease-in-out infinite alternate-reverse;
}
@keyframes authOrbDrift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 20px) scale(1.08); }
}

/* ── Glassmorphism card ─────────────────────────────────────────────────── */
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: rgba(29, 29, 31, 0.55);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 44px 40px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 8px 40px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.06);
  transition: border-color 0.3s, box-shadow 0.3s;
}

[data-theme="dark"] .auth-card,
.auth-card {
  background: rgba(29, 29, 31, 0.55);
}

/* Light mode: slightly different glass tint */
:root:not([data-theme="dark"]) .auth-card {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255,255,255,0.18);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.08),
    0 8px 40px rgba(0,0,0,0.12),
    inset 0 1px 0 rgba(255,255,255,0.15);
}

/* Force dark-style text on auth page since bg is always dark */
.auth-page,
.auth-page *,
.auth-card,
.auth-card * {
  background: transparent !important;
}
.auth-page {
  background: radial-gradient(ellipse at 50% 0%, rgba(41,151,255,0.12) 0%, transparent 60%),
              #000 !important;
}
.auth-card {
  background: rgba(29, 29, 31, 0.55) !important;
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
}

/* ── Brand area ─────────────────────────────────────────────────────────── */
.auth-brand { text-align: center; margin-bottom: 32px; }

.auth-brand-logo {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #f5f5f7;
  margin-bottom: 8px;
}

.auth-brand-sub {
  font-size: 15px;
  color: #86868b;
  line-height: 1.5;
  transition: opacity 0.3s;
}

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

.auth-field { display: flex; flex-direction: column; gap: 6px; }

.auth-field label {
  font-size: 13px;
  font-weight: 500;
  color: #86868b;
  letter-spacing: 0.02em;
}

/* ── Input fields — dark glass style ────────────────────────────────────── */
.auth-field input {
  width: 100%;
  padding: 13px 16px;
  font-size: 16px;
  font-family: var(--font);
  color: #f5f5f7 !important;
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.auth-field input:focus {
  border-color: rgba(41,151,255,0.6);
  box-shadow: 0 0 0 3px rgba(41,151,255,0.15), 0 0 20px rgba(41,151,255,0.08);
  background: rgba(255,255,255,0.08) !important;
}

.auth-field input::placeholder {
  color: rgba(134,134,139,0.7);
}

/* ── Continue / action button — blue gradient ───────────────────────────── */
.auth-btn {
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font);
  color: #fff !important;
  background: linear-gradient(135deg, #2997ff 0%, #0071e3 100%) !important;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.25s, opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(41,151,255,0.25);
  position: relative;
  overflow: hidden;
}

.auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(41,151,255,0.35);
}
.auth-btn:active { transform: scale(0.98); }
.auth-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Spinner ────────────────────────────────────────────────────────────── */
.auth-spinner {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: authSpin 0.6s linear infinite;
}
@keyframes authSpin { to { transform: rotate(360deg); } }

/* ── Error message ──────────────────────────────────────────────────────── */
.auth-error {
  font-size: 14px;
  color: #ff453a !important;
  text-align: center;
  display: none;
  padding: 10px 14px;
  background: rgba(255,69,58,0.1) !important;
  border-radius: 10px;
  border: 1px solid rgba(255,69,58,0.25);
  line-height: 1.4;
}

/* ── Toggle / forgot-password link ──────────────────────────────────────── */
.auth-toggle {
  text-align: center;
  font-size: 14px;
  color: #86868b;
  margin-top: 8px;
}

.auth-toggle a {
  color: #2997ff !important;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.auth-toggle a:hover { opacity: 0.8; text-decoration: underline; }

/* ── Progressive disclosure steps with slide transitions ────────────────── */
.auth-step {
  display: none;
  flex-direction: column;
  gap: 16px;
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-step.active {
  display: flex;
  opacity: 1;
  transform: translateX(0);
}

/* Animate in after a frame so the transition fires */
.auth-step.slide-in {
  opacity: 1;
  transform: translateX(0);
}

/* ── Back button ────────────────────────────────────────────────────────── */
.auth-back {
  font-size: 14px;
  color: #86868b !important;
  background: none !important;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}
.auth-back:hover { color: #f5f5f7 !important; }
.auth-back svg { color: #86868b !important; }
.auth-back:hover svg { color: #f5f5f7 !important; }

/* ── Email display badge ────────────────────────────────────────────────── */
.auth-email-display {
  font-size: 14px;
  color: #f5f5f7 !important;
  font-weight: 500;
  text-align: center;
  padding: 8px 14px;
  background: rgba(41,151,255,0.1) !important;
  border: 1px solid rgba(41,151,255,0.2);
  border-radius: 10px;
  margin-bottom: 4px;
}

/* ── Footer (terms / privacy) ───────────────────────────────────────────── */
.auth-footer {
  text-align: center;
  margin-top: 28px;
  font-size: 13px;
  color: rgba(134,134,139,0.6) !important;
  line-height: 1.5;
}

.auth-footer a {
  color: rgba(134,134,139,0.6) !important;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}
.auth-footer a:hover { color: #86868b !important; }

/* ── Password strength indicator ────────────────────────────────────────── */
.password-strength {
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.08) !important;
  margin-top: 4px;
  overflow: hidden;
}

.password-strength-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s, background 0.3s;
  width: 0%;
}

/* ── Verification step inline overrides ─────────────────────────────────── */
#stepVerify .auth-form { text-align: center; }
#stepVerify .auth-form div { color: #86868b; }
#stepVerify .auth-form strong { color: #f5f5f7 !important; }

/* ── Force dark nav on auth page (page bg is always dark) ───────────────── */
.auth-page ~ script,
body:has(.auth-page) .nav {
  background: rgba(0, 0, 0, 0.6) !important;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: rgba(255,255,255,0.06) !important;
}
body:has(.auth-page) .nav * {
  background: transparent !important;
}
body:has(.auth-page) .nav-logo,
body:has(.auth-page) .nav-name {
  color: #f5f5f7 !important;
}
body:has(.auth-page) .nav-links a {
  color: #86868b !important;
}
body:has(.auth-page) .nav-links a:hover {
  color: #f5f5f7 !important;
}
body:has(.auth-page) .nav-cta {
  background: #f5f5f7 !important;
  color: #000 !important;
}
body:has(.auth-page) #theme-toggle {
  background: rgba(255,255,255,0.08) !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: #f5f5f7 !important;
}
body:has(.auth-page) .lang-toggle {
  background: rgba(255,255,255,0.08) !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: #86868b !important;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-card {
    padding: 32px 24px;
    border-radius: 16px;
  }
  .auth-page::before { width: 300px; height: 300px; }
  .auth-page::after  { width: 250px; height: 250px; }
}
