/* ============================================================
   SERENE MOM STUDIO — popup.css
   Lead magnet popup — Pinterest traffic detection
   Mobile-first · Faith-friendly · Soft brand colors
   ============================================================ */

/* ── Overlay ────────────────────────────────────────────────── */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(74, 63, 54, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 999;
  display: flex;
  align-items: flex-end;        /* slides up from bottom on mobile */
  justify-content: center;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.popup-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* ── Modal box ──────────────────────────────────────────────── */
.popup {
  background: var(--white);
  width: 100%;
  max-width: 480px;
  border-radius: 20px 20px 0 0;   /* sheet from bottom on mobile */
  padding: 36px 28px 40px;
  position: relative;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
  /* safe area for iPhones */
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
}
.popup-overlay.is-open .popup {
  transform: translateY(0);
}

/* drag handle pill */
.popup__handle {
  width: 40px;
  height: 4px;
  background: rgba(142,124,110,0.25);
  border-radius: 2px;
  margin: 0 auto 24px;
}

/* close button */
.popup__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--beige);
  border-radius: 50%;
  font-size: 1.1rem;
  color: var(--brown);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition);
}
.popup__close:hover { background: var(--beige-dark); }

/* ── Gift icon ──────────────────────────────────────────────── */
.popup__gift {
  font-size: 2.8rem;
  text-align: center;
  margin-bottom: 10px;
  line-height: 1;
}

/* ── Copy ───────────────────────────────────────────────────── */
.popup__eyebrow {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green-dark);
  margin-bottom: 10px;
}

.popup__title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 5vw, 2rem);
  font-weight: 500;
  color: var(--text);
  text-align: center;
  line-height: 1.25;
  margin-bottom: 10px;
}

.popup__sub {
  font-size: 0.92rem;
  color: var(--text-light);
  text-align: center;
  line-height: 1.7;
  margin-bottom: 24px;
}

/* ── Brevo form overrides ───────────────────────────────────── */
/* Strip Brevo's default container styles completely */
.popup .sib-form {
  background: transparent !important;
  padding: 0 !important;
  text-align: left !important;
}
.popup #sib-form-container { padding: 0 !important; }
.popup #sib-container {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  max-width: 100% !important;
  padding: 0 !important;
  text-align: left !important;
}

/* Hide Brevo's default label */
.popup .entry__label { display: none !important; }
.popup .entry__specification { display: none !important; }

/* Email input */
.popup #sib-container input[type="text"] {
  width: 100% !important;
  height: 52px !important;
  border: 2px solid rgba(142,124,110,0.25) !important;
  border-radius: 50px !important;
  padding: 0 22px !important;
  font-family: var(--font-sans) !important;
  font-size: 1rem !important;
  color: var(--text) !important;
  background: var(--beige) !important;
  outline: none !important;
  box-shadow: none !important;
  transition: border-color 0.2s ease !important;
  margin-bottom: 12px !important;
}
.popup #sib-container input[type="text"]:focus {
  border-color: var(--green) !important;
  background: var(--white) !important;
}
.popup #sib-container input[type="text"]::placeholder {
  color: var(--text-light) !important;
  font-family: var(--font-sans) !important;
}

/* Submit button */
.popup .sib-form-block__button {
  width: 100% !important;
  height: 54px !important;
  border-radius: 50px !important;
  background: var(--green) !important;
  border: none !important;
  font-family: var(--font-sans) !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  color: var(--white) !important;
  cursor: pointer !important;
  transition: background 0.2s ease, transform 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  -webkit-tap-highlight-color: transparent !important;
}
.popup .sib-form-block__button:hover {
  background: var(--green-dark) !important;
  transform: translateY(-2px) !important;
}

/* Brevo padding resets */
.popup #sib-container > form > div { padding: 4px 0 !important; }

/* Success / error messages */
.popup #success-message,
.popup #error-message {
  border-radius: var(--radius) !important;
  font-family: var(--font-sans) !important;
  max-width: 100% !important;
  margin-bottom: 12px !important;
}

/* ── Privacy micro note ─────────────────────────────────────── */
.popup__privacy {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-light);
  margin-top: 14px;
  line-height: 1.5;
}
.popup__privacy a {
  color: var(--green-dark);
  text-decoration: underline;
}

/* ── No thanks link ─────────────────────────────────────────── */
.popup__dismiss {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--text-light);
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}
.popup__dismiss:hover { color: var(--brown); }

/* ── Desktop — centered card instead of bottom sheet ───────── */
@media (min-width: 600px) {
  .popup-overlay {
    align-items: center;
    padding: 24px;
  }
  .popup {
    border-radius: 20px;
    padding: 44px 40px 40px;
    transform: translateY(20px) scale(0.97);
  }
  .popup-overlay.is-open .popup {
    transform: translateY(0) scale(1);
  }
  .popup__handle { display: none; }
}
