/* ===== BASE STYLES ===== */
.login-popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:rgb(73 73 73 / 73%);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* ===== POPUP CONTENT ===== */
.login-popup-content {
  background: white;
  width: 100%;
  height: 100%;
  max-height: 100vh;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ===== CLOSE BUTTON ===== */
.login-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: white;
  border: 1px solid #E2E8F0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  font-size: 16px;
  transition: all 0.2s ease;
}

.login-close-btn:hover {
  background: #F8FAFC;
  color: #E97C43;
}

/* ===== HEADER SECTION ===== */
.login-header {
  background: white;
  padding: 50px 20px 16px;
  text-align: center;
  color: #1E293B;
  position: relative;
  border-bottom: 1px solid #F1F5F9;
}

.login-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: #1E293B;
  line-height: 1.3;
}

.login-subtitle {
  font-size: 13px;
  opacity: 0.8;
  margin: 0;
  font-weight: 400;
  color: #64748B;
}

/* ===== BODY SECTION ===== */
.login-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== ALERT MESSAGE ===== */
.login-alert {
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 14px;
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

.login-alert.error {
  background: #FFF5F5;
  color: #DC2626;
  border: 1px solid #FECACA;
}

.login-alert.success {
  background: #F0FDF4;
  color: #16A34A;
  border: 1px solid #BBF7D0;
}

/* ===== FORM STYLES ===== */
.login-form {
  display: block;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 13px;
  color: #1E293B;
}

/* ===== INPUT GROUP FIX ===== */
.input-group {
  display: flex;
  align-items: center;
  background: white;
  border-radius: 8px;
  border: 1.5px solid #E2E8F0;
  transition: all 0.2s ease;
  overflow: hidden;
}

.input-group:focus-within {
  border-color: #E97C43;
  box-shadow: 0 0 0 3px rgba(233, 124, 67, 0.1);
  /* Subtle glow */;
}

.country-code {
  padding: 0 15px;
  background: #F8FAFC border-right: 1px solid #E2E8F0;
  /* Only right border */ font-weight: 600;
  color: #E97C43;
  font-size: 14px;
  height: 100%;
  display: flex;
  align-items: center;
}

.form-input {
  flex: 1;
  border: none !important;
  /* Remove individual border */ background: transparent;
  padding: 12px 15px;
  font-size: 14px;
  color: #1E293B;
  outline: none !important;
  box-shadow: none !important;
  /* Remove any shadow */;
}

.form-input::placeholder {
  color: #94A3B8;
  font-weight: 400;
}

.input-icon {
  padding: 0 12px;
  color: #94A3B8;
  font-size: 14px;
}

/* ===== OTP SECTION ===== */
.otp-section {
  display: none;
}

.otp-inputs-container {
  display: flex;
  gap: 6px;
  margin: 8px 0;
}

.otp-digit {
  flex: 1;
  width: 42px;
  height: 44px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: white;
  color: #1E293B;
  outline: none;
  transition: all 0.2s ease;
}

.otp-digit:focus {
  border-color: #E97C43;
}

.otp-timer {
  text-align: center;
  margin-top: 12px;
  font-size: 12px;
  color: #64748B;
}

.otp-verifying-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #E97C43;
}

.otp-verifying-status .login-spinner {
  display: inline-block !important;
  width: 14px;
  height: 14px;
  border-color: rgba(233, 124, 67, 0.25);
}

.resend-link {
  color: #E97C43;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: none;
}

.resend-link:hover {
  text-decoration: underline;
}

/* ===== SUBMIT BUTTON ===== */
.login-submit-btn {
  width: 100%;
  padding: 12px;
  background: #E97C43;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
  transition: all 0.2s ease;
  height: 44px;
}

.login-submit-btn:hover {
  background: #D66934;
}

.login-submit-btn:disabled {
  background: #CBD5E1;
  cursor: not-allowed;
}

.login-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s linear infinite;
  display: none;
}

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

/* ===== TERMS AGREEMENT ===== */
.terms-agreement {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 16px 0;
  padding: 12px;
  background: #F8FAFC;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
}

/* ===== TERMS CHECKBOX FIX ===== */
.terms-agreement input[type="checkbox"] {
  appearance: none;
  /* Reset default browser style */ -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #E2E8F0;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  margin-top: 0;
  /* Alignment fix */;
}

.terms-agreement input[type="checkbox"]:checked {
  background-color: #E97C43;
  border-color: #E97C43;
}

/* Custom White Tick - plain CSS shape, no external icon font required
   (the previous version referenced a Font Awesome glyph that was never
   loaded on this page, so the checkbox turned orange when checked but
   never actually showed a tick mark). */
.terms-agreement input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.terms-agreement label {
  margin: 0;
  font-size: 11px;
  color: #475569;
  line-height: 1.5;
  cursor: pointer;
}

.terms-link {
  color: #E97C43;
  font-weight: 600;
  text-decoration: none;
}

.terms-link:hover {
  text-decoration: underline;
}

/* ===== SIGNUP SECTION ===== */
.signup-section {
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #F1F5F9;
}

.signup-text {
  color: #64748B;
  font-size: 13px;
  margin-bottom: 12px;
  font-weight: 500;
}

.signup-btn {
  width: 100%;
  padding: 12px;
  background: white;
  color: #E97C43;
  border: 1px solid #E97C43;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.signup-btn:hover {
  background: #FFF5F0;
}

/* ===== DESKTOP SPECIFIC STYLES ===== */
@media (min-width: 768px) {
  .login-popup-overlay {
    padding: 20px;
  }
  .login-popup-content {
    width: 100%;
    max-width: 380px;
    height: auto;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: var(--sh-1);
  }
  .login-close-btn {
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: white;
    border: 1px solid #E2E8F0;
    box-shadow: var(--sh-1);
  }
  .login-header {
    border-radius: 12px 12px 0 0;
    padding: 50px 20px 20px;
  }
  .login-title {
    font-size: 20px;
  }
  .login-subtitle {
    font-size: 13px;
  }
  .login-body {
    padding: 20px;
  }
  .form-input {
    font-size: 14px;
    padding: 14px 12px;
    height: 48px;
  }
  .country-code {
    padding: 0 16px;
    font-size: 14px;
  }
  .otp-digit {
    height: 48px;
    font-size: 20px;
  }
  .login-submit-btn {
    padding: 14px;
    font-size: 14px;
    height: 48px;
  }
}

/* ===== MOBILE SPECIFIC OPTIMIZATIONS ===== */
@media (max-width: 767px) {
  .login-header {
    padding: 50px 20px 20px;
  }
  .login-title {
    font-size: 18px;
  }
  .login-subtitle {
    font-size: 13px;
  }
  .login-body {
    padding: 16px;
  }
  .form-input {
    font-size: 14px;
    padding: 12px 12px;
  }
  .form-label {
    font-size: 13px;
  }
  .otp-digit {
    height: 44px;
    font-size: 18px;
  }
  .login-submit-btn {
    font-size: 14px;
    padding: 12px;
  }
  .signup-btn {
    font-size: 13px;
    padding: 12px;
  }
  /* Prevent zoom on input focus in iOS */
  @media (max-width: 767px) {
    input,
    select,
    textarea {
      font-size: 16px !important;
    }
  }
}

/* ===== SMALL MOBILE (iPhone SE etc) ===== */
@media (max-width: 375px) {
  .login-header {
    padding: 50px 16px 16px;
  }
  .login-title {
    font-size: 16px;
  }
  .login-body {
    padding: 14px;
  }
  .otp-inputs-container {
    gap: 4px;
  }
  .otp-digit {
    height: 40px;
    font-size: 16px;
  }
  .terms-agreement {
    padding: 10px;
    font-size: 10px;
  }
}

/* ===== ACCESSIBILITY ===== */
.form-input:focus,
.otp-digit:focus,
.login-submit-btn:focus,
.signup-btn:focus {
  outline: 2px solid #E97C43;
  outline-offset: 2px;
}

/* ===== SCROLLBAR STYLING ===== */
.login-body::-webkit-scrollbar {
  width: 3px;
}

.login-body::-webkit-scrollbar-track {
  background: transparent;
}

.login-body::-webkit-scrollbar-thumb {
  background: #E2E8F0;
  border-radius: 2px;
}

.login-body::-webkit-scrollbar-thumb:hover {
  background: #CBD5E1;
}
