/* Base login container styles */
.login-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    padding: 2.5rem;
    transition: background-color 0.3s, box-shadow 0.3s;
}

/* Dark mode with data-bs-theme attribute */
[data-bs-theme="dark"] .login-container {
    background-color: #1e1e1e;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3);
}

/* Legacy dark mode - keep for backward compatibility */
body.dark-mode .login-container {
    background-color: #1e1e1e;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3);
}

.login-logo {
    width: 80px;
    height: 80px;
}

/* Form control focus state */
.form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    border-color: #86b7fe;
}

/* Dark mode form styling - using data-bs-theme attribute */
[data-bs-theme="dark"] .form-control {
    background-color: #333;
    color: #fff;
    border-color: #555;
}

[data-bs-theme="dark"] .form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.35);
}

[data-bs-theme="dark"] .input-group-text {
    background-color: #444;
    color: #fff;
    border-color: #555;
}

[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] .form-label {
    color: #fff;
}

[data-bs-theme="dark"] .text-muted {
    color: #adb5bd !important;
}

/* Legacy dark mode styling - keep for backward compatibility */
body.dark-mode .form-control {
    background-color: #333;
    color: #fff;
    border-color: #555;
}

body.dark-mode .form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.35);
}

body.dark-mode .input-group-text {
    background-color: #444;
    color: #fff;
    border-color: #555;
}

body.dark-mode h2,
body.dark-mode .form-label {
    color: #fff;
}

body.dark-mode .text-muted {
    color: #adb5bd !important;
}

/* Toggle password button */
.toggle-password {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

[data-bs-theme="dark"] .toggle-password {
    background-color: #444;
    color: #fff;
    border-color: #555;
}

body.dark-mode .toggle-password {
    background-color: #444;
    color: #fff;
    border-color: #555;
}

/* Alert styling for login messages */
#login-error {
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
}

#login-error.alert-danger {
  background-color: rgba(220, 53, 69, 0.1);
  border-color: rgba(220, 53, 69, 0.2);
  color: #dc3545;
}

#login-error.alert-warning {
  background-color: rgba(255, 193, 7, 0.1);
  border-color: rgba(255, 193, 7, 0.2);
  color: #fd7e14;
}

/* Alert styling for dark mode - using data-bs-theme */
[data-bs-theme="dark"] #login-error.alert-danger {
  background-color: rgba(220, 53, 69, 0.2);
  border-color: rgba(220, 53, 69, 0.3);
  color: #ff6b6b;
}

[data-bs-theme="dark"] #login-error.alert-warning {
  background-color: rgba(255, 193, 7, 0.15);
  border-color: rgba(255, 193, 7, 0.3);
  color: #ffc107;
}

/* Legacy dark mode alert styling */
body.dark-mode #login-error.alert-danger {
  background-color: rgba(220, 53, 69, 0.2);
  border-color: rgba(220, 53, 69, 0.3);
  color: #ff6b6b;
}

body.dark-mode #login-error.alert-warning {
  background-color: rgba(255, 193, 7, 0.15);
  border-color: rgba(255, 193, 7, 0.3);
  color: #ffc107;
}

/* Icon in the alert */
#login-error i {
  font-size: 1.1rem;
  margin-right: 0.5rem;
}

/* Theme toggle button styling */
#theme-toggle {
  transition: all 0.3s ease;
  border-radius: 20px;
  padding: 0.4rem 0.8rem;
}

[data-bs-theme="dark"] #theme-toggle {
  color: #fff;
  border-color: #6c757d;
}

body.dark-mode #theme-toggle {
  color: #fff;
  border-color: #6c757d;
}

/* Mobile responsiveness improvements for login page */
@media (max-width: 768px) {
  /* Adjust login container padding */
  .login-container {
    padding: 1.75rem;
    margin: 1rem;
  }
  
  /* Smaller logo */
  .login-logo {
    width: 70px;
    height: 70px;
  }
  
  /* Font size adjustments */
  h2 {
    font-size: 1.5rem;
  }
  
  .text-muted {
    font-size: 0.9rem;
  }
  
  /* Form adjustments */
  .form-control {
    height: 45px;
    font-size: 16px; /* Prevent iOS zoom */
  }
  
  /* Adjust button size */
  .btn {
    padding: 0.5rem 1rem;
  }
}

/* Extra small devices */
@media (max-width: 575.98px) {
  /* Even more compact */
  .login-container {
    padding: 1.5rem;
    margin: 0.5rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
  }
  
  /* Smaller logo on very small screens */
  .login-logo {
    width: 60px;
    height: 60px;
  }
  
  /* More compact form */
  .mb-3, .mb-4 {
    margin-bottom: 0.75rem !important;
  }
  
  /* Better input field touch targets */
  .input-group-text {
    padding: 0.5rem 0.75rem;
  }
}

/* Landscape orientation */
@media (max-height: 500px) and (orientation: landscape) {
  /* Adjust layout for landscape */
  .row.justify-content-center.align-items-center.min-vh-100 {
    align-items: flex-start !important;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
  
  /* Smaller logo in landscape */
  .login-logo {
    width: 50px;
    height: 50px;
    margin-bottom: 0.5rem;
  }
  
  /* More compact spacing */
  .login-container {
    padding: 1.25rem;
  }
  
  .mb-4 {
    margin-bottom: 0.5rem !important;
  }
  
  /* Smaller header text */
  h2 {
    font-size: 1.25rem;
    margin-top: 0.25rem !important;
  }
  
  /* Hide some elements if needed */
  .text-center.mt-4 {
    margin-top: 0.5rem !important;
  }
}
