/* ========================================================================
   EXIT-INTENT CAPTURE — lightweight single-field email modal
   ======================================================================== */

.ei-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2rem);
  opacity: 0;
  transition: opacity 0.35s var(--ease-out-quart);
}

.ei-overlay.is-open {
  display: flex;
  opacity: 1;
}

.ei-modal {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--dark);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  padding: clamp(2rem, 4vw, 2.75rem);
  text-align: center;
  transform: translateY(24px) scale(0.98);
  opacity: 0;
  transition: transform 0.45s var(--ease-out-expo), opacity 0.35s var(--ease-out-quart);
}

.ei-overlay.is-open .ei-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.ei-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 5;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.ei-close:hover {
  background: rgba(212, 175, 55, 0.2);
  transform: rotate(90deg);
}

.ei-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ei-eyebrow {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.6rem;
}

.ei-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.5vw, 1.55rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.25;
  margin: 0 0 0.75rem;
}

.ei-sub {
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
  margin: 0 0 1.5rem;
}

.ei-field-row {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.ei-input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--white);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ei-input::placeholder { color: rgba(255, 255, 255, 0.3); }

.ei-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.ei-input.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.ei-field-row .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.ei-error {
  display: none;
  margin: 0.75rem 0 0;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: #fca5a5;
}

.ei-error.is-visible { display: block; }

.ei-trust {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 0.9rem;
}

.ei-skip {
  display: block;
  margin: 1.25rem auto 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-family: var(--font-body);
  font-size: 0.82rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.ei-skip:hover { color: rgba(255, 255, 255, 0.65); }

/* Success state */
.ei-success {
  display: none;
}

.ei-success.is-active { display: block; }

.ei-success-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: var(--grad-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-gold);
}

.ei-success p {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
}

.ei-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(17, 17, 17, 0.3);
  border-top-color: var(--dark);
  border-radius: 50%;
  animation: eiSpin 0.7s linear infinite;
}

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

@media (max-width: 480px) {
  .ei-field-row {
    flex-direction: column;
  }
  .ei-field-row .btn {
    justify-content: center;
  }
}

body.ei-modal-open {
  overflow: hidden;
}
