/* ========================================
   CUSTOM LOGIN STYLES - MOBILE FIRST DESIGN
   ======================================== */

/* ========================================
   CRITICAL: Bootstrap Overrides ONLY for Mobile
   ======================================== */

@media (max-width: 767px) {
  /* Force full width on all wrappers - MOBILE ONLY */
  .container-scroller {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .page-body-wrapper.full-page-wrapper {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }

  .content-wrapper.auth {
    padding: 0 !important;
    width: 100% !important;
    min-height: 100vh !important;
  }

  /* Remove Bootstrap row restrictions */
  .content-wrapper .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
  }

  /* CRITICAL: Override Bootstrap column classes */
  .content-wrapper .row > div[class*="col-"] {
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }
}

/* Override Bootstrap padding utilities on form - ALL SCREENS */
.auth-form-light.py-5 {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.auth-form-light.px-4,
.auth-form-light.px-sm-5 {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* ========================================
   END Bootstrap Overrides
   ======================================== */

/* Global Login Container Improvements */
#video-container {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#video-container video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  object-fit: cover;
  z-index: 1;
}

/* Mobile-First: Form Container */
.auth-form-light {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
  margin: 1rem auto !important;
  padding: 2.5rem 2rem !important;

  /* Glassmorphism Effect */
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);

  /* Modern Shadows */
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2),
    0 2px 8px 0 rgba(0, 0, 0, 0.1);

  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.18);

  /* Smooth Transitions */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Logo Styling */
.brand-logo {
  text-align: center;
  margin-bottom: 1.5rem;
  animation: fadeInDown 0.6s ease-out;
}

.brand-logo img {
  max-width: 180px;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  transition: transform 0.3s ease;
}

.brand-logo img:hover {
  transform: scale(1.05);
}

/* Typography Improvements */
.auth-form-light h4 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #000000 !important;
  margin-bottom: 0.5rem;
  text-align: center;
  animation: fadeInDown 0.6s ease-out 0.1s backwards;
}

.auth-form-light .font-weight-light,
.auth-form-light h6 {
  font-size: 0.95rem;
  color: #1a202c !important;
  margin-bottom: 2rem;
  text-align: center;
  line-height: 1.5;
  animation: fadeInDown 0.6s ease-out 0.2s backwards;
}

/* Social Icons */
.social-container {
  margin: 1.25rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  animation: fadeInDown 0.6s ease-out 0.3s backwards;
}

.social-container a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.social-container a:hover {
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.social-container a i {
  font-size: 1.1rem;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
  animation: fadeInUp 0.6s ease-out 0.4s backwards;
}

.form-control:not([type="checkbox"]) {
  padding: 0.875rem 1.25rem;
  font-size: 0.95rem;
  color: #000000 !important;
  border: 2px solid #cbd5e0 !important;
  border-radius: 12px;
  background: #edf2f7 !important;
  transition: all 0.3s ease;
  width: 100%;
}

.form-control:not([type="checkbox"]):focus {
  outline: none;
  color: #000000 !important;
  border-color: #667eea !important;
  background: #f7fafc !important;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  transform: translateY(-1px);
}

.form-control:not([type="checkbox"])::placeholder {
  color: #a0aec0 !important;
}

/* reCAPTCHA Container - Mobile Optimized */
.g-recaptcha {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
  animation: fadeInUp 0.6s ease-out 0.5s backwards;
}

/* Button Styling */
.auth-form-btn {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  margin-top: 0.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: fadeInUp 0.6s ease-out 0.6s backwards;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

/* Remember Me & Forgot Password */
.my-2 {
  animation: fadeInUp 0.6s ease-out 0.7s backwards;
}

.form-check-label {
  font-size: 0.875rem;
  color: #4a5568;
  cursor: pointer;
  user-select: none;
}

.btn-link {
  font-size: 0.875rem;
  color: #667eea;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-link:hover {
  color: #764ba2;
  text-decoration: underline;
}

/* Checkbox Styling - Complete Custom */
.form-check-input {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  width: 1.25rem !important;
  height: 1.25rem !important;
  margin-top: 0.125rem !important;
  margin-right: 0.5rem !important;
  border: 2px solid #cbd5e0 !important;
  border-radius: 0.375rem !important;
  background-color: white !important;
  background-image: none !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  position: relative !important;
  flex-shrink: 0 !important;
}

/* Remove Bootstrap default styles */
.form-check-input[type="checkbox"] {
  background-image: none !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: contain !important;
}

.form-check-input:hover {
  border-color: #667eea !important;
}

.form-check-input:checked {
  background-color: #667eea !important;
  border-color: #667eea !important;
  background-image: none !important;
}

/* Check mark icon */
.form-check-input:checked::before {
  content: '✓' !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  color: white !important;
  font-size: 0.875rem !important;
  font-weight: bold !important;
  line-height: 1 !important;
}

/* Hide Bootstrap's default check mark */
.form-check-input::after,
.form-check-input:checked::after {
  display: none !important;
  content: none !important;
}

.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
  border-color: #667eea !important;
  background-image: none !important;
}

.form-check {
  display: flex;
  align-items: center;
}

.form-check-label {
  font-size: 0.875rem;
  color: #2d3748 !important;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
}

.form-check-label.text-muted {
  color: #2d3748 !important;
}

/* Timer Display */
#timer {
  animation: fadeInUp 0.6s ease-out 0.8s backwards;
  padding: 0.75rem;
  border-radius: 8px;
  background: rgba(102, 126, 234, 0.05);
  margin-top: 1rem;
}

#time-remaining {
  color: #667eea;
  font-weight: 700;
}

/* WhatsApp Float Button */
#whatsapp-icon {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: pulse 2s infinite;
}

#whatsapp-icon:hover {
  transform: scale(1.1) translateY(-5px);
  box-shadow: 0 8px 30px rgba(37, 211, 102, 0.6);
}

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

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

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

/* Fade Effects for Inactivity */
.fade-out {
  opacity: 0.15;
  transition: opacity 1.5s ease-in-out;
}

.fade-in {
  opacity: 1;
  transition: opacity 0.4s ease-in-out;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Small Mobile Devices (320px - 480px) */
@media (max-width: 480px) {
  .auth-form-light {
    width: calc(100% - 2rem) !important;
    margin: 1rem auto !important;
    padding: 2rem 1.5rem !important;
    border-radius: 20px;
  }

  .auth-form-light h4 {
    font-size: 1.5rem;
  }

  .auth-form-light .font-weight-light {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
  }

  .brand-logo img {
    max-width: 150px;
  }

  .form-control {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .auth-form-btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
  }

  .social-container a {
    width: 38px;
    height: 38px;
  }

  /* reCAPTCHA scaling for very small screens */
  .g-recaptcha {
    transform: scale(0.85);
    transform-origin: center;
    margin-bottom: 0.5rem;
  }
}

/* Extra Small Devices (< 360px) */
@media (max-width: 360px) {
  .auth-form-light {
    width: calc(100% - 1.5rem) !important;
    margin: 0.75rem auto !important;
    padding: 1.75rem 1.25rem !important;
  }

  .auth-form-light h4 {
    font-size: 1.35rem;
  }

  .brand-logo img {
    max-width: 130px;
  }

  /* More aggressive reCAPTCHA scaling */
  .g-recaptcha {
    transform: scale(0.75);
  }
}

/* Tablets and Small Desktops (768px - 991px) */
@media (min-width: 768px) {
  .auth-form-light {
    max-width: 450px;
    padding: 3rem 2.5rem !important;
  }

  .auth-form-light h4 {
    font-size: 2rem;
  }

  .brand-logo img {
    max-width: 200px;
  }

  /* Hide video on tablets, show background image */
  #video-container video {
    display: none;
  }

  #video-container {
    background: url(../img/bgLogin3.jpg) no-repeat center center fixed;
    background-size: cover;
  }

  #video-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
      135deg,
      rgba(102, 126, 234, 0.7) 0%,
      rgba(118, 75, 162, 0.7) 100%
    );
    z-index: 1;
  }
}

/* Large Desktops (992px and up) */
@media (min-width: 992px) {
  .auth-form-light {
    max-width: 480px;
    padding: 3.5rem 3rem !important;
  }

  /* Show video on large screens */
  #video-container video {
    display: block;
  }

  #video-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
  }

  /* Enhanced glassmorphism on desktop */
  .auth-form-light {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
  }
}

/* Ultra Wide Screens (1400px and up) */
@media (min-width: 1400px) {
  .auth-form-light {
    max-width: 520px;
    padding: 4rem 3.5rem !important;
  }
}

/* Hide header on mobile for cleaner view */
@media (max-width: 768px) {
  #header {
    display: none;
  }

  /* Adjust main container since header is hidden */
  .container-scroller {
    padding-top: 0;
  }
}

/* Footer adjustments for mobile */
@media (max-width: 768px) {
  footer {
    position: static;
    font-size: 0.75rem;
    padding: 1rem 0.5rem;
    background: rgba(34, 34, 34, 0.95);
    backdrop-filter: blur(10px);
  }

  footer p {
    margin: 0.5rem 0;
    line-height: 1.4;
  }
}

/* Landscape Orientation on Mobile */
@media (max-height: 600px) and (orientation: landscape) {
  .auth-form-light {
    margin: 0.5rem auto;
    padding: 1.5rem 1.25rem;
    max-height: 90vh;
    overflow-y: auto;
  }

  .auth-form-light h4 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
  }

  .auth-form-light .font-weight-light {
    font-size: 0.8rem;
    margin-bottom: 1rem;
  }

  .brand-logo {
    margin-bottom: 0.75rem;
  }

  .brand-logo img {
    max-width: 120px;
  }

  .form-group {
    margin-bottom: 0.75rem;
  }

  #timer {
    display: none;
  }

  .social-container {
    margin: 0.75rem 0;
  }
}

/* Dark Mode Support (Optional - if user prefers dark mode) */
@media (prefers-color-scheme: dark) {
  .auth-form-light {
    background: rgba(26, 32, 44, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .auth-form-light h4 {
    color: #f7fafc;
  }

  .auth-form-light .font-weight-light {
    color: #cbd5e0;
  }

  .form-control {
    background: rgba(45, 55, 72, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f7fafc;
  }

  .form-control:focus {
    background: rgba(45, 55, 72, 0.8);
    border-color: #667eea;
  }

  #timer {
    background: rgba(102, 126, 234, 0.15);
  }
}

/* ========================================
   CRITICAL OVERRIDES - Maximum Priority
   ======================================== */

/* Force dark colors on headings - MAXIMUM PRIORITY */
.auth-form-light h4,
.content-wrapper .auth-form-light h4,
div.auth-form-light h4 {
  color: #000000 !important;
  opacity: 1 !important;
}

.auth-form-light h6,
.auth-form-light .font-weight-light,
.content-wrapper .auth-form-light h6,
.content-wrapper .auth-form-light .font-weight-light,
div.auth-form-light h6,
div.auth-form-light .font-weight-light {
  color: #1a202c !important;
  opacity: 1 !important;
}

/* Force dark text color on inputs - MAXIMUM PRIORITY */
.auth-form-light .form-control,
.auth-form-light input.form-control,
.auth-form-light input[type="text"],
.auth-form-light input[type="password"],
.content-wrapper .auth-form-light .form-control,
.content-wrapper .auth-form-light input {
  color: #000000 !important;
  -webkit-text-fill-color: #000000 !important;
  background: #edf2f7 !important;
  border: 2px solid #cbd5e0 !important;
  opacity: 1 !important;
}

.auth-form-light .form-control:focus,
.auth-form-light input.form-control:focus,
.auth-form-light input[type="text"]:focus,
.auth-form-light input[type="password"]:focus {
  background: #f7fafc !important;
  border-color: #667eea !important;
}

.auth-form-light .form-control::placeholder,
.auth-form-light input::placeholder {
  color: #a0aec0 !important;
  opacity: 1 !important;
}
