/* ===================================================================
   PEAS - Pre-Enrollment Assessment System
   Login Page Styles
   =================================================================== */

/* Role Selection Modal Styles */
.role-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0px;
  top: 0;
  width: 80%;
  height: 107.7%;
  animation: fadeIn 0.3s ease-in-out;
}

.role-modal-content {
  background: linear-gradient(135deg, #facc41, #206018);
  padding: 10px 25px 5px 30px;
  border-radius: 8px;
  width: 320px;
  max-width: 350px;
  position: absolute;
  top: 60%;
  left: 11%;
  transform: translate(0, -50%);
  text-align: center;
  animation: slideIn 0.4s ease-out;
  box-shadow: 0 2px 8px rgba(0, 0.9, 0.9, 0.9);
  background-color: rgba(255, 255, 255, 0.85);
  height: 258px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.role-modal-title {
  color: white;
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 20px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.role-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.role-button {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 12px 30px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.role-button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Base Styles */
body {
  background: url('../../pix/drone.png') no-repeat;
  background-size: cover;
  background-position: center;
  font-family: sans-serif;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  height: 100vh;
  margin: 0;
  padding: 20px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

/* Main wrapper for desktop */
main {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  height: 100vh;
  overflow: hidden;
}

/* Enhanced Welcome Title Styling */
.welcome-title {
  color: #d9e441;
  font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
  font-size: clamp(0.7em, 2vw, 0.9em);
  font-weight: 1000;
  letter-spacing: 2px;
  background: none;
  padding: 0;
  border-radius: 0;
  margin-top:36px;
  margin-left: 30px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  position: absolute;
  z-index: 3;
  gap: 0;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.45), 0 1px 0 #fdfdfd;
  border: none;
  width: min(300px, 80vw);
  left: 5%;
  top: 5%;
  transform: translateX(0);
}

.welcome-title img {
  height: clamp(2em, 8vw, 4em);
  width: auto;
  vertical-align: middle;
  margin-left: 150px;
  filter: drop-shadow(0 2px 6px rgba(32,96,24,0.2));
}

/* Login Container */
.container {
  width: min(320px, 100vw);
  max-width: 320px;
  padding: 6px 20px 12px 20px;
  margin-left: calc(7% + 120px);
  margin-top: calc(clamp(25vh, 30vh, 35vh) + 75px);
  background-color: rgba(255, 255, 255, 0.96);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0.9, 0.9, 1.05);
  text-align: center;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

h2 {
  font-size: 18px;
  font-weight: bolder;
  color: #206018;
  margin-bottom: 12px;
}

/* Form Elements */
input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 8px;
  margin: 6px 0;
  border: 1px solid #ddd;
  border-radius: 5px;
  box-sizing: border-box;
  font-size: 14px;
  -webkit-appearance: none;
  appearance: none;
}

/* Password fields inside wrapper get padding adjustment for icon */
.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
  padding-right: 40px !important;
  margin: 0 !important;
}

input[type="text"]:focus,
input[type="password"]:focus {
  outline: 2px solid #206018;
  outline-offset: 2px;
  border-color: #206018;
}

button {
  width: 100%;
  padding: 8px;
  margin: 6px 0;
  background-color: #206018;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #184c14;
}

button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

button:focus {
  outline: 2px solid #206018;
  outline-offset: 2px;
}

.forgot-password {
  margin-top: 8px;
  font-size: 12px;
}

.forgot-password a {
  color: #4CAF50;
  text-decoration: none;
}

.forgot-password a:hover {
  text-decoration: underline;
}

.forgot-password a:focus {
  outline: 2px solid #4CAF50;
  outline-offset: 2px;
}

/* Loading Spinner */
.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #206018;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  display: inline-block;
  margin-left: 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease-in-out;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.modal.show {
  display: flex;
}

body.modal-open {
  overflow: hidden !important;
  height: 100vh !important;
}

.modal-content {
  margin: 150px auto !important;
  padding: 12px !important;
  border-radius: 15px !important;
  width: 90% !important;
  max-width: 400px !important;
  text-align: center !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
  animation: slideIn 0.4s ease-out !important;
  position: relative !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pending-modal {
  background: linear-gradient(135deg, #facc41, #206018) !important;
}

.error-modal {
  background: linear-gradient(135deg, #dc3545, #c82333) !important;
}

.rejected-modal {
  background: linear-gradient(135deg, #6c757d, #495057) !important;
}

.modal-icon {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: white;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  border: 3px solid rgba(255, 255, 255, 0.3);
}

.modal-title {
  color: white !important;
  font-size: 24px !important;
  font-weight: bold !important;
  margin-bottom: 10px !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.modal-message {
  color: rgba(255, 255, 255, 0.9) !important;
  font-size: 16px !important;
  margin: 12px !important;
  line-height: 1.5 !important;
  text-align: center;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-button {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 12px 30px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.modal-button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.modal-button:focus {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Error and Success Messages */
.error-message {
  color: #dc3545;
  font-size: 14px;
  margin-top: 8px;
  text-align: center;
}

.success-message {
  color: #206018;
  font-size: 14px;
  margin-top: 8px;
  text-align: center;
}

/* Password Strength Indicator */
.password-strength-container {
  margin-top: 8px;
  margin-bottom: 8px;
}

.password-strength-bar {
  height: 4px;
  background: #e9ecef;
  border-radius: 2px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.password-strength-fill {
  height: 100%;
  width: 0%;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.password-strength-fill.strength-weak {
  width: 33%;
  background: linear-gradient(90deg, #dc3545, #e74c3c);
}

.password-strength-fill.strength-medium {
  width: 66%;
  background: linear-gradient(90deg, #ffc107, #ffb300);
}

.password-strength-fill.strength-strong {
  width: 100%;
  background: linear-gradient(90deg, #28a745, #20c997);
}

.password-strength-text {
  font-size: 12px;
  margin-top: 4px;
  text-align: left;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.password-strength-text.weak {
  color: #dc3545;
}

.password-strength-text.medium {
  color: #ffc107;
}

.password-strength-text.strong {
  color: #28a745;
}

.password-requirements {
  font-size: 11px;
  color: #6c757d;
  margin-top: 8px;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 6px;
  text-align: left;
}

.password-requirements ul {
  margin: 4px 0 0 0;
  padding-left: 20px;
  list-style: none;
}

.password-requirements li {
  margin: 2px 0;
  position: relative;
}

.password-requirements li:before {
  content: "○";
  position: absolute;
  left: -15px;
  color: #6c757d;
  transition: all 0.3s ease;
}

.password-requirements li.met:before {
  content: "✓";
  color: #28a745;
}

.password-requirements li.met {
  color: #28a745;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
  .welcome-title {
    top: 3%;
    left: 5%;
    font-size: clamp(0.6em, 3vw, 0.8em);
    width: 90vw;
    align-items: center;
    transform: translateX(0);
  }
  
  .welcome-title img {
    height: clamp(60px, 15vw, 100px);
    margin-top: -10px;
  }
  
  .container {
    margin-top: calc(clamp(20vh, 35vh, 40vh) + 75px);
    margin-left: calc(5% + 40px);
    padding: 8px 18px;
    width: 90vw;
    max-width: 320px;
    background-color: rgba(255, 255, 255, 0.96) !important;
  }
  
  .role-modal-content {
    width: 90vw;
    max-width: 320px;
    left: 50%;
    transform: translate(-50%, -50%);
    height: auto;
    min-height: 250px;
    padding: 20px;
  }
  
  .modal-content {
    width: 95vw !important;
    max-width: 380px !important;
    margin: 20px auto !important;
  }
}

@media screen and (max-width: 480px) {
  body {
    padding: 10px;
    justify-content: center;
    overflow: hidden;
    height: 100vh;
  }
  
  .welcome-title {
    font-size: clamp(0.5em, 4vw, 0.7em);
    top: 2%;
    left: 50%;
    transform: translateX(-50%);
    align-items: center;
  }
  
  .welcome-title span {
    font-size: clamp(2.5em, 8vw, 3em) !important;
  }
  
  .container {
    margin-top: calc(clamp(25vh, 30vh, 35vh) + 75px);
    margin-left: auto;
    margin-right: auto;
    padding: 6px 15px;
    width: 85vw;
    max-width: 300px;
    background-color: rgba(255, 255, 255, 0.97) !important;
  }
  
  h2 {
    font-size: 18px;
  }
  
  input[type="text"],
  input[type="password"] {
    padding: 12px;
    font-size: 16px;
  }
  
  button {
    padding: 12px;
    font-size: 16px;
  }
  
  /* Center the verification code input field on mobile */
  #forgot-step-2 {
    align-items: center !important;
  }
  
  #forgot-code {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

@media screen and (min-width: 1200px) {
  .welcome-title {
    left: 8%;
    transform: translateX(0);
    top: 8%;
  }
  
  .container {
    position: relative;
    margin-top: calc(clamp(25vh, 35vh, 40vh) + 75px);
    margin-left: calc(8% + 40px);
    background-color: rgba(255, 255, 255, 0.97) !important;
  }
}

/* ===================================================================
   ENHANCED MOBILE RESPONSIVE DESIGN
   =================================================================== */

/* Extra Small Devices (phones, 320px and up) */
@media screen and (max-width: 480px) {
  body {
    padding: 10px;
    overflow-x: hidden;
  }
  
  .welcome-title {
    font-size: 28px !important;
    padding: 15px 20px !important;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 320px;
  }
  
  .container {
    width: 100% !important;
    max-width: 100%;
    padding: 25px 20px !important;
    margin: 120px auto 20px !important;
    background-color: rgba(255, 255, 255, 0.97) !important;
  }
  
  .container h2 {
    font-size: 24px !important;
    margin-bottom: 20px;
  }
  
  input[type="text"],
  input[type="password"],
  input[type="email"] {
    font-size: 16px !important;
    padding: 14px !important;
    margin-bottom: 12px;
  }
  
  button[type="submit"] {
    font-size: 16px !important;
    padding: 14px !important;
    margin-top: 10px;
  }
  
  .forgot-password {
    font-size: 13px !important;
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  
  .forgot-password a {
    display: block;
    margin: 5px 0;
  }
  
  /* Modal adjustments for mobile */
  .role-modal-content,
  .modal-content {
    width: 95% !important;
    max-width: 95% !important;
    padding: 25px 20px !important;
    margin: 10px;
  }
  
  .role-modal-content h2,
  .modal-content h2 {
    font-size: 20px !important;
    margin-bottom: 20px;
  }
  
  .role-options {
    flex-direction: column;
    gap: 15px;
  }
  
  .role-option {
    width: 100% !important;
    max-width: 100% !important;
    padding: 15px !important;
  }
  
  .role-option img {
    width: 50px !important;
    height: 50px !important;
  }
  
  .role-option span {
    font-size: 16px !important;
  }
  
  /* Password strength indicator mobile */
  .password-requirements {
    font-size: 12px !important;
    padding: 12px !important;
  }
  
  .password-strength-bar {
    height: 6px !important;
  }
  
  /* Remember me checkbox mobile */
  div:has(#remember_me) {
    margin: 15px 0 !important;
  }
  
  div:has(#remember_me) label {
    font-size: 13px !important;
  }
}

/* Small Devices (tablets, 481px to 768px) */
@media screen and (min-width: 481px) and (max-width: 768px) {
  .welcome-title {
    font-size: 32px;
    padding: 18px 25px;
    width: 85%;
    max-width: 400px;
  }
  
  .container {
    width: 90%;
    max-width: 450px;
    padding: 30px 25px;
    margin: 140px auto 30px;
    background-color: rgba(255, 255, 255, 0.97) !important;
  }
  
  .role-modal-content,
  .modal-content {
    width: 85%;
    max-width: 500px;
    padding: 30px;
  }
  
  .role-options {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
  }
  
  .role-option {
    width: 45%;
    min-width: 150px;
  }
}

/* Medium Devices (landscape tablets, 769px to 991px) */
@media screen and (min-width: 769px) and (max-width: 991px) {
  .container {
    width: 70%;
    max-width: 500px;
    background-color: rgba(255, 255, 255, 0.97) !important;
  }
  
  .role-modal-content,
  .modal-content {
    width: 70%;
    max-width: 600px;
  }
}

/* Landscape orientation adjustments */
@media screen and (max-height: 600px) and (orientation: landscape) {
  .welcome-title {
    font-size: 24px;
    padding: 12px 20px;
    top: 10px;
  }
  
  .container {
    margin-top: 80px !important;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.97) !important;
  }
  
  .role-modal-content,
  .modal-content {
    max-height: 90vh;
    overflow-y: auto;
  }
}

/* Touch-friendly tap targets */
@media (hover: none) and (pointer: coarse) {
  button,
  a,
  input[type="checkbox"] {
    min-height: 44px;
    min-width: 44px;
  }
  
  .role-option {
    min-height: 80px;
  }
}

/* Password Toggle Button */
.password-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 12px;
  display: block;
}

.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
  padding-right: 40px !important;
  margin-bottom: 0 !important;
  width: 100%;
}

.password-toggle {
  position: absolute;
  right: 4px;
  top: 30%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  transition: color 0.3s ease;
  outline: none;
  z-index: 10;
  width: 28px;
  height: 28px;
}

.password-toggle:hover {
  color: #206018;
  background-color: rgba(32, 96, 24, 0.05);
  border-radius: 4px;
}

.password-toggle:focus {
  outline: 2px solid #206018;
  outline-offset: 1px;
  border-radius: 4px;
}

.password-toggle .eye-icon {
  stroke-width: 2;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.password-toggle[aria-label="Hide password"] .eye-icon path:first-child {
  display: none;
}

.password-toggle[aria-label="Hide password"] .eye-icon::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 2px;
  background: currentColor;
  transform: rotate(-45deg);
  top: 50%;
  left: 50%;
  margin-left: -12px;
  margin-top: -1px;
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Button Loading State */
button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Form Validation Feedback */
.input-wrapper {
  position: relative;
  margin-bottom: 12px;
}

.validation-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  display: none;
}

input.valid ~ .validation-icon.success {
  display: block;
  color: #28a745;
}

input.invalid ~ .validation-icon.error {
  display: block;
  color: #dc3545;
}


input.valid {
  border-color: #28a745 !important;
  background-color: #f8fff9;
}

input.invalid {
  border-color: #dc3545 !important;
  background-color: #fff5f5;
}

.error-message {
  color: #dc3545;
  font-size: 12px;
  margin-top: 4px;
  margin-bottom: 8px;
  display: none;
  text-align: left;
}

.error-message.show {
  display: block;
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Future: Add high-res image variants */
}

/* ===================================================================
   FOOTER STYLES (Desktop First)
   =================================================================== */
#footerLinks {
  position: fixed;
  bottom: 0;
  left: 15%;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  background-color: transparent;
}

#aboutDevelopers {
  display: flex;
  align-items: center;
  cursor: pointer;
}

#aboutDevelopers img {
  height: 14px;
  width: 14px;
  margin-right: 15px;
  margin-left: 20px;
  }

#aboutDevelopers span,
#adminLink,
.footer-separator {
  font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
  font-size: clamp(0.7em, 1vw, 0.9em);
  color: #d9e441;
  font-weight: 400;
  margin-left: 1px;
  letter-spacing: 1px;
  line-height: 1;
  text-decoration: underline;
  display: inline-block;
}

.footer-separator {
  text-decoration: none;
  margin: 0 4px;
}

/* ===================================================================
   HIGH-RESOLUTION MOBILE DEVICES (e.g., 1224x2720)
   Breakpoint: 1280px to catch modern high-res mobile devices
   =================================================================== */
@media screen and (max-width: 1280px) {
  body {
    padding: 10px;
    justify-content: flex-start;
    overflow-x: hidden !important;
    overflow-y: auto;
    height: 100vh;
    min-height: 100vh;
  }

  /* Welcome Title - Header with Logo and Text */
  .welcome-title {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    font-size: 0.6em !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 5px !important;
    z-index: 100;
    text-align: center !important;
    margin: 10px 0 20px 0 !important;
    padding: 0 10px !important;
    box-sizing: border-box;
  }

  .welcome-title > div:first-child {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 !important;
  }

  .welcome-title img {
    height: 50px !important;
    width: auto !important;
    margin: 0 !important;
  }

  .welcome-title > div:last-child {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    gap: 0 !important;
  }

  .welcome-title span {
    font-size: 1.8em !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: center !important;
    margin: 0 !important;
    line-height: 1.1 !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* Login Container - Centered with equal margins */
  .container {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90% !important;
    max-width: 350px !important;
    padding: 20px 25px !important;
    box-sizing: border-box;
    margin: 0 !important;
    background-color: rgba(255, 255, 255, 0.97) !important;
  }

  .container h2 {
    font-size: 18px !important;
    margin-bottom: 15px !important;
    color: #206018 !important;
    font-weight: bolder !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* Form inputs with proper touch target size */
  input[type="text"],
  input[type="password"],
  input[type="email"] {
    font-size: 16px !important;
    padding: 14px !important;
    margin: 8px 0 !important;
    width: 100%;
    box-sizing: border-box;
  }

  .password-wrapper input[type="password"],
  .password-wrapper input[type="text"] {
    padding-right: 45px !important;
  }

  button[type="submit"],
  button {
    font-size: 16px !important;
    padding: 14px !important;
    margin: 8px 0 4px 0 !important;
    width: 100%;
  }

  /* Forgot password links */
  .forgot-password {
    font-size: 14px !important;
    display: flex;
    flex-direction: column;
    gap: 0;
    text-align: center;
    margin-top: 8px !important;
    line-height: 1 !important;
  }

  .forgot-password a {
    display: block;
    margin: 0;
    line-height: 1.2;
  }

  .forgot-password a:first-child {
    margin-bottom: -10px !important;
  }

  /* Role Modal - Centered */
  .role-modal {
    width: 100% !important;
    height: 100% !important;
    left: 0 !important;
    top: 0 !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
  }

  .role-modal-content {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 85% !important;
    max-width: 320px !important;
    height: auto !important;
    min-height: auto !important;
    padding: 25px 20px 30px 20px !important;
    box-sizing: border-box;
    background: linear-gradient(135deg, #facc41, #206018) !important;
    border-radius: 10px !important;
  }

  .role-modal-content h2 {
    font-size: 20px !important;
    margin-bottom: 12px !important;
    color: white !important;
    font-weight: bold !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
  }

  .role-modal-content p {
    color: white !important;
    font-size: 14px !important;
    margin-bottom: 20px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
  }

  .role-buttons {
    display: flex !important;
    flex-direction: row !important;
    gap: 12px !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    width: 100% !important;
  }

  .role-button {
    padding: 12px 20px !important;
    font-size: 15px !important;
    flex: 1 !important;
    min-width: 100px !important;
    max-width: 130px !important;
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 25px !important;
    font-weight: bold !important;
    text-align: center !important;
  }

  /* Other modals */
  .modal-content {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90% !important;
    max-width: 400px !important;
    padding: 25px 20px !important;
    box-sizing: border-box;
    margin: 0 !important;
  }

  .modal-content h2 {
    font-size: 20px !important;
    margin-bottom: 15px;
  }

  .modal-content input[type="text"],
  .modal-content input[type="email"],
  .modal-content input[type="password"] {
    font-size: 16px !important;
    padding: 14px !important;
  }

  .modal-content button {
    font-size: 16px !important;
    padding: 14px !important;
  }

  /* Password toggle icon */
  .toggle-password {
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%);
  }

  /* Error messages */
  .error-message {
    font-size: 13px !important;
    margin-top: 5px;
    margin-bottom: 10px;
  }

  /* Success messages */
  .success-message,
  .alert {
    font-size: 14px !important;
    padding: 12px !important;
    margin: 10px 0 !important;
  }

  /* Footer - Mobile */
  #footerLinks {
    position: fixed !important;
    bottom: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 1000 !important;
    display: block !important;
    text-align: center !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  #aboutDevelopers {
    display: inline-block !important;
    vertical-align: baseline !important;
  }

  #aboutDevelopers img {
    height: 14px !important;
    width: 14px !important;
    margin-right: 4px !important;
    vertical-align: baseline !important;
    display: inline-block !important;
  }

  #aboutDevelopers span,
  #adminLink,
  .footer-separator {
    font-size: 12px !important;
    line-height: 1 !important;
    vertical-align: baseline !important;
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .footer-separator {
    margin: 0 4px !important;
  }
}

/* ===================================================================
   LANDING PAGE VISUAL REFRESH (FINAL OVERRIDES)
   =================================================================== */
:root {
  --asplan-green-900: #0d3910;
  --asplan-green-800: #14511a;
  --asplan-green-700: #206018;
  --asplan-leaf: #8ccf52;
  --asplan-lime: #d9e441;
  --asplan-mist: #f4ffe8;
  --asplan-card: rgba(255, 255, 255, 0.92);
  --asplan-card-border: rgba(255, 255, 255, 0.48);
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  min-height: 100dvh !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
  background:
    url('../../pix/drone111.jpg') center center / cover no-repeat fixed,
    linear-gradient(120deg, rgba(13, 57, 16, 0.82) 0%, rgba(20, 81, 26, 0.78) 42%, rgba(32, 96, 24, 0.74) 100%),
    radial-gradient(circle at 16% 18%, rgba(217, 228, 65, 0.28) 0%, rgba(217, 228, 65, 0) 35%),
    radial-gradient(circle at 85% 80%, rgba(140, 207, 82, 0.22) 0%, rgba(140, 207, 82, 0) 36%),
    linear-gradient(120deg, rgba(10, 42, 13, 0.92) 0%, rgba(17, 70, 23, 0.88) 50%, rgba(30, 88, 26, 0.86) 100%) !important;
  background-blend-mode: multiply, normal, screen, screen, normal;
  overflow: hidden !important;
  position: relative;
}

body:not(.modal-open) {
  overflow-y: hidden !important;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: min(40vw, 420px);
  height: min(40vw, 420px);
  top: -12vh;
  left: -6vw;
  background: radial-gradient(circle, rgba(217, 228, 65, 0.36) 0%, rgba(217, 228, 65, 0) 70%);
  filter: blur(2px);
  animation: auraFloat 12s ease-in-out infinite;
}

body::after {
  width: min(45vw, 460px);
  height: min(45vw, 460px);
  right: -10vw;
  bottom: -18vh;
  background: radial-gradient(circle, rgba(84, 188, 88, 0.25) 0%, rgba(84, 188, 88, 0) 72%);
  filter: blur(4px);
  animation: auraFloat 16s ease-in-out infinite reverse;
}

main {
  width: min(1220px, 100%) !important;
  min-height: 100dvh !important;
  height: 100dvh !important;
  margin: 0 auto !important;
  padding: clamp(26px, 5vw, 56px) clamp(16px, 4vw, 42px) !important;
  display: grid !important;
  grid-template-columns: minmax(320px, 1.15fr) minmax(320px, 0.85fr) !important;
  align-items: center !important;
  gap: clamp(24px, 6vw, 88px) !important;
  position: relative;
  z-index: 1;
  overflow: hidden !important;
}

.welcome-title {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  width: auto !important;
  max-width: 670px !important;
  margin: 0 !important;
  padding: clamp(20px, 2.8vw, 34px) clamp(20px, 3vw, 36px) !important;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(11, 46, 14, 0.66) 0%, rgba(23, 83, 28, 0.48) 100%);
  border: 1px solid rgba(217, 228, 65, 0.24);
  box-shadow: 0 28px 50px rgba(6, 24, 8, 0.42);
  backdrop-filter: blur(3px);
  text-shadow: none !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.welcome-title .brand-logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 12px;
}

.welcome-title .brand-logo {
  height: clamp(86px, 11vw, 132px) !important;
  width: auto;
  margin: 0 !important;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.28));
}

.welcome-title .brand-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100% !important;
  text-align: center;
}

.welcome-title .brand-name {
  margin: 0 !important;
  font-size: clamp(2.8rem, 9.5vw, 5.6rem) !important;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 0.92;
  color: #f7ffd5;
}

.welcome-title .brand-tagline {
  margin: 0 !important;
  font-size: clamp(1.02rem, 2.5vw, 1.72rem) !important;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #e7ffd6;
}

.container {
  width: min(390px, 92vw) !important;
  max-width: 390px !important;
  margin: 0 !important;
  padding: 28px 24px 20px !important;
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  border-radius: 24px;
  border: 1px solid var(--asplan-card-border);
  background: var(--asplan-card) !important;
  box-shadow: 0 26px 54px rgba(5, 22, 7, 0.34);
  backdrop-filter: blur(8px);
}

.container::before {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 0;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--asplan-green-800), var(--asplan-leaf), var(--asplan-lime));
}

.container h2 {
  margin-top: 4px;
  margin-bottom: 16px;
  font-size: 1.15rem !important;
  letter-spacing: 0.15em;
  color: var(--asplan-green-800);
}

.container input[type="text"],
.container input[type="password"] {
  border-radius: 12px;
  border: 1.5px solid #d8e6d8;
  background: #fcfffb;
  padding: 11px 12px;
  font-size: 0.92rem;
}

.container input[type="text"]:focus,
.container input[type="password"]:focus {
  border-color: var(--asplan-green-700);
  box-shadow: 0 0 0 4px rgba(32, 96, 24, 0.12);
  outline: none;
}

.container .password-wrapper {
  margin-bottom: 8px;
}

.container .password-toggle {
  top: 50%;
  right: 8px;
}

.container > form > button[type="submit"] {
  margin-top: 2px;
  border-radius: 12px;
  border: none;
  padding: 11px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, var(--asplan-green-700) 0%, #2f8a2b 100%);
  box-shadow: 0 12px 24px rgba(32, 96, 24, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.container > form > button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(32, 96, 24, 0.34);
}

.container .forgot-password {
  margin-top: 10px;
  color: #4f6950;
}

.container .forgot-password a {
  color: var(--asplan-green-700);
  font-weight: 600;
}

@media screen and (max-width: 1024px) {
  main {
    grid-template-columns: 1fr !important;
    justify-items: center;
    align-content: center;
    gap: 16px !important;
    padding-top: 14px !important;
  }

  .welcome-title {
    max-width: 680px !important;
    width: min(680px, 95vw) !important;
  }

  .welcome-title .brand-copy {
    align-items: center;
    text-align: center;
  }

  .welcome-title .brand-logo-row {
    justify-content: center;
  }
}

@media screen and (max-width: 640px) {
  body {
    background-attachment: scroll !important;
  }

  main {
    padding: 10px 10px 12px !important;
    min-height: 100dvh !important;
    height: 100dvh !important;
  }

  .welcome-title {
    padding: 16px 14px !important;
    border-radius: 18px;
  }

  .welcome-title .brand-name {
    font-size: clamp(2.2rem, 12vw, 3.2rem) !important;
  }

  .welcome-title .brand-tagline {
    font-size: clamp(0.92rem, 4.1vw, 1.1rem) !important;
  }

  .container {
    width: min(360px, 95vw) !important;
    padding: 22px 16px 16px !important;
    border-radius: 18px;
  }
}

@keyframes auraFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -14px, 0) scale(1.03);
  }
}

