body {
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 26%),
              radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.10), transparent 22%),
              #0f172a;
  color: #e2e8f0;
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.login-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.loginform {
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.35);
  border-radius: 2rem;
  padding: 2rem;
  margin: 0 auto;
  max-width: 28rem;
}

/* Model fallback styling */
.model-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #e2e8f0;
  text-align: center;
  padding: 20px;
}

.fallback-icon {
  font-size: 3rem;
  margin-bottom: 10px;
  opacity: 0.8;
}

.model-fallback p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Advanced Features CSS */

/* Dark Mode */
.dark-mode {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #f1f5f9;
}

.dark-mode .login-container {
  background: rgba(15, 23, 42, 0.95);
}

.dark-mode .stat-item,
.dark-mode .feature-card {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(71, 85, 105, 0.3);
}

.dark-mode .quick-link.secondary {
  background: rgba(51, 65, 85, 0.8);
  border-color: rgba(71, 85, 105, 0.3);
}

/* Dark Mode Toggle */
.dark-mode-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.9);
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Keyboard Navigation */
.keyboard-navigation *:focus {
  outline: 2px solid #3b82f6 !important;
  outline-offset: 2px !important;
}

/* High Contrast Mode */
.high-contrast {
  filter: contrast(1.5);
}

.high-contrast .stat-number {
  color: #ffffff !important;
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Notifications */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  max-width: 400px;
  padding: 16px 20px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInRight 0.3s ease;
}

.notification-success {
  background: #10b981;
  color: white;
}

.notification-error {
  background: #ef4444;
  color: white;
}

.notification-warning {
  background: #f59e0b;
  color: white;
}

.notification-info {
  background: #3b82f6;
  color: white;
}

.notification-icon {
  font-size: 1.2rem;
  font-weight: bold;
}

.notification-text {
  flex: 1;
  font-size: 0.9rem;
}

.notification-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.notification-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Loading States */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* PWA Install Prompt */
.install-prompt {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: rgba(59, 130, 246, 0.95);
  color: white;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.install-prompt button {
  background: white;
  color: #3b82f6;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
}

.install-prompt .dismiss {
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: underline;
}

/* Stats Section */
.login-stats-section {
  text-align: center;
  margin: 2rem 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.stat-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: #3b82f6;
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

.stat-label {
  color: #cbd5e1;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Features Section */
.login-features-section {
  text-align: center;
  margin: 3rem 0;
}

.login-features-section h3 {
  font-size: 1.8rem;
  margin-bottom: 2rem;
  color: #f8fafc;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

.feature-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.2);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.feature-card h4 {
  color: #f8fafc;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.feature-card p {
  color: #cbd5e1;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Testimonials Section */
.login-testimonials-section {
  text-align: center;
  margin: 3rem 0;
}

.login-testimonials-section h3 {
  font-size: 1.8rem;
  margin-bottom: 2rem;
  color: #f8fafc;
}

.testimonials-slider {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
  overflow: hidden;
}

.testimonial {
  display: none;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.1);
  margin-bottom: 1rem;
}

.testimonial.active {
  display: block;
}

.testimonial p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #e2e8f0;
  margin-bottom: 1rem;
  font-style: italic;
}

.testimonial cite {
  color: #3b82f6;
  font-weight: 500;
}

.testimonial-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.4);
  cursor: pointer;
  transition: background 0.3s ease;
}

.dot.active {
  background: #3b82f6;
}

/* Form Section */
.login-form-section {
  margin: 2rem 0;
}

/* Quick Links */
.login-quick-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.quick-link {
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-block;
}

.quick-link.primary {
  background: #3b82f6;
  color: white;
}

.quick-link.primary:hover {
  background: #2563eb;
  transform: translateY(-2px);
}

.quick-link.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.quick-link.secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #f8fafc;
  transform: translateY(-2px);
}

/* Animation classes */
.animate-in {
  animation: fadeInUp 0.8s ease forwards;
}

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

/* Loading animation */
.login-container {
  animation: fadeInContainer 1s ease forwards;
}

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

/* Hover effects for interactive elements */
.stat-item:hover .stat-number {
  color: #60a5fa;
  transform: scale(1.1);
  transition: all 0.3s ease;
}

.testimonial {
  transition: all 0.3s ease;
}

.testimonial:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(59, 130, 246, 0.15);
}

/* Responsive Design */
@media (max-width: 768px) {
  .login-container {
    padding: 1rem;
    gap: 2rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .stat-number {
    font-size: 2rem;
  }

  .login-quick-links {
    flex-direction: column;
    align-items: center;
  }

  .login-features-section h3,
  .login-testimonials-section h3 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-number {
    font-size: 1.8rem;
  }

  .loginform {
    padding: 1.5rem;
  }
}

.login-divider,
.login-identityproviders,
.login-instructions,
.login-signup,
.login-languagemenu,
.d-flex {
  color: #e2e8f0;
}

.alert-danger {
  background-color: rgba(248, 113, 113, 0.12);
  color: #fee2e2;
  border-color: rgba(248, 113, 113, 0.25);
}

.btn {
  border-radius: 9999px;
}

.btn-primary,
.btn-secondary {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
}
