/*
 * DINEROZA — Email Capture System
 * Footer newsletter signup + Lead magnet popup
 */

/* ===== CSS Variables (fallback if design-system not loaded) ===== */
:root {
  --ec-emerald: #065F46;
  --ec-emerald-light: #047857;
  --ec-gold: #D97706;
  --ec-gold-soft: #F59E0B;
  --ec-cream: #F0FDF9;
  --ec-dark: #111827;
  --ec-gray: #6B7280;
  --ec-border: rgba(6, 95, 70, 0.15);
  --ec-shadow: 0 8px 32px rgba(6, 95, 70, 0.12), 0 2px 8px rgba(0,0,0,0.08);
}

/* ===== FOOTER NEWSLETTER SECTION ===== */

.footer-newsletter {
  border-top: 1px solid var(--ec-border, rgba(6, 95, 70, 0.15));
  padding: 2rem 0 1.5rem;
  margin-bottom: 0;
}

.footer-newsletter__inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-newsletter__text {
  flex: 1;
  min-width: 220px;
}

.footer-newsletter__label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ec-gold, #D97706);
  margin-bottom: 0.3rem;
}

.footer-newsletter__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin: 0;
}

.footer-newsletter__form {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  min-width: 260px;
  max-width: 460px;
}

.footer-newsletter__input {
  flex: 1;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.footer-newsletter__input::placeholder {
  color: rgba(255,255,255,0.45);
}

.footer-newsletter__input:focus {
  border-color: var(--ec-gold-soft, #F59E0B);
  background: rgba(255,255,255,0.12);
}

.footer-newsletter__btn {
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  border: none;
  background: var(--ec-gold, #D97706);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}

.footer-newsletter__btn:hover {
  background: var(--ec-gold-soft, #F59E0B);
  transform: translateY(-1px);
}

.footer-newsletter__btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.footer-newsletter__msg {
  display: none;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  width: 100%;
}

.footer-newsletter__msg.success {
  display: block;
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.footer-newsletter__msg.error {
  display: block;
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

@media (max-width: 600px) {
  .footer-newsletter__inner {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  .footer-newsletter__form {
    width: 100%;
    max-width: 100%;
    min-width: unset;
  }
  .footer-newsletter__text {
    min-width: unset;
  }
}

/* ===== LEAD MAGNET POPUP ===== */

.ec-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(3px);
}

.ec-popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.ec-popup {
  background: #fff;
  border-radius: 16px;
  max-width: 480px;
  width: 100%;
  overflow: hidden;
  box-shadow: var(--ec-shadow, 0 8px 32px rgba(6, 95, 70, 0.12));
  transform: translateY(24px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.ec-popup-overlay.active .ec-popup {
  transform: translateY(0) scale(1);
}

.ec-popup__header {
  background: linear-gradient(135deg, #065F46 0%, #047857 100%);
  padding: 1.75rem 1.75rem 1.5rem;
  position: relative;
}

.ec-popup__badge {
  display: inline-block;
  background: var(--ec-gold, #D97706);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
  margin-bottom: 0.75rem;
}

.ec-popup__title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  margin: 0 0 0.5rem;
}

.ec-popup__subtitle {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.75);
  margin: 0;
  line-height: 1.5;
}

.ec-popup__close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s;
  flex-shrink: 0;
}

.ec-popup__close:hover {
  background: rgba(255,255,255,0.25);
}

.ec-popup__body {
  padding: 1.5rem 1.75rem 1.75rem;
}

.ec-popup__benefits {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.ec-popup__benefits li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  color: #374151;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.ec-popup__benefits li::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: #ecfdf5;
  color: #065F46;
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: 50%;
  flex-shrink: 0;
}

.ec-popup__form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ec-popup__input {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1.5px solid #e5e7eb;
  font-size: 0.9rem;
  font-family: inherit;
  color: #111827;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.ec-popup__input:focus {
  border-color: #065F46;
  box-shadow: 0 0 0 3px rgba(6, 95, 70, 0.1);
}

.ec-popup__submit {
  padding: 0.85rem 1.5rem;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #065F46, #047857);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s, transform 0.15s;
  width: 100%;
  text-align: center;
}

.ec-popup__submit:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.ec-popup__submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.ec-popup__msg {
  display: none;
  font-size: 0.85rem;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  text-align: center;
}

.ec-popup__msg.success {
  display: block;
  background: #ecfdf5;
  color: #065F46;
  border: 1px solid rgba(6, 95, 70, 0.2);
}

.ec-popup__msg.error {
  display: block;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.ec-popup__privacy {
  font-size: 0.72rem;
  color: #9ca3af;
  text-align: center;
  margin: 0.5rem 0 0;
}

/* Thank you state */
.ec-popup__thankyou {
  display: none;
  text-align: center;
  padding: 2rem;
}

.ec-popup__thankyou.visible {
  display: block;
}

.ec-popup__thankyou-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.ec-popup__thankyou h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #065F46;
  margin: 0 0 0.5rem;
}

.ec-popup__thankyou p {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

.ec-popup__thankyou-cta {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #065F46, #047857);
  color: #fff;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: opacity 0.2s;
}

.ec-popup__thankyou-cta:hover {
  opacity: 0.9;
}

@media (max-width: 520px) {
  .ec-popup__header {
    padding: 1.4rem 1.25rem 1.2rem;
  }
  .ec-popup__body {
    padding: 1.25rem;
  }
  .ec-popup__title {
    font-size: 1.15rem;
    padding-right: 2rem;
  }
}
