/* ========================================
   FinanceFlow — Auth Pages Styles
   ======================================== */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

/* Animated background */
.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.auth-bg .gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: float 8s ease-in-out infinite;
}

.auth-bg .orb-1 {
  width: 400px;
  height: 400px;
  background: var(--primary);
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.auth-bg .orb-2 {
  width: 300px;
  height: 300px;
  background: var(--accent);
  bottom: -80px;
  left: -80px;
  animation-delay: 2s;
}

.auth-bg .orb-3 {
  width: 250px;
  height: 250px;
  background: #8b5cf6;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 4s;
  opacity: 0.25;
}

[data-theme="dark"] .auth-bg .gradient-orb {
  opacity: 0.3;
}

/* Auth container */
.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  padding: 20px;
  animation: fadeInUp 0.6s ease;
}

/* Logo */
.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo .logo-icon {
  width: 56px;
  height: 56px;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px var(--primary-glow);
}

.auth-logo h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

.auth-logo h1 span {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-logo p {
  color: var(--text-tertiary);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* Auth card */
.auth-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-xl);
}

[data-theme="dark"] .auth-card {
  background: rgba(17, 24, 39, 0.8);
  border-color: rgba(51, 65, 85, 0.4);
}

.auth-card h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.auth-card .auth-subtitle {
  color: var(--text-tertiary);
  font-size: 0.875rem;
  margin-bottom: 28px;
}

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

.auth-form .form-group {
  position: relative;
}

.auth-form .form-input {
  width: 100%;
  padding: 14px 16px 14px 46px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
}

.auth-form .input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 1.05rem;
  transition: color var(--transition-fast);
  pointer-events: none;
  z-index: 1;
}

.auth-form .form-input:focus + .input-icon,
.auth-form .form-input:focus ~ .input-icon {
  color: var(--primary);
}

.auth-form .toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  transition: color var(--transition-fast);
  z-index: 1;
}

.auth-form .toggle-password:hover {
  color: var(--primary);
}

/* With label */
.auth-form .form-group.has-label .form-input {
  margin-top: 6px;
}

.auth-form .form-group.has-label .input-icon {
  top: calc(50% + 12px);
}

.auth-form .form-group.has-label .toggle-password {
  top: calc(50% + 12px);
}

/* Password strength */
.password-strength {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.password-strength .strength-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-tertiary);
  transition: background var(--transition-fast);
}

.password-strength[data-strength="1"] .strength-bar:nth-child(1) { background: var(--danger); }
.password-strength[data-strength="2"] .strength-bar:nth-child(-n+2) { background: var(--warning); }
.password-strength[data-strength="3"] .strength-bar:nth-child(-n+3) { background: var(--warning-light); }
.password-strength[data-strength="4"] .strength-bar { background: var(--success); }

.strength-text {
  font-size: 0.75rem;
  margin-top: 4px;
  color: var(--text-tertiary);
}

/* Form extras */
.form-extras {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-secondary);
}

.remember-me input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.forgot-password {
  color: var(--primary);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.forgot-password:hover {
  color: var(--primary-light);
}

/* Submit button */
.auth-form .btn-submit {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  margin-top: 4px;
  position: relative;
}

.btn-submit .btn-text { transition: opacity var(--transition-fast); }
.btn-submit.loading .btn-text { opacity: 0; }
.btn-submit .spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-top-color: white;
  display: none;
}
.btn-submit.loading .spinner { display: block; }

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-tertiary);
  font-size: 0.8rem;
  margin: 4px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

/* Auth footer */
.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--primary);
  font-weight: 600;
  transition: color var(--transition-fast);
}

.auth-footer a:hover {
  color: var(--primary-light);
}

/* Theme toggle in auth */
.auth-theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10;
}

/* Field validation styles */
.field-error {
  font-size: 0.78rem;
  color: var(--danger);
  margin-top: 4px;
  display: none;
  align-items: center;
  gap: 4px;
}

.field-error.visible {
  display: flex;
}

/* Responsive */
@media (max-width: 480px) {
  .auth-container { padding: 16px; }
  .auth-card { padding: 28px 24px; }
  .auth-logo h1 { font-size: 1.5rem; }
  .form-extras { flex-direction: column; gap: 12px; align-items: flex-start; }
}
