/* ============================================================
   Newsletter Popup – Raptor 4x4
   Prefisso classi: nlp- (newsletter-popup)
   ============================================================ */

/* ---------- Overlay ---------- */
.nlp-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background-color: rgba(0, 0, 0, 0.55);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.nlp-overlay.nlp-is-open {
  display: flex;
}

/* ---------- Card ---------- */
.nlp-card {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 460px;
  overflow: visible; /* consente al logo di sporgere */
}

/* ---------- Pulsante chiudi ---------- */
.nlp-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #1c1e1e;
  transition: background 0.2s, transform 0.15s;
  padding: 0;
  line-height: 1;
}

.nlp-close:hover {
  background: #ffffff;
  transform: scale(1.1);
}

/* ---------- Sezione hero (curva beige) ---------- */
.nlp-hero {
  position: relative;
  background-color: #fef3c7;
  padding: 2rem 2rem 2.5rem;
  border-radius: 12px 12px 0 0;
  /* curva ellittica sul fondo */
  border-bottom-left-radius: 50% 30px;
  border-bottom-right-radius: 50% 30px;
  /* altezza sufficiente a contenere l'immagine che sporge */
  min-height: calc(16.125rem / 2 + 2rem);
  overflow: visible;
}

/* ---------- Immagine hero ---------- */
.nlp-logo-wrap {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 50%);
  z-index: 5;
  width: 20.625rem;
  height: 16.125rem;
  aspect-ratio: 55 / 43;
  overflow: hidden;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
}

.nlp-logo-wrap img,
.nlp-logo-wrap a,
.nlp-logo-wrap .custom-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
}

/* ---------- Body ---------- */
.nlp-body {
  padding: calc(16.125rem / 2 + 1.5rem) 2rem 2rem; /* top = metà immagine + margine */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}

/* ---------- Blocco sconto ---------- */
.nlp-discount {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  gap: 0.125rem;
}

.nlp-percent {
  font-size: 5.5rem;
  font-weight: 700;
  color: #1c1e1e;
  line-height: 1;
  font-family: 'Work Sans', sans-serif;
  letter-spacing: -0.02em;
}

.nlp-discount-label {
  font-size: 1.125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #1c1e1e;
  font-family: 'Work Sans', sans-serif;
}

/* ---------- Testo descrittivo ---------- */
.nlp-desc {
  font-size: 0.9375rem;
  color: rgba(28, 30, 30, 0.65);
  line-height: 1.6;
  max-width: 360px;
  margin: 0;
  font-family: 'Work Sans', sans-serif;
}

/* ---------- Contenitore form ---------- */
.nlp-form {
  width: 100%;
}

/* ---- Override stili MailUp form ---- */

/* Resetta layout contenitore form */
.nlp-form form,
.nlp-form .mailup-subscribe-widget-group,
.nlp-form .mailup_widget,
.nlp-form > div {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

/* Input email */
.nlp-form input[type="email"],
.nlp-form input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  height: 2.75rem;
  padding: 0.5rem 1rem 0.5rem 2.75rem !important;
  border: 1px solid rgba(28, 30, 30, 0.2);
  border-radius: 6px;
  font-size: 1rem;
  color: #1c1e1e;
  font-family: 'Work Sans', sans-serif;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.75rem center;
  background-color: #ffffff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.nlp-form input[type="email"]::placeholder,
.nlp-form input[type="text"]::placeholder {
  color: rgba(28, 30, 30, 0.4);
  font-size: 0.9375rem;
}

.nlp-form input[type="email"]:focus,
.nlp-form input[type="text"]:focus {
  border-color: #fcc626;
  box-shadow: 0 0 0 3px rgba(252, 198, 38, 0.25);
}

/* Pulsante CTA */
.nlp-form input[type="submit"],
.nlp-form button[type="submit"] {
  width: 100%;
  height: 2.875rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 6px;
  border: 1px solid rgba(161, 126, 23, 0.6);
  background: linear-gradient(0deg, #deaa10 0%, #fcc626 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 0 1px #a17e17;
  color: #1c1e1e;
  font-family: 'Work Sans', sans-serif;
  transition: background 0.2s;
}

.nlp-form input[type="submit"]:hover,
.nlp-form button[type="submit"]:hover {
  background: linear-gradient(0deg, #c4960e 0%, #e3b222 100%);
}

.nlp-form input[type="submit"]:focus,
.nlp-form button[type="submit"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(252, 198, 38, 0.35), 0 0 0 1px #a17e17;
}

/* Riga privacy / checkbox */
.nlp-form .mailup-subscribe-widget-privacy,
.nlp-form .privacy-row,
.nlp-form label {
  font-size: 0.75rem;
  color: rgba(28, 30, 30, 0.55);
  text-align: left;
  line-height: 1.5;
}

/* Nasconde titolo e descrizione renderizzati dal plugin MailUp */
.nlp-form #mupwp-form-title,
.nlp-form #mupwp-form-description {
  display: none !important;
}

/* Messaggi di risposta */
.nlp-form .mailup-subscribe-widget-response,
.nlp-form .wpcf7-response-output,
.nlp-form p.response {
  font-size: 0.875rem;
  color: rgba(28, 30, 30, 0.65);
  margin: 0;
  text-align: center;
}

/* Messaggio di successo */
.nlp-form .mailup-subscribe-widget-response.success,
.nlp-form p.response.success {
  color: #16a34a;
}

/* Messaggio di errore */
.nlp-form .mailup-subscribe-widget-response.error,
.nlp-form p.response.error {
  color: #dc2626;
}

.nlp-card #mpwp-container .mupwp-form-field{
  margin: 0 !important;
}

.nlp-card .separator-20px-top {
  display: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .nlp-overlay {
    padding: 0.75rem;
  }

  .nlp-card {
    max-width: 90vw;
  }

  .nlp-percent {
    font-size: 4rem;
  }

  .nlp-discount-label {
    font-size: 1rem;
  }

  .nlp-logo-wrap {
    width: min(20.625rem, 85vw);
    height: auto;
    aspect-ratio: 55 / 43;
  }

  .nlp-body {
    padding: calc(min(20.625rem, 85vw) * (43 / 55) / 2 + 1rem) 1.25rem 1.5rem;
  }

  .nlp-hero {
    padding: 1.5rem 1.25rem 2.5rem;
    min-height: calc(min(20.625rem, 85vw) * (43 / 55) / 2 + 2rem);
  }
}
