/* ═══════════════════════════════════════════════════════════════
   Company Auth Portal — Styles (Rebuilt)
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #111127;
  --bg-card: rgba(17, 17, 39, 0.65);
  --text-primary: #f0f0ff;
  --text-secondary: #a0a0c0;
  --text-muted: #6b6b8d;
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-glow: rgba(99, 102, 241, 0.35);
  --success: #34d399;
  --error: #f87171;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(99, 102, 241, 0.3);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 50%;
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
}

/* ── Canvas ────────────────────────────────────────────────── */
#particle-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ── Screens ───────────────────────────────────────────────── */
.screen {
  position: fixed; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  opacity: 0; pointer-events: none;
  transform: translateX(40px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}
.screen.active-screen {
  opacity: 1; pointer-events: all; transform: translateX(0);
}

/* ── Glass Card ────────────────────────────────────────────── */
.glass-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%; max-width: 420px;
  overflow: hidden;
}
.card-glow {
  position: absolute; top: -80px; left: 50%; transform: translateX(-50%);
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}
.glass-card > *:not(.card-glow) { position: relative; z-index: 1; }

/* ── Logo ──────────────────────────────────────────────────── */
.logo-container { text-align: center; margin-bottom: 1.5rem; }
.logo-icon {
  width: 64px; height: 64px; margin: 0 auto 1rem;
  animation: float 4s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.logo-icon svg { width: 100%; height: 100%; filter: drop-shadow(0 4px 12px var(--accent-glow)); }
.logo-title {
  font-size: 1.75rem; font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.logo-subtitle { font-size: 0.875rem; color: var(--text-secondary); margin-top: 0.25rem; }

/* ── Step Header ───────────────────────────────────────────── */
.step-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.step-title { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.step-email { font-size: 0.875rem; color: var(--accent-primary); margin-top: 2px; }
.step-subtitle { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.btn-back {
  width: 36px; height: 36px; border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle); background: rgba(255,255,255,0.04);
  color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition-fast); flex-shrink: 0;
}
.btn-back svg { width: 18px; height: 18px; }
.btn-back:hover { border-color: var(--border-accent); color: var(--accent-primary); background: rgba(99,102,241,0.08); }
.icon-2fa { flex-shrink: 0; width: 48px; height: 48px; }
.icon-2fa svg { width: 100%; height: 100%; }

/* ── Divider ───────────────────────────────────────────────── */
.divider { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.divider-line { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--border-accent), transparent); }
.divider-text { font-size: 0.7rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0.15em; }

/* ── Inputs ────────────────────────────────────────────────── */
.input-group { margin-bottom: 1.5rem; }
.input-label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 0.5rem; }
.input-wrapper {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0 1rem; height: 52px;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  background: rgba(255,255,255,0.03);
  transition: all var(--transition-base);
}
.input-wrapper:focus-within { border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.input-icon { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.input-field {
  flex: 1; background: none; border: none; outline: none;
  font-family: var(--font-family); font-size: 1rem; color: var(--text-primary);
}
.input-field::placeholder { color: var(--text-muted); }
.btn-toggle-pw {
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  display: flex; align-items: center; padding: 4px;
  transition: color var(--transition-fast);
}
.btn-toggle-pw:hover { color: var(--accent-primary); }
.btn-toggle-pw svg { width: 20px; height: 20px; }
.hidden-icon { display: none; }

/* ── OTP Inputs ────────────────────────────────────────────── */
.otp-container { display: flex; gap: 0.5rem; justify-content: center; }
.otp-input {
  width: 48px; height: 56px; text-align: center;
  font-family: var(--font-family); font-size: 1.5rem; font-weight: 600;
  color: var(--text-primary); background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  outline: none; transition: all var(--transition-base);
}
.otp-input:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }

/* ── Primary Button ────────────────────────────────────────── */
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; padding: 14px 1.5rem;
  border: none; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff; font-family: var(--font-family); font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition-base);
  box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(99,102,241,0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-arrow { width: 18px; height: 18px; }

/* ── Success Screen ────────────────────────────────────────── */
.auth-card { text-align: center; }
.auth-success-icon { width: 72px; height: 72px; margin: 0 auto 1.5rem; }
.auth-success-icon svg { width: 100%; height: 100%; }
#checkmark-path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw-check 0.6s 0.3s ease forwards; }
@keyframes draw-check { to { stroke-dashoffset: 0; } }
.auth-title {
  font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--success), var(--accent-primary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.success-email { font-size: 1rem; color: var(--accent-primary); font-weight: 500; }
.success-detail { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; margin-bottom: 1.5rem; }
.redirect-notice {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  color: var(--text-secondary); font-size: 0.875rem;
}
.redirect-spinner {
  width: 16px; height: 16px; border: 2px solid var(--border-subtle);
  border-top-color: var(--accent-primary); border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Loading Overlay ───────────────────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(10,10,26,0.85); backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none; transition: opacity var(--transition-slow);
}
.loading-overlay.active { opacity: 1; pointer-events: all; }
.loader-ring { width: 48px; height: 48px; position: relative; }
.loader-ring div {
  position: absolute; width: 48px; height: 48px; border-radius: var(--radius-full);
  border: 3px solid transparent; border-top-color: var(--accent-primary);
  animation: spin 1.2s cubic-bezier(0.5,0,0.5,1) infinite;
}
.loader-ring div:nth-child(1) { animation-delay: -0.45s; }
.loader-ring div:nth-child(2) { animation-delay: -0.3s; border-top-color: var(--accent-secondary); }
.loader-ring div:nth-child(3) { animation-delay: -0.15s; border-top-color: var(--success); }
.loader-text {
  margin-top: 1.5rem; color: var(--text-secondary); font-size: 0.875rem;
  letter-spacing: 0.05em; animation: pulse-text 2s ease-in-out infinite;
}
@keyframes pulse-text { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* ── Toast ─────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 2rem; left: 50%;
  transform: translateX(-50%) translateY(120%);
  display: flex; align-items: center; gap: 0.5rem;
  padding: 1rem 1.5rem; border-radius: var(--radius-md);
  font-size: 0.875rem; font-weight: 500; z-index: 2000;
  transition: transform var(--transition-base); pointer-events: none; max-width: 90%;
}
.toast.visible { transform: translateX(-50%) translateY(0); pointer-events: all; }
.toast-error {
  background: rgba(248,113,113,0.15); border: 1px solid rgba(248,113,113,0.3);
  color: var(--error); backdrop-filter: blur(12px);
}
.toast-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 480px) {
  .glass-card { padding: 2rem 1.5rem; border-radius: var(--radius-md); }
  .otp-input { width: 40px; height: 48px; font-size: 1.25rem; }
  .option-card { padding: 0.875rem 1rem; }
}

/* ── 2FA Options List ──────────────────────────────────────── */
.options-list { display: flex; flex-direction: column; gap: 0.625rem; }
.option-card {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  background: rgba(255,255,255,0.02); cursor: pointer;
  transition: all var(--transition-base);
}
.option-card:hover {
  border-color: var(--border-accent); background: rgba(99,102,241,0.06);
  transform: translateX(4px);
}
.option-card:active { transform: translateX(2px); }
.option-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(99,102,241,0.1); color: var(--accent-primary);
}
.option-icon svg { width: 22px; height: 22px; }
.option-text { flex: 1; }
.option-title { font-size: 0.9rem; font-weight: 500; color: var(--text-primary); line-height: 1.4; }
.option-arrow {
  width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0;
  transition: color var(--transition-fast);
}
.option-card:hover .option-arrow { color: var(--accent-primary); }

/* ── Device Waiting ────────────────────────────────────────── */
.device-waiting { text-align: center; padding: 1rem 0; }
.device-icon { width: 64px; height: 64px; margin: 0 auto 1.5rem; animation: float 4s ease-in-out infinite; }
.device-icon svg { width: 100%; height: 100%; }
.device-text { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 1.5rem; line-height: 1.5; }
.device-spinner {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  color: var(--text-muted); font-size: 0.85rem;
}
