:root {
  --primary: #1b5e20; /* Base green for primary actions */
  --secondary: #2e7d32; /* Darker green for secondary elements */
  --dark: #1a3c34; /* Deep green for headers and text */
  --darker: #0a1f1b; /* Near-black for emphasis */
  --light: #f8fafc; /* Off-white for backgrounds */
  --pending: #ef5350; /* Red for pending status */
  --active: #1b5e20; /* Green for active status */
  --completed: #2e7d32; /* Darker green for completed status */
  --textbased: #e2e8f0; /* Dark slate for text */
  --bg: #e2e8f0; /* Light gray for secondary backgrounds */
  --side: #1e293b; /* Slate for sidebar elements */
  --bgside: #1a3c34; /* Dark green for sidebar background */
  --green1: #1b5e20; /* Base green for hover states */
  --green2: #2e7d32; /* Darker green for buttons */
  --yellow: #fbc02d; /* Yellow for specific elements */
  --rejected: #d32f2f; /* Red for rejected status */
  --approved: #1b5e20; /* Green for approved status */
  --failed: #f4511e; /* Orange-red for failed status */
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
  --overlap: 30%;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: url("../IMAGE/Login-Bg.avif") center/cover no-repeat;
  padding: 20px;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Safe Area Support for Notched Devices (iPhone X, Pixel 3, etc.) */
@supports (padding: max(0px)) {
  body {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
}

/* Performance Optimization */
.loading-logo {
  will-change: transform; /* GPU acceleration */
}

/* ====== LOADING SCREEN WITH LOGO ====== */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
  flex-direction: column;
}

#loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loading-logo {
  width: 440px;
  height: auto;
  animation: pulse 1.8s infinite ease-in-out;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.4));
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.loading-text {
  margin-top: 15px;
  color: #fff;
  font-family: "Poppins", sans-serif;
  font-size: 1.1rem;
  letter-spacing: 1px;
  animation: fadeText 2s infinite ease-in-out;
}

@keyframes fadeText {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.container {
  position: relative; /* reference for absolute children */
  width: 100%;
  max-width: 900px; /* big enough for desktop */
  aspect-ratio: 16 / 9; /* keep a nice proportion */
  min-height: 550px;
  margin: 0 auto; /* never collapse on tiny screens */
}

.welcome-box {
  position: absolute;
  inset: 0; /* fill the whole container */
  background: url("../IMAGE/Welcome-Bg.avif") center/cover no-repeat;
  border-radius: 20px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
  overflow: hidden;
  z-index: 1;
}

.welcome-box > * {
  position: relative;
  z-index: 2;
}

.slideshow-container {
  max-width: 600px;
  position: relative;
  margin: auto;
}

.slide {
  display: none;
}

.slide img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  background-size: cover;
}

.fade {
  animation: fade 1.5s ease-in-out;
}

@keyframes fade {
  from {
    opacity: 0.4;
  }
  to {
    opacity: 1;
  }
}

.dots-container {
  text-align: center;
  position: absolute;
  bottom: -75px;
  opacity: 0%;
  width: 100%;
  z-index: 3;
}

.dot {
  cursor: pointer;
  height: 15px;
  width: 15px;
  margin: 0 5px;
  background-color: #bbb;
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.6s ease;
}

.active,
.dot:hover {
  background-color: var(--primary);
}

.login-box {
  position: absolute;
  top: 50%;
  left: calc(
    -1 * var(--overlap) + var(--login-nudge, 0px)
  ); /* pull it **right** by the overlap */
  width: 380px;
  max-width: 90%;
  height: auto;
  min-height: 500px;
  padding: 30px 25px;
  background: url("../IMAGE/bg.avif") center/cover no-repeat;
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.8);
  transform: translateY(-50%);
  z-index: 10;
}

.login-box .logo-container {
  text-align: center;
  margin-bottom: 25px;
}

.login-box .logo-container img {
  width: 200px;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.8));
}

.login-box .input-group {
  margin-bottom: 18px;
}

.login-box .input-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.login-box .input-group input {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.login-box .submit_btn {
  width: 100%;
  padding: 12px;
  background-color: var(--green2);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
  margin-top: 10px;
}

.login-box .submit_btn:hover {
  background-color: var(--primary);
}

.footer-links {
  margin-top: 15px;
  text-align: center;
  font-size: 0.9rem;
}

.footer-links a {
  color: var(--dark);
  text-decoration: none;
  margin: 0 8px;
}

.error-message {
  color: red;
  margin-top: 8px;
  font-size: 0.9rem;
  text-align: center;
}

.attempts-message {
  text-align: center;
  margin-top: 8px;
  color: #555;
  font-size: 0.9rem;
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  padding-right: 45px;
}

.password-input-wrapper .toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
  font-size: 1.1rem;
  padding: 8px;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-password:hover {
  color: var(--primary);
}

/* Notification Animation */
.notification {
  animation: fadeIn 0.5s ease-in-out;
  margin-bottom: 15px;
  padding: 15px;
  border-radius: 5px;
}

/* FAQ Icon */
.faq-icon {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, var(--primary) 0%, #1b5e20 100%);
  color: var(--light);
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 26px;
  box-shadow: 0 6px 20px rgba(27, 94, 32, 0.3);
  transition: all 0.3s ease;
  z-index: 100;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 6px 20px rgba(27, 94, 32, 0.3);
  }
  50% {
    box-shadow: 0 6px 30px rgba(27, 94, 32, 0.5);
  }
}

.faq-icon:hover {
  transform: scale(1.15);
  box-shadow: 0 8px 25px rgba(27, 94, 32, 0.4);
}

.faq-icon:active {
  transform: scale(0.95);
}

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

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

.faq-modal.active {
  display: flex;
}

.faq-modal-content {
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
  border-radius: 12px;
  padding: 30px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), 0 0 20px rgba(27, 94, 32, 0.1);
  position: relative;
  animation: slideUp 0.3s ease;
}

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

.faq-modal-content h2 {
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: 25px;
  text-align: center;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.faq-modal-content h2::before {
  content: "❓";
  font-size: 1.8rem;
}

.faq-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  color: var(--dark);
  cursor: pointer;
  transition: all 0.3s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(27, 94, 32, 0.1);
}

.faq-close:hover {
  color: var(--primary);
  background-color: rgba(27, 94, 32, 0.2);
  transform: rotate(90deg);
}

/* Scrollbar styling for FAQ modal */
.faq-modal-content::-webkit-scrollbar {
  width: 8px;
}

.faq-modal-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.faq-modal-content::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

.faq-modal-content::-webkit-scrollbar-thumb:hover {
  background: #1b5e20;
}

.faq-item {
  margin-bottom: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background-color: #fafafa;
  overflow: hidden;
  transition: all 0.3s ease;
}

.faq-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(27, 94, 32, 0.1);
}

.faq-item.active {
  border-color: var(--primary);
  background-color: #f1f8f4;
  box-shadow: 0 4px 12px rgba(27, 94, 32, 0.15);
}

.faq-question {
  font-size: 1rem;
  font-weight: 600;
  color: var(--dark);
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  background-color: #fafafa;
}

.faq-question:active {
  transform: scale(0.98);
}

.faq-item.active .faq-question {
  color: var(--primary);
  background-color: #f1f8f4;
}

.faq-question i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--primary);
  transition: transform 0.3s ease;
  margin-left: 12px;
  flex-shrink: 0;
}

.faq-item.active .faq-question i {
  transform: rotate(90deg);
}

.faq-question:hover {
  background-color: rgba(27, 94, 32, 0.05);
  padding-left: 18px;
}

.faq-item.active .faq-question:hover {
  background-color: #e8f5e9;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s ease;
  padding: 0 16px;
  background-color: #f1f8f4;
  font-size: 0.95rem;
  color: #424242;
  line-height: 1.6;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  opacity: 1;
  padding: 12px 16px 16px 16px;
  animation: slideDown 0.3s ease;
}

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

.faq-answer strong {
  color: var(--primary);
  font-weight: 600;
}

.faq-answer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.faq-answer a:hover {
  color: #1b5e20;
  text-decoration: underline;
}

/* Ensure alerts match the login box styling */
.alert {
  position: relative;
  font-size: 0.9rem;
  line-height: 1.5;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

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

.alert-dismissible .btn-close {
  padding: 0.75rem;
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
}

/* Adjust login-box padding to accommodate notifications */
.login-box {
  padding: 30px 20px;
}
@media (max-width: 1024px) {
  .container {
    max-width: 950px;
  }
  .login-box {
    width: 340px;
  }
}
@media (max-width: 450px) {
  .container {
    aspect-ratio: 1/1;
    min-height: 460px;
  }
  .welcome-box {
    border-radius: 12px;
    padding: 20px;
  }
  .login-box {
    width: 100%;
    max-width: 300px;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    padding: 20px;
  }
}

/* Consolidated Tablet & Mobile Responsive Adjustments (768px - 450px) */
@media (max-width: 768px) {
  .container {
    height: auto;
    aspect-ratio: auto;
    display: flex;
    flex-direction: column;
    gap: 20px; /* Better than negative margin - stable layout */
  }

  .login-box {
    position: relative;
    transform: none;
    margin: 0 auto 30px;
    width: 100%;
    max-width: 350px;
    left: auto;
    padding: 25px;
    margin-top: 0;
  }

  /* Font Size Optimization - Mobile Readability */
  .login-box .logo-container img {
    width: 140px; /* Tablet: reduced from 200px */
    margin-bottom: 15px;
    max-width: 90%; /* Responsive safety */
    height: auto;
  }

  .login-box .input-group {
    margin-bottom: 20px; /* Increased from default for mobile comfort */
  }

  .login-box .input-group label {
    font-size: 1rem; /* 16px - WCAG compliant, readable */
    font-weight: 600;
    margin-bottom: 10px; /* Increased spacing */
  }

  .login-box .input-group input {
    padding: 14px 12px; /* Increased padding for touch comfort */
    font-size: 1rem; /* 16px - prevents iOS auto-zoom */
    min-height: 48px; /* Touch target minimum (44-48px) */
    border-radius: 5px;
  }

  .login-box .input-group input::placeholder {
    font-size: 1rem;
  }

  /* Touch Target Optimization */
  .login-box .submit_btn {
    padding: 14px 20px;
    font-size: 1rem;
    min-height: 48px; /* Apple/Google touch target standard */
    cursor: pointer;
    transition: all 0.3s ease;
  }

  .login-box .submit_btn:active {
    transform: scale(0.98);
  }

  .toggle-password {
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 8px;
  }

  .password-input-wrapper {
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  .footer-links {
    font-size: 0.95rem;
    margin-top: 20px;
  }

  .footer-links a {
    padding: 8px 0; /* Better touch spacing */
  }

  .welcome-box {
    flex-direction: column;
    padding: 30px;
  }

  .slideshow-container {
    max-width: 100%;
  }

  .slide img {
    border-radius: 5px;
  }

  /* FAQ Modal Touch Optimization */
  .faq-modal-content {
    width: 95%;
    max-width: 90vw;
    padding: 20px;
    max-height: 85vh;
    border-radius: 15px;
    position: relative;
  }

  .faq-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
  }

  .faq-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s ease;
  }

  .faq-close:hover {
    background: rgba(0, 0, 0, 0.05);
  }

  .faq-item {
    margin-bottom: 10px;
  }

  .faq-question {
    font-size: 0.95rem;
    padding: 14px;
  }

  .faq-answer {
    font-size: 0.9rem;
  }

  .faq-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    font-size: 24px;
    bottom: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* New Media Query for 450px (450x900px screens) */
@media only screen and (max-width: 450px) {
  /* Body Adjustments */
  body {
    padding: 20px;
    padding-left: 20px;
  }

  /* Container Adjustments */
  .container {
    width: 100%;
    max-width: 400px;
    height: auto;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  /* Welcome Box Adjustments */
  .welcome-box {
    transform: none;
    left: 0;
    width: 100%;
    height: auto;
    min-height: 300px;
    padding: 20px;
    border-radius: 10px;
    background-size: cover;
    position: relative;
    z-index: 1;
  }

  /* Login Box Adjustments */
  .login-box {
    position: relative;
    width: 100%;
    max-width: 320px;
    left: auto;
    height: auto;
    padding: 25px;
    border-radius: 10px;
    margin-top: 20px; /* Replaced negative margin with positive spacing */
    z-index: 2;
  }

  .login-box .logo-container img {
    width: 120px; /* Mobile: optimized sizing */
    margin-bottom: 15px;
    max-width: 90%;
    height: auto;
  }

  .login-box .input-group {
    margin-bottom: 20px; /* Improved spacing for touch */
  }

  .login-box .input-group label {
    font-size: 1rem; /* 16px minimum for mobile readability */
    font-weight: 600;
    margin-bottom: 8px;
  }

  .login-box .input-group input {
    padding: 14px 12px; /* Larger touch-friendly padding */
    font-size: 1rem; /* 16px - prevents iOS auto-zoom on focus */
    min-height: 48px; /* Touch target minimum standard */
  }

  .login-box .input-group input::placeholder {
    font-size: 1rem;
  }

  .login-box button {
    padding: 14px 20px;
    font-size: 1rem; /* 16px for consistency */
    min-height: 48px; /* Touch target minimum */
    cursor: pointer;
  }

  .footer-links {
    font-size: 0.8rem;
  }

  /* Slideshow Adjustments */
  .slideshow-container {
    max-width: 100%;
  }

  .slide img {
    border-radius: 5px;
  }

  .dots-container {
    bottom: -50px;
  }

  .dot {
    height: 10px;
    width: 10px;
    margin: 0 3px;
  }

  /* FAQ Modal Adjustments */
  .faq-modal-content {
    width: 95%;
    max-width: 300px;
    padding: 15px;
  }

  .faq-modal-content h2 {
    font-size: 1.1rem;
  }

  .faq-question {
    font-size: 0.85rem;
  }

  .faq-answer {
    font-size: 0.8rem;
  }

  .faq-icon {
    width: 35px;
    height: 35px;
    font-size: 18px;
    bottom: 15px;
    right: 15px;
  }

  /* Remember Me Mobile */
  .remember-me {
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }
}

/* Remember Me Checkbox Styling */
.remember-me {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  padding: 10px;
  border-radius: 8px;
  background: linear-gradient(
    135deg,
    rgba(27, 94, 32, 0.05) 0%,
    rgba(46, 125, 50, 0.05) 100%
  );
}

#remember_me {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}

#remember_me:hover {
  filter: brightness(1.2);
}

.remember-me-label {
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--darker);
  margin: 0;
  user-select: none;
  transition: color 0.2s ease;
}

.remember-me-label:hover {
  color: var(--primary);
}

#remember_me:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* Loading State Styling */
.loading-spinner {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}

.loading-spinner.active {
  display: flex;
}

.spinner-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  background: white;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease;
}

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

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(27, 94, 32, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.spinner-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--darker);
  text-align: center;
}

.spinner-subtext {
  font-size: 0.9rem;
  color: #666;
  text-align: center;
}

/* Disable form elements during loading */
form.loading input,
form.loading button,
form.loading .toggle-password {
  pointer-events: none;
  opacity: 0.6;
}

form.loading .submit_btn {
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

form.loading .submit_btn .spinner-mini {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Extra Small Screens - Ultra-Responsive FAQ */
@media only screen and (max-width: 360px) {
  .faq-modal-content {
    width: 98%;
    max-width: 280px;
    padding: 12px;
    border-radius: 8px;
  }

  .faq-modal-content h2 {
    font-size: 1rem;
    margin-bottom: 15px;
    gap: 5px;
  }

  .faq-item {
    margin-bottom: 8px;
    border-radius: 6px;
  }

  .faq-question {
    font-size: 0.8rem;
    padding: 12px;
    gap: 8px;
  }

  .faq-question i {
    width: 20px;
    height: 20px;
    font-size: 14px;
  }

  .faq-answer {
    font-size: 0.75rem;
    line-height: 1.4;
    padding: 10px 12px 12px 12px;
  }

  .faq-close {
    top: 10px;
    right: 10px;
    font-size: 24px;
    width: 28px;
    height: 28px;
  }

  .faq-icon {
    width: 45px;
    height: 45px;
    font-size: 20px;
    bottom: 10px;
    right: 10px;
  }
}

/* Comprehensive 320px Breakpoint - Ultra-Small Phone Support */
@media only screen and (max-width: 320px) {
  body {
    padding: 10px;
    font-size: 14px;
  }

  .container {
    max-width: 100%;
    gap: 15px;
  }

  .login-box {
    max-width: 100% !important;
    width: calc(100% - 20px);
    padding: 15px;
    margin: 10px auto;
  }

  .login-box .logo-container img {
    width: 100px; /* Ultra-small: 100px */
    margin-bottom: 10px;
  }

  .login-box .input-group {
    margin-bottom: 15px;
  }

  .login-box .input-group label {
    font-size: 0.95rem;
    margin-bottom: 6px;
  }

  .login-box .input-group input {
    padding: 12px 10px;
    font-size: 0.95rem;
    min-height: 44px;
  }

  .login-box button {
    padding: 12px 15px;
    font-size: 0.95rem;
    min-height: 44px;
  }

  .footer-links {
    font-size: 0.85rem;
    margin-top: 15px;
  }

  .welcome-box {
    min-height: 250px;
    padding: 15px;
  }

  .faq-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
    bottom: 10px;
    right: 10px;
  }
}

/* Landscape Mode Support - Handle short viewport heights */
@media (max-height: 600px) and (orientation: landscape) {
  .container {
    min-height: auto;
    aspect-ratio: auto;
    margin: 10px auto;
  }

  .welcome-box {
    display: none; /* Hide welcome box in landscape on small screens */
  }

  .login-box {
    width: 100%;
    max-width: 600px;
    position: relative;
    transform: none;
    left: auto;
    margin: 10px auto;
    padding: 20px;
  }

  .login-box h1 {
    font-size: 1.2rem;
    margin-bottom: 15px;
  }

  .login-box .input-group {
    margin-bottom: 12px;
  }

  .submit_btn {
    min-height: 40px;
    font-size: 0.95rem;
    padding: 10px;
  }
}

/* Extra Small Screens - Ultra-Responsive FAQ (ORIGINAL - kept for reference) */
@media only screen and (max-width: 360px) {
  .faq-modal-content {
    width: 98%;
    max-width: 280px;
    padding: 12px;
    border-radius: 8px;
  }

  .faq-modal-content h2 {
    font-size: 1rem;
    margin-bottom: 15px;
    gap: 5px;
  }

  .faq-item {
    margin-bottom: 8px;
    border-radius: 6px;
  }

  .faq-question {
    font-size: 0.8rem;
    padding: 12px;
    gap: 8px;
  }

  .faq-question i {
    width: 20px;
    height: 20px;
    font-size: 14px;
  }

  .faq-answer {
    font-size: 0.75rem;
    line-height: 1.4;
    padding: 10px 12px 12px 12px;
  }

  .faq-close {
    top: 10px;
    right: 10px;
    font-size: 24px;
    width: 28px;
    height: 28px;
  }

  .faq-icon {
    width: 45px;
    height: 45px;
    font-size: 20px;
    bottom: 10px;
    right: 10px;
  }
}}

/* Touch Device Optimizations */
@media (pointer: coarse) and (hover: none) {
  .faq-question {
    padding: 14px;
    min-height: 44px;
  }

  .faq-question i {
    min-width: 24px;
    min-height: 24px;
  }

  .faq-icon {
    width: 60px;
    height: 60px;
    bottom: 15px;
    right: 15px;
  }

  .faq-modal-content {
    border-radius: 16px;
  }
}

/* High DPI Screens */
@media (min-resolution: 192dpi) {
  .faq-item {
    border: 1.5px solid #e0e0e0;
  }

  .faq-modal-content {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), 0 0 20px rgba(27, 94, 32, 0.15);
  }
}

/* Print Styles */
@media print {
  .faq-icon,
  .faq-close {
    display: none !important;
  }

  .faq-modal-content {
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .faq-item {
    page-break-inside: avoid;
  }

  .faq-answer {
    display: block !important;
    max-height: 100% !important;
    opacity: 1 !important;
    padding: 12px 16px 16px 16px !important;
  }
}
