/* ============================================================
   POPUP NEWSLETTER — Pasticceria Monica Ghizzo
   File autonomo: non tocca style.css / styleC.css
   ============================================================ */

.nl-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;

  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;

  background: rgba(20, 20, 20, 0.55);
  backdrop-filter: blur(4px);

  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s ease;

  overflow-y: auto;
}

.nl-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* ---------- Pannello ---------- */

.nl-panel {
  position: relative;
  width: 100%;
  max-width: 470px;

  background: #fdfdfd;
  padding: 50px 50px 42px;

  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);

  transform: translateY(25px);
  transition: transform 0.45s ease;
}

.nl-overlay.is-open .nl-panel {
  transform: translateY(0);
}

/* Cornice sfalsata: stesso motivo di .image-box del sito */
.nl-panel::before {
  content: "";
  position: absolute;
  top: -14px;
  left: -14px;
  width: 100%;
  height: 100%;
  border: 2px solid var(--tiffany, #0ABAB5);
  pointer-events: none;
}

/* ---------- Chiusura ---------- */

.nl-close {
  position: absolute;
  top: 14px;
  right: 18px;

  background: none;
  border: none;

  font-size: 26px;
  line-height: 1;
  color: #9a9a9a;

  cursor: pointer;
  transition: color 0.3s;
}

.nl-close:hover {
  color: var(--tiffany, #0ABAB5);
}

/* ---------- Intestazione ---------- */

.nl-logo {
  display: block;
  height: 62px;
  width: auto;
  margin: 0 auto 22px;
}

.nl-panel h2 {
  font-family: 'Playfair Display', serif;
  font-size: 27px;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  color: #1a1a1a;
  margin-bottom: 14px;
}

.nl-panel .nl-text {
  font-family: 'Lato', sans-serif;
  font-size: 13px;
  line-height: 1.85;
  letter-spacing: 0.6px;
  text-align: center;
  color: #4a4a4a;
  margin-bottom: 30px;
}

/* ---------- Form ---------- */

.nl-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Nome e Cognome affiancati */
.nl-row {
  display: flex;
  gap: 18px;
}

.nl-row > * {
  flex: 1;
  min-width: 0;
}

.nl-form input[type="text"],
.nl-form input[type="tel"],
.nl-form input[type="email"] {
  width: 100%;

  border: none;
  border-bottom: 1px solid #ccc;
  background: transparent;

  padding: 12px 2px;

  font-family: 'Lato', sans-serif;
  font-size: 14px;
  color: #1a1a1a;

  outline: none;
  transition: border-color 0.3s;
}

.nl-form input:focus {
  border-bottom-color: var(--tiffany, #0ABAB5);
}

.nl-form input::placeholder {
  color: #a5a5a5;
}

.nl-form input._errato {
  border-bottom-color: #c0392b;
}

/* Consenso privacy */

.nl-consent {
  display: flex;
  align-items: flex-start;
  gap: 11px;

  font-family: 'Lato', sans-serif;
  font-size: 11.5px;
  line-height: 1.6;
  color: #666;
  cursor: pointer;

  margin-top: 6px;
}

.nl-consent input {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  accent-color: var(--tiffany, #0ABAB5);
  cursor: pointer;
}

.nl-consent a {
  color: var(--tiffany, #0ABAB5);
  text-decoration: underline;
}

/* Pulsanti */

.nl-form button[type="submit"] {
  background: var(--tiffany, #0ABAB5);
  color: #fff;
  border: none;

  padding: 15px;

  font-family: 'Lato', sans-serif;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;

  cursor: pointer;
  transition: background 0.3s;
}

.nl-form button[type="submit"]:hover {
  background: #089e9a;
}

.nl-form button[type="submit"]:disabled {
  background: #b8b8b8;
  cursor: default;
}

.nl-later {
  background: none;
  border: none;

  font-family: 'Lato', sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #999;

  cursor: pointer;
  transition: color 0.3s;
}

.nl-later:hover {
  color: #1a1a1a;
}

/* Messaggio di errore */

.nl-error {
  font-family: 'Lato', sans-serif;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: #c0392b;
  margin: -6px 0 0;
}

.nl-error[hidden] {
  display: none;
}

/* ---------- Stato di conferma ---------- */

.nl-done {
  text-align: center;
  padding: 20px 0;
}

.nl-done .nl-mark {
  font-family: 'Playfair Display', serif;
  font-size: 40px;
  color: var(--tiffany, #0ABAB5);
  margin-bottom: 18px;
}

.nl-done h2 {
  margin-bottom: 12px;
}

.nl-done .nl-text {
  margin-bottom: 0;
}

/* ---------- Accessibilità ---------- */

.nl-overlay :focus-visible {
  outline: 2px solid var(--tiffany, #0ABAB5);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .nl-overlay,
  .nl-panel {
    transition: none;
  }
  .nl-panel {
    transform: none;
  }
}

/* ---------- Mobile ---------- */

@media (max-width: 768px) {
  .nl-overlay {
    align-items: flex-start;
    padding: 30px 16px;
  }

  .nl-panel {
    padding: 42px 26px 32px;
  }

  .nl-panel::before {
    display: none;
  }

  .nl-logo {
    height: 50px;
    margin-bottom: 18px;
  }

  .nl-panel h2 {
    font-size: 23px;
  }

  .nl-panel .nl-text {
    font-size: 12.5px;
    margin-bottom: 24px;
  }

  /* Nome e Cognome uno sotto l'altro */
  .nl-row {
    flex-direction: column;
    gap: 18px;
  }
}
