/* ==========================================================================
   Fashion Points BD - Clean White Floating Popup Auth Modal (Desktop & Mobile)
   Dimmed backdrop over any storefront page + crisp white elevated card,
   #0d9488 teal accents, subtle 3D hover lift & light Turnstile support.
   ========================================================================== */

@keyframes fpPopFadeIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.975);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fpShimmerSweep {
  0% { transform: translateX(-100%); }
  55% { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

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

/* Dimmed Scrim Overlay Over Any Storefront Page */
.auth-modal-overlay.fp-popup-overlay {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  color: #0f172a;
  z-index: 99999;
  display: none;
  align-items: safe center;
  justify-content: center;
  padding: 20px 14px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  opacity: 0;
  transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-modal-overlay.fp-popup-overlay *,
.auth-modal-overlay.fp-popup-overlay *::before,
.auth-modal-overlay.fp-popup-overlay *::after {
  box-sizing: border-box;
}

.auth-modal-overlay.fp-popup-overlay.active {
  opacity: 1;
}

/* Standalone /login uses soft studio gray backdrop */
.auth-modal-overlay.fp-popup-overlay.fp-standalone {
  background: radial-gradient(circle at 50% 0%, #ffffff 0%, #f1f5f9 65%, #e2e8f0 100%);
  backdrop-filter: none;
  opacity: 1;
  transition: none;
}

/* 3D Perspective Card Wrapper */
.sp2-stage {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
  margin: auto;
  perspective: 1500px;
  animation: fpPopFadeIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.sp2-tilt-wrap {
  position: relative;
  transform: none;
}

.sp2-card-group {
  position: relative;
}

/* Subtle Perimeter Light Shimmer Beam for Light Card */
.sp2-beams-frame {
  position: absolute;
  inset: -1px;
  border-radius: 18px;
  overflow: hidden;
  pointer-events: none;
}

.sp2-beam-top {
  position: absolute;
  top: 0;
  left: -50%;
  height: 2.5px;
  width: 46%;
  background: linear-gradient(90deg, transparent, rgba(13, 148, 136, 0.65), transparent);
  animation: fpShimmerSweep 4.2s ease-in-out infinite;
}

/* Crisp White Elevated Popup Card */
.fp-popup-card {
  position: relative;
  background: #ffffff;
  border-radius: 17px;
  padding: 28px 26px 24px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow:
    0 24px 56px -12px rgba(15, 23, 42, 0.32),
    0 8px 20px -6px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

/* Close & Back Controls */
.sp2-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.2s ease;
}

.sp2-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: rotate(90deg);
}

.sp2-back-btn {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  height: 30px;
  padding: 0 11px;
  border-radius: 9999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.sp2-back-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Card Header & Brand Logo Circle */
.sp2-header {
  text-align: center;
  margin-bottom: 18px;
}

.sp2-logo-circle {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  background: #541E25;
  box-shadow: 0 4px 12px rgba(84, 30, 37, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2px;
}

.sp2-logo-circle img {
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  object-fit: cover;
  display: block;
}

.sp2-title.auth-modal-title {
  margin: 0 0 5px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.sp2-subtitle.auth-modal-subtitle {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #64748b;
}

.sp2-subtitle.auth-modal-subtitle strong {
  color: #0f766e;
  font-weight: 700;
}

/* Error & Verified Status Alerts */
.fp-popup-overlay .auth-error-banner {
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 12px;
}

.fp-popup-overlay .auth-verified-banner {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Form & Inputs */
.fp-popup-overlay .auth-modal-form {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.sp2-input-group {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.sp2-input-shell {
  position: relative;
  border-radius: 9px;
}

.sp2-input-inner {
  position: relative;
  display: flex;
  align-items: center;
  height: 43px;
  border-radius: 9px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  overflow: hidden;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.sp2-input-inner:hover {
  border-color: #94a3b8;
}

.sp2-input-shell:focus-within .sp2-input-inner {
  background: #ffffff;
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.14);
}

.sp2-input-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: #64748b;
  pointer-events: none;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sp2-input-shell:focus-within .sp2-input-icon {
  color: #0d9488;
}

.sp2-input {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #0f172a;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  padding: 0 12px 0 38px;
}

.sp2-input.has-toggle {
  padding-right: 38px;
}

.sp2-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.sp2-input:-webkit-autofill,
.sp2-input:-webkit-autofill:hover,
.sp2-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #f8fafc inset !important;
  -webkit-text-fill-color: #0f172a !important;
}

.sp2-eye-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 5px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background 0.2s ease;
}

.sp2-eye-btn:hover {
  color: #0f172a;
  background: #e2e8f0;
}

/* OTP Input */
.sp2-input-inner.is-otp {
  height: 54px;
}

.sp2-input.is-otp {
  padding: 0 14px;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 9px;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.sp2-input.is-otp::placeholder {
  font-size: 17px;
  letter-spacing: 6px;
}

.sp2-field-hint {
  display: block;
  font-size: 11.5px;
  color: #64748b;
  margin: -3px 0 2px 2px;
  line-height: 1.4;
}

/* Remember me & Forgot Password */
.sp2-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  margin-bottom: 10px;
}

.sp2-remember-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.sp2-checkbox-box {
  position: relative;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sp2-checkbox-box input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  margin: 0;
  border-radius: 5px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.18s ease;
}

.sp2-checkbox-box input[type="checkbox"]:checked {
  background: #0d9488;
  border-color: #0d9488;
}

.sp2-checkbox-tick {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.sp2-checkbox-box input[type="checkbox"]:checked + .sp2-checkbox-tick {
  opacity: 1;
  transform: scale(1);
}

.sp2-remember-text {
  font-size: 12.5px;
  color: #475569;
  font-weight: 500;
}

.sp2-forgot-link {
  font-size: 12.5px;
  font-weight: 600;
  color: #0d9488;
  text-decoration: none;
  transition: color 0.18s ease;
}

.sp2-forgot-link:hover {
  color: #0f766e;
  text-decoration: underline;
}

/* Turnstile Container */
.sp2-turnstile-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 65px;
  margin: 4px 0 12px;
  overflow: hidden;
}

/* Primary Teal CTA Button */
.sp2-btn-wrap {
  position: relative;
  width: 100%;
  margin-top: 2px;
}

.sp2-btn-surface {
  position: relative;
  z-index: 2;
  overflow: hidden;
  width: 100%;
  height: 43px;
  border: none;
  border-radius: 9px;
  background: #0d9488;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.25);
  transition: background 0.18s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.sp2-btn-surface > span,
.sp2-btn-surface > svg,
.sp2-btn-surface > i {
  pointer-events: none;
}

.sp2-btn-surface:hover {
  background: #0f766e;
  box-shadow: 0 8px 20px rgba(13, 148, 136, 0.32);
}

.sp2-btn-surface:active {
  transform: scale(0.99);
}

.sp2-btn-surface:disabled {
  opacity: 0.72;
  cursor: wait;
}

.sp2-btn-arrow {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.sp2-btn-surface:hover .sp2-btn-arrow {
  transform: translateX(3px);
}

/* Divider */
.sp2-divider {
  position: relative;
  display: flex;
  align-items: center;
  margin: 14px 0;
}

.sp2-divider-line {
  flex-grow: 1;
  border-top: 1px solid #e2e8f0;
}

.sp2-divider-text {
  margin: 0 12px;
  font-size: 12.5px;
  color: #94a3b8;
  font-weight: 500;
}

/* Google Sign-In Button */
.sp2-google-wrap {
  width: 100%;
}

.sp2-google-surface {
  width: 100%;
  height: 42px;
  border-radius: 9px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.sp2-google-surface:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.08);
}

/* Terms & Policy Agreement Checkbox Row (Matched to user reference) */
.fp-terms-agree-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 6px 8px;
  margin-left: -8px;
  margin-right: -8px;
  border-radius: 9px;
  border: 1.5px solid transparent;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.fp-terms-agree-row.is-invalid {
  background: rgba(239, 68, 68, 0.06);
  border-color: #ef4444;
  animation: fp-shake 0.32s ease;
}

@keyframes fp-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.fp-terms-agree-row .sp2-checkbox-box {
  margin-top: 1px;
}

.fp-terms-agree-text {
  font-size: 12px;
  line-height: 1.5;
  color: #475569;
  font-weight: 450;
}

.fp-terms-agree-text a {
  color: #0d9488;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
  transition: color 0.15s ease;
}

.fp-terms-agree-text a:hover {
  color: #0f766e;
}

/* Inline OTP Links & Footer Switcher */
.sp2-inline-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}

.sp2-text-btn {
  background: none;
  border: none;
  color: #0d9488;
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 2px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.18s ease;
}

.sp2-text-btn:hover { color: #0f766e; }
.sp2-text-btn.is-muted { color: #64748b; font-weight: 500; }
.sp2-text-btn.is-muted:hover { color: #0f172a; }

.sp2-signup-row {
  text-align: center;
  font-size: 13px;
  color: #64748b;
  margin: 14px 0 0;
}

.sp2-signup-link {
  color: #0d9488;
  font-weight: 700;
  text-decoration: none;
  margin-left: 4px;
}

.sp2-signup-link:hover {
  color: #0f766e;
  text-decoration: underline;
}

/* Mobile Responsive Polish */
@media (max-width: 520px) {
  .auth-modal-overlay.fp-popup-overlay {
    padding: 16px 14px;
  }

  .sp2-stage {
    max-width: 100%;
    min-width: 0;
  }

  .fp-popup-card {
    padding: 24px 18px 20px;
    border-radius: 16px;
  }

  .sp2-title.auth-modal-title {
    font-size: 20px;
  }

  .sp2-input {
    font-size: 16px;
  }

  .sp2-input.is-otp {
    font-size: 21px;
    letter-spacing: 7px;
  }
}

@media (max-width: 360px) {
  .sp2-turnstile-wrap > div {
    transform: scale(0.88);
    transform-origin: center center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sp2-stage,
  .sp2-beam-top {
    animation: none !important;
  }

  .sp2-tilt-wrap {
    transform: none !important;
  }
}

/* ==========================================================================
   White-Background 6-Slot Animated OTP Input Widget (InputOtp10 Inspired)
   Used identically across Login 2FA, Signup Email OTP, Forgot Password &
   Account Profile Change Password OTP boxes.
   ========================================================================== */
@keyframes fpOtpCharPop {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(6px);
  }
  70% {
    transform: scale(1.06) translateY(-1px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes fpOtpSlotPulse {
  0% {
    opacity: 0.85;
    transform: scale(0.92);
  }
  100% {
    opacity: 0;
    transform: scale(1.42);
  }
}

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

@keyframes fpOtpShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.fp-otp-email-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
  padding: 7px 12px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 600;
  margin: 0 auto 12px;
  max-width: 100%;
  word-break: break-word;
}

.fp-otp-email-pill-icon {
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #ea580c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}

.fp-otp10-card {
  position: relative;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 14px 13px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  user-select: none;
}

.fp-otp10-card.is-focused {
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.fp-otp10-card.is-success {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.fp-otp10-card.is-compact {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 10px 6px;
  margin-bottom: 0;
  border-radius: 11px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.fp-otp10-slots-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.fp-otp10-card.is-compact .fp-otp10-slots-wrap {
  justify-content: flex-start;
  width: auto;
}

.fp-otp10-native-input {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  z-index: 3 !important;
  cursor: pointer !important;
  font-size: 16px !important;
  border: none !important;
  background: transparent !important;
  color: transparent !important;
  caret-color: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}

.fp-otp10-slots-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.fp-otp10-card.is-compact .fp-otp10-slots-row {
  gap: 6px;
}

.fp-otp10-slot {
  position: relative;
  width: 44px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 20px;
  font-weight: 800;
  transition: border-color 0.22s ease, background-color 0.22s ease, box-shadow 0.22s ease, color 0.22s ease;
}

.fp-otp10-card.is-compact .fp-otp10-slot {
  width: 38px;
  height: 44px;
  border-radius: 9px;
  font-size: 18px;
}

.fp-otp10-slot:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.fp-otp10-slot.is-active {
  border-color: #0d9488;
  background: rgba(13, 148, 136, 0.06);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.14);
}

.fp-otp10-slot.is-verifying {
  border-color: #0d9488;
  background: rgba(13, 148, 136, 0.05);
  color: #0f766e;
}

.fp-otp10-slot.is-success {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  box-shadow: none;
}

.fp-otp10-slot.is-error {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  box-shadow: none;
}

.fp-otp10-card.is-verifying {
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

.fp-otp10-card.is-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14);
  animation: fpOtpShake 0.36s ease;
}

.fp-otp10-char {
  display: inline-block;
  line-height: 1;
  animation: fpOtpCharPop 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.fp-otp10-pulse {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1.5px solid #0d9488;
  pointer-events: none;
  animation: fpOtpSlotPulse 0.38s ease-out forwards;
}

.fp-otp10-caret {
  width: 2px;
  height: 22px;
  border-radius: 2px;
  background: #0d9488;
  animation: fpOtpCaretBlink 1s ease-in-out infinite;
}

.fp-otp10-card.is-compact .fp-otp10-caret {
  height: 18px;
}

.fp-otp10-status {
  margin-top: 9px;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  transition: color 0.2s ease;
}

.fp-otp10-card.is-compact .fp-otp10-status {
  margin-top: 5px;
  font-size: 10px;
  text-align: left;
}

.fp-otp10-status.is-verifying {
  color: #0f766e;
  font-weight: 700;
}

.fp-otp10-status.is-success {
  color: #059669;
  font-weight: 700;
}

.fp-otp10-status.is-error {
  color: #dc2626;
  font-weight: 700;
}

@media (max-width: 440px) {
  .fp-otp10-slots-row {
    gap: 6px;
  }
  .fp-otp10-slot {
    width: 39px;
    height: 48px;
    font-size: 18px;
    border-radius: 10px;
  }
  .fp-otp10-card.is-compact .fp-otp10-slots-row {
    gap: 5px;
  }
  .fp-otp10-card.is-compact .fp-otp10-slot {
    width: 34px;
    height: 40px;
    font-size: 16px;
  }
}
