/* login.css - Consolidated styles for login components and forms */

.hidden {
  display: none !important;
}

.login-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

.login-body::before {
  content: "";
  position: absolute;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  background: linear-gradient(rgba(245, 247, 251, 0.7), rgba(219, 234, 254, 0.7)), 
              url("https://images.unsplash.com/photo-1460925895917-afdab827c52f?auto=format&fit=crop&w=1920&q=80");
  background-size: cover;
  background-position: center;
  transform: translate(var(--parallax-x, 0), var(--parallax-y, 0));
  transition: transform 0.1s ease-out;
  z-index: -1;
}

.login-container {
  background: #ffffff;
  padding: 40px 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 350px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.8);
  margin: auto;
  backdrop-filter: blur(8px);
  animation: loginFadeIn 0.8s ease-out forwards;
}

.login-container h2 {
  text-align: center;
  margin-bottom: 25px;
  color: #004aad;
}

.logo-container {
  text-align: center;
  margin-bottom: 15px;
}

.login-logo {
  width: 100px;
  height: 90px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  animation: popIn 0.6s ease;
}

.brand-name {
  font-size: 18px;
  font-weight: 600;
  color: #004aad;
  margin-top: 5px;
}

/* --- Unified Form Elements Logic --- */
.login-form .form-group,
.modal-content .form-group { /* Keep for login.html's change password modal */
  margin-bottom: 20px;
  width: 100%;
}

.login-form label {
  text-align: center;
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #374151;
}

.login-form input,
.login-form select {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  background-color: #f9fafb;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.login-form input:focus,
.login-form select:focus {
  outline: none;
  border-color: #2563eb;
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.login-form button {
  width: 100%;
  background: #2563eb;
  color: #fff;
  padding: 12px;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

/* --- Password Toggle Visibility Logic --- */
.password-input-wrapper {
  position: relative !important;
  width: 100% !important;
  display: block !important;
}

.toggle-password-icon {
  position: absolute !important;
  right: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  cursor: pointer !important;
  color: #64748b !important;
  z-index: 20 !important;
  font-size: 1.1rem !important;
  transition: color 0.2s ease;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  line-height: 1 !important;
}

.toggle-password-icon:hover {
  color: #1e293b !important;
}

.login-footer-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  font-size: 0.85rem;
}

@media (max-width: 480px) {
  .login-container {
    padding: 30px 20px;
    width: 92%;
  }

  .login-footer-links {
    flex-direction: column;
    gap: 12px;
  }
}

#forgotPassword {
  color: #6b7280; /* Subtle gray */
  text-decoration: none;
  transition: all 0.3s ease;
}

#forgotPassword:hover {
  color: #111827;
  text-decoration: underline;
}

#backToHome {
  color: #2563eb; /* Prominent blue */
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
}

#backToHome:hover {
  color: #1e40af;
  transform: translateY(-2px);
  text-decoration: underline;
}

/* --- Animations --- */
@keyframes loginFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Animation for dynamic fields used in login.js */
.field-fade-in {
  animation: fieldFadeIn 0.4s ease-out forwards;
}

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

/* --- Footer Positioning --- */
footer {
  width: 100%;
  text-align: center;
  padding: 20px;
  margin-top: auto;
  color: #4b5563;
  font-size: 0.85rem;
  position: relative;
  z-index: 10;
}

@media (max-width: 768px) {
  .login-container {
    margin-top: 60px; /* Space from the top of the screen */
    margin-bottom: 30px; /* Space between form and footer */
  }

  footer {
    margin-top: 0; /* Remove auto margin to place it directly after the container */
    padding: 15px 20px; /* Slightly reduced padding for mobile */
  }
}