/* ============================================================
   ENCART NEWSLETTER
   Ancré en bas à gauche, glisse depuis le bord gauche.
   z-index 800 : au-dessus du header (100), sous la modale
   des mentions légales (1000) pour que le lien vers la
   politique de confidentialité s'ouvre par-dessus l'encart.
   ============================================================ */
.nl-popup {
  position: fixed;
  left: var(--spacing-md);
  bottom: var(--spacing-md);
  z-index: 800;

  width: min(380px, calc(100vw - 2rem));
  padding: 1.75rem 1.5rem 1.5rem;

  background: var(--color-bg);
  border: 1px solid var(--color-muted);
  border-radius: 4px;
  box-shadow:
    0 20px 44px -20px rgba(44, 31, 20, 0.34),
    0 2px 10px rgba(44, 31, 20, 0.08);

  opacity: 0;
  transform: translateX(calc(-100% - var(--spacing-md)));
  transition:
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease;
}

.nl-popup.is-open {
  opacity: 1;
  transform: translateX(0);
}

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

/* ------------------------------------------------------------
   Fermeture — zone cliquable de 44 × 44 px
   ------------------------------------------------------------ */
.nl-popup__close {
  position: absolute;
  top: 2px;
  right: 2px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;

  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;

  color: var(--color-text-light);
  transition: color 0.2s ease;
}

.nl-popup__close:hover {
  color: var(--color-text);
}

.nl-popup__close:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -4px;
}

.nl-popup__close:active {
  color: var(--color-accent-text);
}

/* ------------------------------------------------------------
   Contenu
   ------------------------------------------------------------ */
.nl-popup__eyebrow {
  display: block;
  margin-bottom: 0.5rem;

  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent-text);
}

.nl-popup__title {
  margin: 0 0 0.5rem;

  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--color-text);
}

.nl-popup__text {
  margin: 0 0 1.25rem;

  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--color-text-light);
}

/* ------------------------------------------------------------
   Formulaire
   ------------------------------------------------------------ */
.nl-popup__form[hidden] {
  display: none;
}

.nl-field {
  margin-bottom: 0.875rem;
}

.nl-field__input {
  width: 100%;
  padding: 0.75rem 0.875rem;

  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--color-text);

  background: #fff;
  border: 1px solid var(--color-muted);
  border-radius: 2px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nl-field__input::placeholder {
  color: var(--color-text-light);
  opacity: 0.7;
}

/* Même repère de focus que les deux formulaires : un seul anneau, sur le
   bord du champ. */
.nl-field__input:focus {
  border-color: var(--color-accent);
  outline: 2px solid var(--color-accent);
  outline-offset: -1px;
  box-shadow: none;
}

.nl-field.is-error .nl-field__input {
  border-color: #C0392B;
  background: #FCF4F2;
}

/* Consentement RGPD */
.nl-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-bottom: 1.125rem;
}

.nl-consent input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 2px 0 0;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.nl-consent label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--color-text-light);
}

.nl-consent label a {
  color: var(--color-accent-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.nl-consent.is-error label {
  color: #C0392B;
}

.nl-consent.is-error input[type="checkbox"] {
  outline: 2px solid #C0392B;
  outline-offset: 2px;
}

/* Bouton terracotta */
.nl-popup__submit {
  display: block;
  width: 100%;
  padding: 0.8125rem 1.25rem;

  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;

  color: var(--color-bg);
  background: var(--color-accent); /* #B8714E */
  border: 1px solid var(--color-accent);
  border-radius: 4px;
  cursor: pointer;

  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.nl-popup__submit:hover {
  background: var(--color-text);
  border-color: var(--color-text);
}

.nl-popup__submit:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

.nl-popup__submit:active {
  transform: translateY(1px);
}

.nl-popup__submit:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ------------------------------------------------------------
   Message de retour
   ------------------------------------------------------------ */
.nl-popup__notice {
  margin: 0.875rem 0 0;

  font-family: var(--font-body);
  font-size: 0.8125rem;
  line-height: 1.6;
}

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

.nl-popup__notice--success {
  color: var(--color-text);
}

.nl-popup__notice--error {
  color: #C0392B;
}

/* ------------------------------------------------------------
   Mobile — pleine largeur en bas d'écran
   ------------------------------------------------------------ */
@media (max-width: 640px) {
  .nl-popup {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;

    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;

    transform: translateY(100%);
  }

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

/* ------------------------------------------------------------
   Mouvement réduit — apparition en fondu seulement
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .nl-popup,
  .nl-popup.is-open {
    transform: none;
    transition: opacity 0.25s ease;
  }
}

/* ============================================================
   PAGE DE DÉSINSCRIPTION
   ============================================================ */
.mp-unsub {
  max-width: 42rem;
  text-align: center;
}

.mp-unsub__message {
  margin: 0 0 var(--spacing-lg);

  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--color-text-light);
}

/* 16 px sous 768 px : en dessous, Safari sur iPhone agrandit la page au
   moment où l'on touche le champ, et le pop-up se retrouve hors cadre. */
@media (max-width: 768px) {
  .nl-field__input {
    font-size: 16px;
  }
}
