/* =====================================================
   🍎 AUTH.CSS - Apple-Style Authentication Pages
   Professioneel | Glassmorphism | Dark/Light Mode
   ===================================================== */

/* =====================================================
   1. CSS VARIABLES - Light & Dark Mode
   ===================================================== */
:root {
  /* Light Mode Colors */
  --auth-bg-primary: #f5f7fa;
  --auth-bg-secondary: #ffffff;
  --auth-text-primary: #1d1d1f;
  --auth-text-secondary: #6e6e73;
  --auth-text-muted: #86868b;
  
  /* Glass Effect */
  --auth-glass-bg: rgba(255, 255, 255, 0.75);
  --auth-glass-border: rgba(255, 255, 255, 0.18);
  --auth-glass-shadow: rgba(0, 0, 0, 0.1);
  
  /* Accent Colors - Welzorg Paars als primary */
  --auth-primary: var(--welzorg-purple);
  --auth-primary-hover: #3d3385;
  --auth-danger: #dc3545;
  --auth-success: #198754;
  --auth-warning: #ffc107;
  
  /* Input Colors - met Welzorg paars focus */
  --auth-input-bg: rgba(255, 255, 255, 0.5);
  --auth-input-border: rgba(0, 0, 0, 0.1);
  --auth-input-focus: rgba(74, 63, 158, 0.25);
  --auth-input-text: #1d1d1f;
  --auth-input-placeholder: rgba(0, 0, 0, 0.4);
  
  /* Neutrale achtergrond - grijs */
  --auth-gradient: linear-gradient(180deg, #f5f7fa 0%, #e8ecef 100%);
  --auth-gradient-subtle: linear-gradient(135deg, rgba(0, 0, 0, 0.02) 0%, rgba(0, 0, 0, 0.005) 100%);
}

[data-bs-theme="dark"] {
  /* Dark Mode Colors */
  --auth-bg-primary: #000000;
  --auth-bg-secondary: #1c1c1e;
  --auth-text-primary: #f5f5f7;
  --auth-text-secondary: #a1a1a6;
  --auth-text-muted: #6e6e73;
  
  /* Glass Effect */
  --auth-glass-bg: rgba(28, 28, 30, 0.75);
  --auth-glass-border: rgba(255, 255, 255, 0.12);
  --auth-glass-shadow: rgba(0, 0, 0, 0.5);
  
  /* Input Colors - met Welzorg paars focus */
  --auth-input-bg: rgba(255, 255, 255, 0.05);
  --auth-input-border: rgba(255, 255, 255, 0.12);
  --auth-input-focus: rgba(74, 63, 158, 0.35);
  --auth-input-text: #f5f5f7;
  --auth-input-placeholder: rgba(255, 255, 255, 0.3);
  
  /* Neutrale achtergrond - zwart */
  --auth-gradient: linear-gradient(180deg, #000000 0%, #0a0a0a 100%);
  --auth-gradient-subtle: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
}

/* Welzorg Brand Kleuren - Globaal voor light & dark mode */
:root,
[data-bs-theme="dark"] {
  --welzorg-purple: #4a3f9e;
  --welzorg-yellow: #f9b233;
}

/* =====================================================
   2. BODY & BACKGROUND - Animated Gradient
   ===================================================== */
.login-body {
  min-height: 100vh;
  background: var(--auth-bg-primary);
  position: relative;
  overflow: hidden;
  padding: 2rem 0;
}

/* Animated Background - Neutraal met duidelijke paars + geel border (geen glow) */
.login-body::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: var(--auth-gradient-subtle);
  opacity: 1;
  animation: gradientShift 30s ease infinite;
  z-index: 0;
  /* Paars en geel naast elkaar, duidelijk zonder glow */
  border: 4px solid;
  border-image: linear-gradient(
    90deg, 
    var(--welzorg-purple) 0%, 
    var(--welzorg-purple) 50%, 
    var(--welzorg-yellow) 50%, 
    var(--welzorg-yellow) 100%
  ) 1;
  border-radius: 20px;
}

@keyframes gradientShift {
  0%, 100% { 
    transform: translate(0, 0) rotate(0deg);
  }
  33% { 
    transform: translate(3%, 3%) rotate(120deg);
  }
  66% { 
    transform: translate(-3%, 3%) rotate(240deg);
  }
}

/* Floating Orbs - Neutraal grijs, alleen in light mode */
.login-body::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.03) 0%, transparent 70%);
  border-radius: 50%;
  top: 15%;
  right: 10%;
  animation: float 20s ease-in-out infinite;
  z-index: 0;
}

/* Orb uitschakelen in dark mode */
[data-bs-theme="dark"] .login-body::after {
  display: none;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -20px) scale(1.05); }
}

.login-body .container {
  position: relative;
  z-index: 1;
}

/* =====================================================
   3. CARD STYLING - Glassmorphism Enhanced
   ===================================================== */
.auth-card {
  background: var(--auth-glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--auth-glass-border);
  border-radius: 20px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: cardSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-card:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 12px 48px rgba(0, 0, 0, 0.15),
    0 4px 16px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.auth-card .card-body {
  padding: 2.5rem;
}

/* =====================================================
   4. HEADER STYLING - Logo & Title
   ===================================================== */
.login-header {
  text-align: center;
  margin-bottom: 2rem;
  animation: headerFadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s backwards;
}

@keyframes headerFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-header img {
  max-height: 180px;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
  transition: transform 0.3s ease;
}

.login-header img:hover {
  transform: scale(1.05);
}

.login-header h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--auth-text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.login-header p {
  color: var(--auth-text-secondary);
  font-size: 0.95rem;
  font-weight: 400;
}

.icon-wrapper {
  width: 56px;
  height: 56px;
  background: var(--auth-gradient-subtle);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
}

.icon-wrapper:hover {
  transform: rotate(5deg) scale(1.05);
}

.icon-wrapper i {
  font-size: 1.5rem;
  color: var(--auth-primary);
}

/* =====================================================
   5. FORM INPUTS - Enhanced Glassmorphism
   ===================================================== */
.form-label {
  color: var(--auth-text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}

.form-control,
.input-group .form-control {
  background: var(--auth-input-bg);
  backdrop-filter: blur(10px);
  border: 1.5px solid var(--auth-input-border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: var(--auth-input-text);
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.form-control::placeholder {
  color: var(--auth-input-placeholder);
}

.form-control:focus {
  background: var(--auth-input-bg);
  border-color: var(--auth-primary);
  box-shadow: 
    0 0 0 4px var(--auth-input-focus),
    0 4px 16px rgba(0, 0, 0, 0.08);
  outline: none;
  transform: translateY(-1px);
}

/* Input Groups */
.input-group {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-group:focus-within {
  box-shadow: 
    0 0 0 4px var(--auth-input-focus),
    0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.input-group-text {
  background: var(--auth-input-bg);
  backdrop-filter: blur(10px);
  border: 1.5px solid var(--auth-input-border);
  border-right: none;
  color: var(--auth-text-secondary);
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.input-group .form-control {
  border-left: none;
  box-shadow: none;
}

.input-group:focus-within .input-group-text {
  border-color: var(--auth-primary);
  color: var(--auth-primary);
}

/* Password Toggle Button */
#togglePassword {
  background: var(--auth-input-bg);
  backdrop-filter: blur(10px);
  border: 1.5px solid var(--auth-input-border);
  border-left: none;
  color: var(--auth-text-secondary);
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

#togglePassword:hover {
  color: var(--auth-primary);
  background: rgba(13, 110, 253, 0.08);
}

.input-group:focus-within #togglePassword {
  border-color: var(--auth-primary);
}

/* Invalid Feedback */
.invalid-feedback {
  color: var(--auth-danger);
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: block;
  animation: shake 0.4s;
}

.form-control.is-invalid {
  border-color: var(--auth-danger);
  box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.15);
}

/* =====================================================
   6. BUTTONS - Apple Style Enhanced
   ===================================================== */
.btn-apple {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Button Ripple Effect */
.btn-apple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-apple:active::before {
  width: 300px;
  height: 300px;
}

/* Primary Button */
.btn-apple.primary {
  background: var(--auth-primary);
  color: white;
}

.btn-apple.primary:hover {
  background: var(--auth-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(74, 63, 158, 0.4);
}

.btn-apple.primary:active {
  transform: translateY(0);
}

/* Secondary Button */
.btn-apple.secondary {
  background: var(--auth-input-bg);
  backdrop-filter: blur(10px);
  color: var(--auth-text-primary);
  border: 1.5px solid var(--auth-input-border);
}

.btn-apple.secondary:hover {
  background: var(--auth-glass-bg);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Button Disabled State */
.btn-apple:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* =====================================================
   7. PASSWORD STRENGTH INDICATOR
   ===================================================== */
.progress {
  height: 4px;
  background: var(--auth-input-bg);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.progress-bar {
  transition: width 0.4s ease, background-color 0.4s ease;
  border-radius: 2px;
}

/* Strength Colors */
.strength-weak { background: var(--auth-danger); }
.strength-medium { background: var(--auth-warning); }
.strength-strong { background: var(--auth-success); }

/* Password Requirements */
.requirement {
  font-size: 0.85rem;
  color: var(--auth-text-muted);
  margin-top: 0.25rem;
  transition: color 0.3s ease;
}

.requirement i {
  font-size: 0.75rem;
  margin-right: 0.25rem;
  transition: all 0.3s ease;
}

.requirement.met {
  color: var(--auth-success);
}

.requirement.met i {
  color: var(--auth-success);
}

.requirement.met i::before {
  content: "\f058"; /* fa-check-circle */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
}

/* =====================================================
   8. CAPS LOCK WARNING
   ===================================================== */
#capsLockWarning {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =====================================================
   9. ANIMATIONS - Shake & Pulse
   ===================================================== */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
  20%, 40%, 60%, 80% { transform: translateX(8px); }
}

.shake-animation {
  animation: shake 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.pulse-animation {
  animation: pulse 0.6s ease;
}

/* =====================================================
   10. LINKS & TEXT
   ===================================================== */
a {
  color: var(--auth-primary);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--auth-primary);
  transition: width 0.3s ease;
}

a:hover::after {
  width: 100%;
}

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

.text-muted {
  color: var(--auth-text-muted) !important;
}

/* =====================================================
   11. RESPONSIVE DESIGN
   ===================================================== */
@media (max-width: 768px) {
  .login-body {
    padding: 1rem 0;
  }
  
  .auth-card .card-body {
    padding: 1.5rem;
  }
  
  .login-header h2 {
    font-size: 1.5rem;
  }
  
  .btn-apple {
    padding: 0.65rem 1.25rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 576px) {
  .login-header img {
    max-height: 120px;
  }
  
  .icon-wrapper {
    width: 48px;
    height: 48px;
  }
  
  .icon-wrapper i {
    font-size: 1.25rem;
  }
}

/* =====================================================
   12. ACCESSIBILITY
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus Visible for Keyboard Navigation */
*:focus-visible {
  outline: 3px solid var(--auth-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =====================================================
   13. UTILITY CLASSES
   ===================================================== */
.glass-card {
  background: var(--auth-glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--auth-glass-border);
  box-shadow: 0 8px 32px var(--auth-glass-shadow);
}

.fade-in {
  animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slide-up {
  animation: slideUp 0.6s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
