/* Enhanced Auth CSS */
:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --success-color: #4ade80;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --glass-bg: rgba(255, 255, 255, 0.25);
  --glass-border: rgba(255, 255, 255, 0.18);
  --shadow-soft: 0 8px 32px rgba(31, 38, 135, 0.37);
  --shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.15);
  --border-radius: 16px;
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base styles */
.auth-page {
  min-height: 100vh;
  position: relative;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  overflow: hidden;
}

/* Animated Background */
.background-animation {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.floating-orb {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  animation: float 6s ease-in-out infinite;
}

.orb-1 {
  width: 100px;
  height: 100px;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.orb-2 {
  width: 60px;
  height: 60px;
  top: 20%;
  right: 20%;
  animation-delay: 1s;
}

.orb-3 {
  width: 80px;
  height: 80px;
  bottom: 30%;
  left: 15%;
  animation-delay: 2s;
}

.orb-4 {
  width: 120px;
  height: 120px;
  bottom: 10%;
  right: 10%;
  animation-delay: 3s;
}

.orb-5 {
  width: 40px;
  height: 40px;
  top: 60%;
  right: 40%;
  animation-delay: 4s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  33% {
    transform: translateY(-30px) rotate(120deg);
  }
  66% {
    transform: translateY(-60px) rotate(240deg);
  }
}

/* Login Container */
.login-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1000px;
  animation-duration: 1s;
  animation-delay: 0.3s;
}

/* Login Card */
.login-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 600px;
  transition: var(--transition);
}

.login-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-strong);
}

/* Left Side - Branding */
.login-left {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.9) 0%,
    rgba(118, 75, 162, 0.9) 100%
  );
  padding: 3rem;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.login-left::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: shimmer 3s ease-in-out infinite;
  transform: rotate(45deg);
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

.brand-section {
  position: relative;
  z-index: 2;
  color: white;
  text-align: center;
  width: 100%;
}

.brand-logo {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  animation: brandPulse 2s ease-in-out infinite;
}

@keyframes brandPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.brand-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
}

.brand-subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 2rem;
}

/* Features Showcase */
.features-showcase {
  text-align: left;
  margin-top: 2rem;
}

.feature-item {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: featureSlideIn 0.6s ease-out forwards;
}

.feature-item:nth-child(1) {
  animation-delay: 0.5s;
}
.feature-item:nth-child(2) {
  animation-delay: 0.7s;
}
.feature-item:nth-child(3) {
  animation-delay: 0.9s;
}

@keyframes featureSlideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.feature-icon {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  font-size: 1.2rem;
  transition: var(--transition);
}

.feature-item:hover .feature-icon {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.feature-text strong {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.feature-text span {
  opacity: 0.8;
  font-size: 0.9rem;
}

/* Right Side - Form */
.login-right {
  padding: 3rem;
  display: flex;
  align-items: center;
  background: white;
}

.form-container {
  width: 100%;
}

/* Form Header */
.form-header {
  text-align: center;
  margin-bottom: 2rem;
}

.form-header h2 {
  color: var(--text-primary);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.form-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Form Styles */
.login-form {
  width: 100%;
}

.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

/* Enhanced Floating Labels */
.form-floating {
  position: relative;
}

.form-floating .form-control {
  height: 60px;
  background: rgba(248, 250, 252, 0.8);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 1rem 1rem 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: #54575c;
  transition: var(--transition);
}

.form-floating .form-control:focus {
  background: white;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
}

.form-floating label {
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: var(--transition);
}

.form-floating .form-control:focus + label,
.form-floating .form-control:not(:placeholder-shown) + label {
  opacity: 0.8;
  transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

/* Password Toggle */
.password-toggle {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 5;
  padding: 5px;
  border-radius: 6px;
  transition: var(--transition);
}

.password-toggle:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
}

/* Form Options */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.form-check {
  display: flex;
  align-items: center;
}

.form-check-input {
  width: 18px;
  height: 18px;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  margin-right: 0.5rem;
  transition: var(--transition);
}

.form-check-input:checked {
  background: #667eea;
  border-color: #667eea;
}

.form-check-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.forgot-password {
  color: #667eea;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.forgot-password:hover {
  color: #5a52d5;
  text-decoration: underline;
}

/* Login Button */
.btn-login {
  width: 100%;
  height: 56px;
  background: var(--primary-gradient);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  margin-bottom: 1.5rem;
}

.btn-login::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.6s;
}

.btn-login:hover::before {
  left: 100%;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-login:active {
  transform: translateY(0);
}

.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-content,
.btn-loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Form Footer */
.form-footer {
  text-align: center;
  color: var(--text-secondary);
}

.form-footer p {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.register-link {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.register-link:hover {
  color: #5a52d5;
  text-decoration: underline;
}

.security-notice {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-top: 1rem;
}

/* Loading States */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .login-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .login-left {
    padding: 2rem;
    min-height: 300px;
  }

  .brand-title {
    font-size: 2rem;
  }

  .features-showcase {
    display: none;
  }

  .login-right {
    padding: 2rem;
  }

  .form-header h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .auth-page {
    padding: 1rem 0.5rem;
  }

  .login-left,
  .login-right {
    padding: 1.5rem;
  }

  .form-floating .form-control {
    height: 56px;
  }

  .btn-login {
    height: 50px;
    font-size: 1rem;
  }
}

/* Notification Styles */
.flash-messages {
  margin-bottom: 1rem;
}

.alert {
  /* Add position relative to contain the progress bar */
  position: relative;
  border: none;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border-left: 4px solid;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  overflow: hidden; /* Ensures the bar doesn't overflow */
}

.alert-icon {
  font-size: 1.2rem;
  margin-top: 0.125rem;
}

.alert-content {
  font-weight: 500;
  line-height: 1.5;
}

.alert-success {
  background: rgba(72, 187, 120, 0.1);
  color: #065f46;
  border-left-color: #10b981;
}

.alert-success .alert-icon {
  color: #10b981;
}

.alert-danger,
.alert-error {
  background: rgba(239, 68, 68, 0.1);
  color: #7f1d1d;
  border-left-color: #ef4444;
}

.alert-danger .alert-icon,
.alert-error .alert-icon {
  color: #ef4444;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #78350f;
  border-left-color: #f59e0b;
}

.alert-warning .alert-icon {
  color: #f59e0b;
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  color: #1e3a8a;
  border-left-color: #3b82f6;
}

.alert-info .alert-icon {
  color: #3b82f6;
}

/* Flash Message Progress Bar */
/* Reusing the same styling as toasts for consistency */
.alert .toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.1);
}

.alert .toast-progress .progress-bar {
  height: 100%;
  transition: none; /* We will use a keyframe animation instead */
  animation: toast-progress 5000ms linear forwards; /* 5s duration */
}

/* Toast Notifications */
.toast {
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(20px);
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.toast-header {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-weight: 600;
}

.toast-body {
  background: rgba(255, 255, 255, 0.95);
  font-weight: 500;
}

/* Toast Progress Bar */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.1);
}

.toast-progress .progress-bar {
  height: 100%;
  transition: none;
  /* Keyframe animation will be added via JS */
}

/* Animation for the progress bar */
@keyframes toast-progress {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}
