/* ── Popup overlay ─────────────────────────────────────────────── */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.55);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.popup-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ── Card ─────────────────────────────────────────────────────── */
.popup-card {
  background: var(--bg, #faf8f3);
  border-radius: 24px;
  padding: 48px 40px 40px;
  max-width: 480px;
  width: 100%;
  position: relative;
  box-shadow: 0 24px 80px rgba(26, 26, 46, 0.22);
  transform: translateY(24px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.popup-overlay.active .popup-card {
  transform: translateY(0) scale(1);
}

/* ── Close ───────────────────────────────────────────────────── */
.popup-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fg-muted, #5c5c6b);
  font-size: 1.4rem;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.popup-close:hover { color: var(--fg, #1a1a2e); background: var(--bg-alt, #f0ede4); }

/* ── Emoji ────────────────────────────────────────────────────── */
.popup-emoji {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 20px;
}

/* ── Heading ─────────────────────────────────────────────────── */
.popup-heading {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--fg, #1a1a2e);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 10px;
}
.popup-sub {
  font-family: 'Lora', serif;
  color: var(--fg-muted, #5c5c6b);
  font-size: 1rem;
  line-height: 1.65;
  margin-bottom: 28px;
}

/* ── Form ────────────────────────────────────────────────────── */
.popup-form { display: flex; flex-direction: column; gap: 12px; }

.popup-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid rgba(45, 106, 79, 0.18);
  border-radius: 14px;
  background: white;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  color: var(--fg, #1a1a2e);
  outline: none;
  transition: border-color 0.2s;
}
.popup-input::placeholder { color: #aaa; }
.popup-input:focus { border-color: var(--accent, #2d6a4f); }

.popup-btn {
  padding: 15px 24px;
  background: var(--accent, #2d6a4f);
  color: white;
  border: none;
  border-radius: 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.popup-btn:hover { background: #245a40; }
.popup-btn:active { transform: scale(0.97); }

.popup-note {
  font-size: 0.78rem;
  color: var(--fg-muted, #5c5c6b);
  text-align: center;
  line-height: 1.5;
  margin-top: 4px;
}

/* ── Success state ───────────────────────────────────────────── */
.popup-success {
  display: none;
  text-align: center;
  padding: 12px 0;
}
.popup-success.show { display: block; }
.popup-success-icon {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 16px;
}
.popup-success-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--fg, #1a1a2e);
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.popup-success-sub {
  font-family: 'Lora', serif;
  color: var(--fg-muted, #5c5c6b);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ── Dismiss cookie ──────────────────────────────────────────── */
.popup-dismiss-btn {
  margin-top: 14px;
  background: none;
  border: none;
  color: var(--fg-muted, #5c5c6b);
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 4px;
}
.popup-dismiss-btn:hover { color: var(--fg, #1a1a2e); }

.popup-error {
  color: #e76f51;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  padding: 8px 0;
  min-height: 24px;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 520px) {
  .popup-card { padding: 36px 24px 32px; }
  .popup-heading { font-size: 1.45rem; }
}