/* Exit-intent popup */
body.ep-no-scroll {
  overflow: hidden !important;
  padding-right: var(--scrollbar-width, 0px) !important;
}
body.ep-no-scroll .bottom-bar {
  padding-right: var(--scrollbar-width, 0px);
}

/* Overlay — dark grey cover */
.ep-overlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(30, 30, 30, 0.75);
  opacity: 0;
  transition: opacity 0.3s ease-out;
}
.ep-overlay.ep-active {
  opacity: 1;
}

/* Popup — always centered within viewport */
.ep-popup {
  position: fixed;
  inset: 0;
  z-index: 99999;
  margin: auto;
  width: calc(100% - 32px);
  max-width: 420px;
  height: fit-content;
  max-height: calc(100vh - 32px);
  background: #fff;
  color: #1F2937;
  font-family: 'Google Sans Flex', ui-sans-serif, system-ui, -apple-system, sans-serif;
  border-radius: 16px;
  padding: 24px 24px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.05);
  transform: scale(0.92);
  opacity: 0;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}
.ep-popup.ep-active {
  transform: scale(1);
  opacity: 1;
}

/* Close button */
.ep-close {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #999;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.ep-close:hover {
  color: #333;
  background: rgba(0, 0, 0, 0.06);
}

/* Badge */
.ep-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #059669;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 999px;
  padding: 4px 14px;
  margin-bottom: 12px;
}

/* Book mockup */
.ep-book-img {
  display: block;
  width: 72px;
  height: auto;
  margin: 0 auto 10px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

/* Headline */
.ep-headline {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 6px;
  text-align: center;
  color: #1F2937;
}

/* Subtext */
.ep-subtext {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #6B7280;
  text-align: center;
  margin: 0 0 14px;
}

/* Price row */
.ep-price-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.ep-price {
  font-size: 1.6rem;
  font-weight: 700;
  color: #059669;
}
.ep-price-old {
  font-size: 0.95rem;
  color: #9CA3AF;
  text-decoration: line-through;
}
.ep-price-pill {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: #059669;
  border-radius: 999px;
  padding: 3px 10px;
}

/* Email input */
.ep-email {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 1rem;
  color: #1F2937;
  background: #F9FAFB;
  border: 1.5px solid #D1D5DB;
  border-radius: 12px;
  outline: none;
  margin-bottom: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.ep-email::placeholder {
  color: #9CA3AF;
}
.ep-email:focus {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(6, 95, 70, 0.12);
}
.ep-email.ep-error {
  border-color: #EF4444;
}

/* CTA button — matches book page .cta-btn--gold */
.ep-cta {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 16px 20px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, #F59E0B, #D97706);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s;
  margin-bottom: 10px;
}
.ep-cta:hover {
  background: linear-gradient(135deg, #D97706, #B45309);
  transform: translateY(-2px) scale(1.02);
}
.ep-cta:active {
  transform: scale(0.98);
}

/* Dismiss link */
.ep-dismiss {
  display: block;
  text-align: center;
  font-family: inherit;
  font-size: 0.78rem;
  color: #9CA3AF;
  cursor: pointer;
  padding: 6px 0;
  border: none;
  background: none;
  width: 100%;
  transition: color 0.15s;
}
.ep-dismiss:hover {
  color: #6B7280;
}

/* Trust row */
.ep-trust {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: #9CA3AF;
  margin-top: 8px;
}

/* Larger popup on desktop */
@media (min-width: 769px) {
  .ep-popup {
    max-width: 440px;
    padding: 28px 28px 24px;
  }

  .ep-book-img {
    width: 88px;
  }

  .ep-headline {
    font-size: 1.6rem;
  }
}

/* Tighter padding on very small screens */
@media (max-width: 374px) {
  .ep-popup {
    padding: 20px 16px 18px;
    width: calc(100% - 24px);
  }

  .ep-headline {
    font-size: 1.1rem;
  }

  .ep-subtext {
    font-size: 0.85rem;
  }
}
