/**
 * Datei: css/login.css
 * ----------------------------------------
 * Zweck:
 *   Benutzerdefinierte Styles für das Login-Formular mit Gradient-Design
 *   Responsive Anmeldung mit Input-Gruppen, Toggle-Buttons und Dark-Mode-Support
 *   Unterstützt Animationen, Loading-States und Accessibility-Features
 * 
 * Abhängigkeiten:
 *   - Bootstrap 4.5.2 (für Form-Klassen, Alert-Basis und Grid-System)
 *   - Font Awesome 5.15.3 (für Icons in Labels, Buttons und Toggle)
 * 
 * Datenbank-Tabellen:
 *   - Keine (reines Frontend-Styling)
 */

/* Login Container */
.login-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* Login Card */
.login-card {
  background: white;
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  padding: 40px;
  max-width: 420px;
  width: 100%;
  animation: slideIn 0.5s ease-out;
}

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

/* Login Header */
.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header h1 {
  color: #333;
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.login-header h1 i {
  color: #667eea;
  margin-right: 10px;
}

.login-header p {
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* Form Styling */
.login-form {
  margin-bottom: 20px;
}

.form-group label {
  font-weight: 500;
  color: #555;
  margin-bottom: 8px;
  display: block;
}

.form-group label i {
  margin-right: 8px;
  color: #667eea;
  width: 16px;
  text-align: center;
}

.form-control {
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-control.is-invalid {
  border-color: #dc3545;
}

.form-control.is-valid {
  border-color: #28a745;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.form-control.is-valid:focus {
  border-color: #28a745;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Toggle-Button grün bei gültigen Passwort-Eingaben */
.input-group:has(.form-control.is-valid) .input-group-append .btn {
  border-color: #28a745;
  background: rgba(40, 167, 69, 0.1);
  color: #28a745;
}

.input-group:has(.form-control.is-valid) .input-group-append .btn:hover {
  background: rgba(40, 167, 69, 0.2);
  border-color: #28a745;
  color: #28a745;
}

/* Fallback für Browser ohne :has() Support */
.input-group .form-control.is-valid + .input-group-append .btn {
  border-color: #28a745;
  background: rgba(40, 167, 69, 0.1);
  color: #28a745;
}

.input-group .form-control.is-valid + .input-group-append .btn:hover {
  background: rgba(40, 167, 69, 0.2);
  border-color: #28a745;
  color: #28a745;
}

/* Focus-States für grüne Validierung */
.input-group:focus-within:has(.form-control.is-valid) .input-group-append .btn {
  border-color: #28a745;
}

.input-group .form-control.is-valid:focus + .input-group-append .btn {
  border-color: #28a745;
}

/* Input Group für Passwort */
.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .form-control {
  border-right: 0;
  border-radius: 8px 0 0 8px;
  flex: 1;
}

.input-group-append {
  display: flex;
}

.input-group-append .btn {
  border-left: 0;
  border: 2px solid #e9ecef;
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: transparent;
  color: #6c757d;
  transition: all 0.3s ease;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
}

.input-group-append .btn:hover {
  background: #f8f9fa;
  color: #667eea;
}

.input-group:focus-within .input-group-append .btn {
  border-color: #667eea;
}

/* Checkbox Styling - entfernt */

/* Login Button */
.login-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

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

.login-btn:disabled {
  background: #6c757d;
  transform: none;
  box-shadow: none;
}

.login-btn i {
  margin-right: 8px;
}

.login-btn .spinner-border {
  width: 1rem;
  height: 1rem;
  margin-left: 8px;
}

/* Alert Styling */
#login-alert {
  margin-top: 15px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.alert-danger {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

.alert-success {
  background-color: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

/* Footer - entfernt */

/* Invalid Feedback */
.invalid-feedback {
  display: block;
  width: 100%;
  margin-top: 5px;
  font-size: 0.8rem;
  color: #dc3545;
}

/* Login Footer */
.login-footer {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}

.impressum-link {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(102, 126, 234, 0.3);
  color: #667eea;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.impressum-link:hover {
  background: rgba(102, 126, 234, 0.1);
  border-color: #667eea;
  color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.impressum-link i {
  margin-right: 6px;
}

/* Impressum Modal */
.impressum-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.impressum-modal.show {
  display: flex;
}

.impressum-modal-content {
  background: white;
  border-radius: 15px;
  max-width: 700px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  animation: modalSlideIn 0.3s ease-out;
}

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

.impressum-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 25px 30px 20px 30px;
  border-bottom: 1px solid #e9ecef;
}

.impressum-modal-header h3 {
  margin: 0;
  color: #333;
  font-size: 1.4rem;
  font-weight: 600;
}

.impressum-modal-header h3 i {
  color: #667eea;
  margin-right: 10px;
}

.impressum-modal-close {
  background: none;
  border: none;
  color: #6c757d;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.impressum-modal-close:hover {
  background: #f8f9fa;
  color: #495057;
}

.impressum-modal-body {
  padding: 20px 30px 30px 30px;
  line-height: 1.6;
  color: #495057;
}

.impressum-section {
  margin-bottom: 25px;
}

.impressum-section:last-child {
  margin-bottom: 0;
}

.impressum-section h4 {
  color: #333;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #667eea;
  display: inline-block;
}

.impressum-section h5 {
  color: #555;
  font-size: 1rem;
  font-weight: 600;
  margin: 15px 0 8px 0;
}

.impressum-section p {
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.impressum-section address {
  font-style: normal;
  margin-bottom: 0;
}

.impressum-section strong {
  color: #333;
}

/* Responsive Design */
@media (max-width: 576px) {
  .login-container {
    padding: 15px;
  }
  
  .login-card {
    padding: 30px 25px;
    margin: 10px;
  }
  
  .login-header h1 {
    font-size: 1.75rem;
  }
  
  .form-control {
    padding: 10px 14px;
    font-size: 0.9rem;
  }
  
  .login-btn {
    padding: 10px;
    font-size: 0.95rem;
  }
  
  .login-footer {
    bottom: 15px;
  }
  
  .impressum-link {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  
  .impressum-modal {
    padding: 15px;
  }
  
  .impressum-modal-content {
    max-height: 85vh;
  }
  
  .impressum-modal-header {
    padding: 20px 20px 15px 20px;
  }
  
  .impressum-modal-header h3 {
    font-size: 1.2rem;
  }
  
  .impressum-modal-body {
    padding: 15px 20px 20px 20px;
  }
  
  .impressum-section h4 {
    font-size: 1rem;
  }
  
  .impressum-section p {
    font-size: 0.9rem;
  }
}

/* Loading State */
.login-btn.loading .btn-text {
  opacity: 0.7;
}

.login-btn.loading .spinner-border {
  display: inline-block !important;
}

/* Focus Trap für Accessibility */
.login-card:focus-within {
  outline: none;
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
  .login-container {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  }
  
  .login-card {
    background: #2c3e50;
    color: #ecf0f1;
  }
  
  .login-header h1 {
    color: #ecf0f1;
  }
  
  .form-group label {
    color: #bdc3c7;
  }
  
  .form-control {
    background: #34495e;
    border-color: #4a5f7a;
    color: #ecf0f1;
  }
  
  .form-control:focus {
    background: #34495e;
    border-color: #667eea;
    color: #ecf0f1;
  }
  
  .input-group-append .btn {
    background: #34495e;
    border-color: #4a5f7a;
    color: #bdc3c7;
  }
  
  .impressum-link {
    background: rgba(44, 62, 80, 0.9);
    border-color: rgba(102, 126, 234, 0.4);
    color: #667eea;
  }
  
  .impressum-link:hover {
    background: rgba(52, 73, 94, 0.9);
  }
  
  .impressum-modal-content {
    background: #2c3e50;
    color: #ecf0f1;
  }
  
  .impressum-modal-header {
    border-bottom-color: #4a5f7a;
  }
  
  .impressum-modal-header h3 {
    color: #ecf0f1;
  }
  
  .impressum-modal-close {
    color: #bdc3c7;
  }
  
  .impressum-modal-close:hover {
    background: #34495e;
    color: #ecf0f1;
  }
  
  .impressum-modal-body {
    color: #bdc3c7;
  }
  
  .impressum-section h4,
  .impressum-section h5,
  .impressum-section strong {
    color: #ecf0f1;
  }
}
