/* ==== MODERN AUTH FORM STYLES ==== */

/* Auth Page Hero Section */
section.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding-top: 60px; /* Reduced from 100px */
  padding-bottom: 60px;
}

section.hero .row {
  align-items: center;
  margin-top: -30px;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

section.hero .container {
  width: 100%;
}

/* Animation and Form Column Height & Alignment */
section.hero [class*="col-lg-"] {
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 992px) {
  section.hero [class*="col-lg-"] {
    min-height: 650px;
  }
}

/* reCAPTCHA Scaling */
.auth-form .g-recaptcha {
  transform: scale(0.85);
  transform-origin: center;
}

.auth-form .g-recaptcha + .mb-4,
.auth-form .d-flex.justify-content-center.mb-4 {
  margin-bottom: 1rem !important;
}

/* Form Container */
.auth-form-container {
  max-width: 440px; /* Reduced from 480px */
  width: 100%;
  margin: 0 auto;
  padding: 0 15px;
}

.register-container {
  max-width: 580px; /* Reduced from 620px */
  width: 100%;
}

/* Glassmorphism Card */
.auth-form-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 24px;
  padding: 32px 30px;
  box-shadow:
    0 8px 32px rgba(31, 38, 135, 0.15),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
  border: 1px solid rgba(255, 255, 255, 0.4);
  animation: cardFadeIn 0.6s ease-out;
  position: relative;
  overflow: hidden;
}

.auth-form-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(14, 162, 189, 0.8),
    transparent
  );
  animation: shimmer 3s infinite;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 200%;
  }
}

/* Form Header */
.auth-form-header {
  text-align: center;
  margin-bottom: 20px;
  animation: headerSlideIn 0.8s ease-out 0.2s both;
}

@keyframes headerSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-title {
  font-size: clamp(24px, 5vw, 32px);
  font-weight: 800;
  background: linear-gradient(135deg, #0ea2bd 0%, #4ec7f3 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0 !important;
  font-family: "Nunito", sans-serif;
}

.auth-subtitle {
  color: #64748b;
  font-size: 13px;
  margin: 0;
  font-weight: 500;
}

/* Modern Floating Input */
.form-floating-modern {
  position: relative;
  margin-bottom: 16px;
  animation: inputSlideIn 0.6s ease-out backwards;
}

.form-floating-modern:nth-child(1) {
  animation-delay: 0.3s;
}
.form-floating-modern:nth-child(2) {
  animation-delay: 0.4s;
}
.form-floating-modern:nth-child(3) {
  animation-delay: 0.5s;
}

@keyframes inputSlideIn {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.form-control-modern {
  width: 100%;
  padding: 10px 16px 10px 38px; /* Reduced padding */
  font-size: 14px; /* Slightly smaller font */
  font-weight: 500;
  border: 2px solid #e2e8f0;
  border-radius: 12px; /* Slightly sharper corners */
  background: #ffffff;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  color: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  height: 48px; /* Reduced from 56px */
  line-height: normal;
  display: block;
}

/* Custom Select Modern with Flags */
.custom-select-wrapper {
  position: relative;
  width: 100%;
  margin-top: 15px; /* Give even more room for the floating label */
  margin-bottom: 36px !important; /* Increase space to fields below further */
}

.custom-select-modern {
  height: 42px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 0 40px 0 44px; /* Slightly more left padding for better flag separation */
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
}

.custom-select-modern:hover {
  border-color: #0ea2bd;
  box-shadow: 0 4px 12px rgba(14, 162, 189, 0.1);
}

.custom-select-modern.active {
  border-color: #0ea2bd;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.selected-flag {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.custom-select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 12px;
  transition: transform 0.3s ease;
}

.custom-select-modern.active .custom-select-arrow {
  transform: translateY(-50%) rotate(180deg);
}

.custom-options-container {
  position: absolute;
  top: 40px; /* 42px height - 2px border overlap */
  left: 0;
  right: 0;
  background: #ffffff;
  border: 2px solid #0ea2bd;
  border-top: none;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  z-index: 1000;
  display: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.custom-select-modern.active + .custom-options-container {
  display: block;
  animation: slideDown 0.3s ease forwards;
}

.custom-option {
  padding: 10px 15px;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.custom-option:hover {
  background: rgba(14, 162, 189, 0.08);
  color: #0ea2bd;
  padding-left: 20px;
}

.custom-option .flag-icon {
  margin-right: 12px;
  width: 22px;
  border-radius: 2px;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Floating label fix for custom select */
.custom-select-wrapper label {
  position: absolute;
  top: 0;
  left: 12px;
  transform: translateY(-29px) scale(0.8) !important;
  color: #0ea2bd !important;
  font-weight: 600 !important;
  z-index: 10;
  pointer-events: none;
}

select.form-control-modern {
  height: 42px; /* Further reduced from 48px */
  padding-top: 0; /* Let line-height/centering handle it */
  padding-bottom: 0;
  line-height: 38px; /* Balanced for 42px height (42 - 4px border) */
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%2364748b' class='bi bi-chevron-down' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

.form-control-modern::placeholder {
  color: transparent;
}

.form-control-modern:focus {
  border-color: #0ea2bd;
  background: #ffffff;
  box-shadow:
    0 0 0 4px rgba(14, 162, 189, 0.08),
    0 4px 16px rgba(14, 162, 189, 0.12);
  transform: translateY(-1px);
}

/* Floating Label Logic using :has() for maximum robustness */
.form-floating-modern:focus-within label,
.form-floating-modern:has(.form-control-modern:not(:placeholder-shown)) label {
  transform: translateY(-32px) scale(0.8); /* Adjusted for 48px height */
  color: #0ea2bd;
  font-weight: 600;
  z-index: 10;
}

.form-floating-modern:has(select) label {
  transform: translateY(-29px) scale(0.8); /* Adjusted for 42px height */
  color: #0ea2bd;
  font-weight: 600;
  z-index: 10;
}

/* Secondary Selector for non-:has support or specific edge cases */
.form-control-modern:focus + label,
.form-control-modern:not(:placeholder-shown) + label {
  transform: translateY(-32px) scale(0.8);
  color: #0ea2bd;
  font-weight: 600;
  z-index: 10;
}

select.form-control-modern + label {
  transform: translateY(-29px) scale(0.8);
  color: #64748b;
  font-weight: 600;
  z-index: 10;
}

.form-control-modern:not(:placeholder-shown) + label {
  color: #64748b;
}

.form-control-modern:focus + label i {
  color: #0ea2bd;
  transform: scale(1.1) rotate(5deg);
}

.form-control-modern:not(:placeholder-shown) + label i {
  opacity: 0.7;
}

.form-floating-modern label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 13px; /* Slightly smaller */
  font-weight: 500;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: #ffffff;
  padding: 0 6px; /* Reduced padding */
  display: flex;
  align-items: center;
  gap: 6px;
  transform-origin: left center;
  z-index: 5;
  border-radius: 4px;
  max-width: calc(100% - 24px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.form-floating-modern label i {
  font-size: 16px;
  color: #94a3b8;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animated Border - REMOVED */
.input-border {
  display: none;
}

/* Input Icon Animation */
.form-floating-modern::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(14, 162, 189, 0.1),
    rgba(78, 199, 243, 0.1)
  );
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.form-floating-modern:has(.form-control-modern:focus)::before,
.form-floating-modern:focus-within::before {
  opacity: 1;
  transform: translateY(-50%) scale(2.5);
}

/* intl-tel-input Compatibility */
.iti {
  width: 100% !important;
  display: block;
}

.iti__flag-container {
  z-index: 15;
}

.iti + label,
.iti ~ label {
  left: 52px !important;
}

/* intl-tel-input Dropdown Modern Styling & Transparency Fix */
.iti--inline-dropdown .iti__dropdown-content {
  z-index: 1050 !important; /* Higher than floating labels (10) */
  margin-top: 0 !important; /* Removes the gap between input and dropdown */
  background-color: #ffffff !important;
}

.iti__country-list {
  background-color: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
  z-index: 1000 !important;
  max-width: 300px !important;
}

.iti__search-input {
  background-color: #f8fafc !important; /* Very light slate gray */
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 10px 12px !important;
  margin: 10px !important;
  width: calc(100% - 20px) !important;
  color: #1e293b !important;
  font-size: 14px !important;
  font-family: inherit !important;
  outline: none !important;
}

.iti__search-input:focus {
  border-color: #0ea2bd !important;
  box-shadow: 0 0 0 3px rgba(14, 162, 189, 0.1) !important;
  background-color: #ffffff !important;
}

.iti__country {
  padding: 10px 12px !important;
  transition: background-color 0.2s ease !important;
}

.iti__country:hover,
.iti__country.iti__highlight {
  background-color: rgba(14, 162, 189, 0.08) !important;
}

.iti__country-name {
  color: #1e293b !important;
  font-size: 14px !important;
}

.iti__dial-code {
  color: #64748b !important;
}

/* Modern Checkbox */
.form-check-modern {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-check-input-modern {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.form-check-label-modern {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  transition: color 0.3s;
}

.form-check-label-modern:hover {
  color: #0ea2bd;
}

.checkmark {
  position: relative;
  height: 20px;
  width: 20px;
  background-color: #f1f5f9;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-right: 8px;
}

.form-check-input-modern:checked ~ .form-check-label-modern .checkmark {
  background: linear-gradient(135deg, #0ea2bd 0%, #4ec7f3 100%);
  border-color: #0ea2bd;
  animation: checkboxPop 0.3s ease-out;
}

@keyframes checkboxPop {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.form-check-input-modern:checked ~ .form-check-label-modern .checkmark:after {
  display: block;
  animation: checkmarkDraw 0.3s ease-out 0.1s both;
}

@keyframes checkmarkDraw {
  from {
    height: 0;
  }
  to {
    height: 10px;
  }
}

/* Forgot Link */
.forgot-link {
  color: #0ea2bd;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s;
  position: relative;
}

.forgot-link:after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #0ea2bd;
  transition: width 0.3s;
}

.forgot-link:hover {
  color: #0d8a9f;
}

.forgot-link:hover:after {
  width: 100%;
}

/* Modern Button */
.btn-modern {
  position: relative;
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.btn-primary-modern {
  background: linear-gradient(135deg, #0ea2bd 0%, #4ec7f3 100%);
  color: white;
  box-shadow:
    0 4px 15px rgba(14, 162, 189, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.1);
  animation: btnFadeIn 0.6s ease-out 0.6s both;
}

@keyframes btnFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn-primary-modern:hover {
  transform: translateY(-2px);
  box-shadow:
    0 6px 25px rgba(14, 162, 189, 0.4),
    0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-primary-modern:active {
  transform: translateY(0);
}

.btn-primary-modern::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.btn-primary-modern:hover::before {
  left: 100%;
}

.btn-icon {
  transition: transform 0.3s;
  display: inline-flex;
  align-items: center;
}

.btn-primary-modern:hover .btn-icon {
  transform: translateX(6px);
}

/* Auth Footer */
.auth-footer {
  animation: footerFadeIn 0.6s ease-out 0.7s both;
}

@keyframes footerFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.auth-footer p {
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
}

.register-link {
  color: #0ea2bd;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s;
  position: relative;
}

.register-link:after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #0ea2bd, #4ec7f3);
  transition: width 0.3s;
}

.register-link:hover {
  color: #0d8a9f;
}

.register-link:hover:after {
  width: 100%;
}

/* Responsive */
@media (max-width: 991px) {
  section.hero {
    padding-top: 70px;
    padding-bottom: 30px;
  }

  section.hero .row {
    margin-top: 0;
  }

  .auth-form-container,
  .register-container {
    max-width: 100%;
    padding: 0 8px;
  }

  section.hero .col-lg-4,
  section.hero .col-lg-6 {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
  }
}

@media (max-width: 768px) {
  section.hero {
    min-height: auto;
    padding-top: 80px;
    padding-bottom: 40px;
  }

  .auth-form-card {
    padding: 24px 18px;
    border-radius: 20px;
  }

  .auth-title {
    font-size: 22px;
  }

  .auth-subtitle {
    font-size: 12px;
  }

  .form-control-modern {
    padding: 10px 12px 10px 36px;
    font-size: 14px;
    height: 46px;
  }

  .auth-form-header {
    margin-bottom: 0;
  }

  .form-floating-modern {
    margin-bottom: 16px;
  }

  .auth-tabs .nav-link {
    font-size: 13px;
    padding: 8px 10px;
  }

  .btn-modern {
    padding: 14px 24px;
    font-size: 15px;
  }

  .custom-select-modern {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  section.hero {
    padding-top: 70px;
    padding-bottom: 30px;
  }

  .auth-form-card {
    padding: 20px 14px;
    border-radius: 16px;
  }

  .auth-form-container,
  .register-container {
    padding: 0 4px;
  }

  section.hero .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .auth-title {
    font-size: 20px;
  }

  .auth-tabs .nav-link {
    font-size: 12px;
    padding: 7px 8px;
  }

  .btn-modern {
    padding: 13px 20px;
    font-size: 14px;
  }

  .form-check-label-modern {
    font-size: 12px;
  }

  .forgot-link {
    font-size: 12px;
  }

  .auth-footer p {
    font-size: 12px;
  }
}

/* Security: Honeypot Field */
.honeypot-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
