/* ═══════════════════════════════════════════════════════════════
   EXIT-INTENT POPUP — Task #1135738
   Clean modal overlay: easy close, no dark patterns
══════════════════════════════════════════════════════════════ */

/* ── Backdrop ──────────────────────────────────────────────── */
#sr-exit-overlay {
  position: fixed;
  inset: 0;
  z-index: 99990;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

#sr-exit-overlay.sr-exit-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Modal Card ─────────────────────────────────────────────── */
#sr-exit-overlay .sr-exit-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 20px 60px rgba(0, 0, 0, 0.18),
    0 4px 20px rgba(0, 0, 0, 0.10);
  max-width: 480px;
  width: 100%;
  position: relative;
  overflow: hidden;
  transform: translateY(12px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#sr-exit-overlay.sr-exit-visible .sr-exit-card {
  transform: translateY(0) scale(1);
}

/* ── Top accent stripe ───────────────────────────────────────── */
#sr-exit-overlay .sr-exit-card::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, #2563eb 0%, #1d4ed8 50%, #1e40af 100%);
}

/* ── Close button ────────────────────────────────────────────── */
.sr-exit-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(156, 163, 175, 0.12);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.15s;
  z-index: 1;
  padding: 0;
  color: #6b7280;
}

.sr-exit-close:hover {
  background: rgba(156, 163, 175, 0.25);
  transform: scale(1.1);
  color: #374151;
}

.sr-exit-close:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* ── Card body ──────────────────────────────────────────────── */
.sr-exit-body {
  padding: 2rem 2rem 1.75rem;
}

/* ── Eyebrow ────────────────────────────────────────────────── */
.sr-exit-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 20px;
  padding: 4px 10px 4px 8px;
  margin-bottom: 1rem;
}

/* ── Headline ──────────────────────────────────────────────── */
.sr-exit-headline {
  font-size: clamp(1.35rem, 3vw, 1.6rem);
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 0 0 0.6rem;
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Sub-copy ───────────────────────────────────────────────── */
.sr-exit-sub {
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.6;
  margin: 0 0 1.4rem;
}

/* ── Form ───────────────────────────────────────────────────── */
.sr-exit-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sr-exit-email-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.sr-exit-input {
  flex: 1;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  font-size: 0.9rem;
  color: #1e293b;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  min-width: 0;
  font-family: inherit;
}

.sr-exit-input::placeholder {
  color: #9ca3af;
}

.sr-exit-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.sr-exit-input:focus-visible {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.sr-exit-btn {
  padding: 0.7rem 1.25rem;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sr-exit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

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

.sr-exit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.sr-exit-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* ── Privacy note ───────────────────────────────────────────── */
.sr-exit-privacy {
  font-size: 0.75rem;
  color: #9ca3af;
  text-align: center;
  line-height: 1.4;
  margin-top: 0.25rem;
}

/* ── Inline success state ───────────────────────────────────── */
.sr-exit-success {
  display: none;
  text-align: center;
  padding: 0.5rem 0;
}

.sr-exit-success.sr-exit-visible {
  display: block;
}

.sr-exit-success-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  display: block;
}

.sr-exit-success-headline {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.4rem;
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.sr-exit-success-sub {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.5;
}

/* ── Variant B — Quiz CTA ────────────────────────────────────── */
.sr-exit-quiz-cta {
  display: none;
}

.sr-exit-quiz-cta.sr-exit-visible {
  display: block;
}

.sr-exit-quiz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
  margin-top: 1rem;
  font-family: inherit;
  text-decoration: none;
}

.sr-exit-quiz-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  color: #fff;
}

.sr-exit-quiz-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* ── Error state ─────────────────────────────────────────────── */
.sr-exit-error {
  display: none;
  font-size: 0.78rem;
  color: #dc2626;
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 6px;
  padding: 0.4rem 0.65rem;
  margin-top: -0.2rem;
}

.sr-exit-error.sr-exit-visible {
  display: block;
}

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
  #sr-exit-overlay {
    align-items: flex-end;
    padding: 0;
  }

  #sr-exit-overlay.sr-exit-visible {
    align-items: flex-end;
  }

  #sr-exit-overlay .sr-exit-card {
    border-radius: 16px 16px 0 0;
    max-width: 100%;
    transform: translateY(100%);
    width: 100%;
  }

  #sr-exit-overlay.sr-exit-visible .sr-exit-card {
    transform: translateY(0);
  }

  .sr-exit-body {
    padding: 1.5rem 1.25rem 1.5rem;
  }

  .sr-exit-email-row {
    flex-direction: column;
  }

  .sr-exit-btn {
    width: 100%;
    justify-content: center;
    padding: 0.8rem 1rem;
  }
}