/* ─────────────────────────────────────────────
   Listeo WhatsApp OTP — Styles
   ───────────────────────────────────────────── */

/* ── Hide the native login form instantly to prevent the ~1s flash
      while MutationObserver waits to inject our WhatsApp form.
      The injected #lwaopt-login has no such rule so it shows immediately.
      Fallback: if injection never fires (template mismatch), the form
      becomes visible again after 3s via the JS safety timeout below.    ── */
#sign-in-dialog form#login:not(.lwaopt-injection-done),
.sign-in-form form#login:not(.lwaopt-injection-done),
.mfp-content form#login:not(.lwaopt-injection-done) {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* WhatsApp label with icon */
.lwaopt-wa-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 8px;
}

.lwaopt-wa-icon {
  width: 18px;
  height: 18px;
  fill: #25D366;
  flex-shrink: 0;
}

.lwaopt-wa-icon-lg {
  width: 36px;
  height: 36px;
}

/* ── OTP digit inputs ── */
.lwaopt-otp-digits {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 18px 0;
}

.lwaopt-otp-digit {
  width: 44px !important;
  height: 52px !important;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  border: 2px solid #ddd !important;
  border-radius: 8px !important;
  padding: 0 !important;
  transition: border-color 0.2s;
  background: #fff;
  caret-color: #25D366;
}

.lwaopt-otp-digit:focus {
  border-color: #25D366 !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}

/* ── Timer row ── */
.lwaopt-otp-timer-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 16px;
  font-size: 13px;
  color: #888;
}

.lwaopt-login-timer,
.lwaopt-otp-timer {
  font-size: 13px;
  color: #888;
}

.lwaopt-login-resend,
.lwaopt-resend-btn {
  background: none !important;
  border: none !important;
  color: #25D366;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  font-weight: 500;
}

.lwaopt-login-resend:disabled,
.lwaopt-resend-btn:disabled {
  color: #bbb;
  cursor: not-allowed;
}

/* ── Registration OTP Modal (CSS Fixed Overlay) ──
   This is a self-contained overlay — no dependence on
   magnificPopup or any other Listeo popup system.
   ────────────────────────────────────────────────── */
.lwaopt-modal-overlay {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 999999 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}
/* Force flex display when the modal is active */
.lwaopt-modal-overlay.is-visible {
    display: flex !important;
}

.lwaopt-modal-inner {
  background: #fff;
  border-radius: 12px;
  padding: 36px 32px 32px;
  max-width: 420px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.lwaopt-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 20px;
  color: #aaa;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.2s;
}

.lwaopt-modal-close:hover {
  color: #333;
}

.lwaopt-wa-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.lwaopt-wa-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
}

.lwaopt-modal-sub {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 4px;
}

.lwaopt-modal-sub strong {
  color: #333;
  font-size: 15px;
}

.lwaopt-otp-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 4px;
  text-align: left;
}

.lwaopt-verify-btn {
  width: 100%;
  margin-top: 8px;
  padding: 13px !important;
  font-size: 15px !important;
  font-weight: 600;
  background: #25D366 !important;
  border-color: #25D366 !important;
  color: #fff !important;
  border-radius: 8px !important;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.lwaopt-verify-btn:hover {
  background: #1ebe5d !important;
  border-color: #1ebe5d !important;
}

.lwaopt-verify-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Login form OTP section (hidden initially) ── */
.lwaopt-login-otp-section {
  margin-top: 6px;
}

.lwaopt-login-otp-hint {
  font-size: 14px;
  color: #555;
  margin-bottom: 4px;
}

/* fw = full-width helper */
.lwaopt-login-form .fw {
  width: 100%;
}

@media (max-width: 480px) {
  .lwaopt-otp-digit {
    width: 38px !important;
    height: 46px !important;
    font-size: 18px;
  }
  .lwaopt-modal-inner {
    padding: 28px 20px 24px;
  }
}


