/* ===== Auth Page Styles ===== */
.auth-page {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 24px;
  position: relative; overflow: hidden;
}
.auth-page::before {
  content: ''; position: absolute;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 30%, var(--primary-muted) 0%, transparent 50%),
              radial-gradient(circle at 70% 70%, rgba(99, 102, 241, 0.06) 0%, transparent 40%);
  animation: authBgPulse 8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes authBgPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}
.auth-logo {
  width: 80px; height: 80px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; margin-bottom: 24px;
  position: relative; z-index: 1;
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3);
  animation: authLogoFloat 3s ease-in-out infinite, authLogoGlow 2s ease-in-out infinite alternate;
}
@keyframes authLogoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes authLogoGlow {
  from { box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3); }
  to { box-shadow: 0 12px 40px rgba(99, 102, 241, 0.5); }
}
.auth-logo::after {
  content: ''; position: absolute; inset: -4px;
  border-radius: 28px; border: 2px solid var(--primary-light);
  opacity: 0; animation: authLogoRing 2s ease-out infinite;
}
@keyframes authLogoRing {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.3); opacity: 0; }
}
.auth-logo::before {
  content: ''; position: absolute; inset: -8px;
  border-radius: 32px; border: 1.5px solid var(--primary-light);
  opacity: 0; animation: authLogoRing2 3s ease-out infinite;
}
@keyframes authLogoRing2 {
  0% { transform: scale(0.85); opacity: 0.5; }
  100% { transform: scale(1.4); opacity: 0; }
}
.auth-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.auth-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 32px; }
.auth-form { width: 100%; max-width: 320px; }
.auth-input {
  width: 100%; padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px; font-size: 16px;
  background: var(--card-bg); color: var(--text-primary);
  outline: none; text-align: center;
  letter-spacing: 4px; -webkit-text-security: disc;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-muted), 0 0 16px rgba(99, 102, 241, 0.1);
}
.auth-btn {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; border: none;
  border-radius: 14px; font-size: 16px; font-weight: 600;
  cursor: pointer; margin-top: 16px;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.auth-btn:active { transform: scale(0.98); box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2); }
.auth-btn:disabled { opacity: 0.6; }
.auth-error { font-size: 13px; color: var(--error); margin-top: 12px; text-align: center; min-height: 20px; }

/* Auth Page AI Network Background */
.auth-page .auth-network-bg {
  position: absolute; inset: 0;
  overflow: hidden; pointer-events: none; z-index: 0;
}
.auth-page .auth-network-bg svg { width: 100%; height: 100%; opacity: 0.15; }
@media (prefers-color-scheme: dark) {
  .auth-page .auth-network-bg svg { opacity: 0.2; }
}
.auth-page > *:not(.auth-network-bg) { position: relative; z-index: 1; }
.auth-branding {
  font-size: 12px; color: var(--text-muted);
  margin-top: 24px; letter-spacing: 1px; opacity: 0.7;
}
.auth-branding span {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; font-weight: 700;
}

/* Auth Transition */
.auth-page.fade-out { animation: authFadeOut 0.5s ease forwards; }
@keyframes authFadeOut { to { opacity: 0; transform: scale(0.96); } }
#mainApp.fade-in { animation: mainFadeIn 0.5s ease forwards; }
@keyframes mainFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
