/*
 * Popup newsletter — variante B de docs/maquettes/popup-newsletter.html.
 * Tout est préfixé pcnl- ; les styles hérités du thème (dialog, h2, button, input) sont remis à plat.
 * Rouge #e00000 sous du texte blanc (5,0:1, WCAG AA), #ff0000 pour les barres décoratives (comme la topbar).
 */
.pcnl {
  --pcnl-red: #ff0000;
  --pcnl-red-bg: #e00000;
  --pcnl-ink: #111;
  --pcnl-muted: #555;
  box-sizing: border-box;
  width: 460px;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--pcnl-ink);
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  font: 15px/1.4 "neo-sans", sans-serif;
  text-align: left;
}
.pcnl *, .pcnl *::before, .pcnl *::after { box-sizing: border-box; }
.pcnl::backdrop { background: rgba(0, 0, 0, .55); }
.pcnl[hidden], .pcnl [hidden], .pcnl-tab[hidden] { display: none !important; }
html.pcnl-open { overflow: hidden; } /* + <body> figé par front.js */

.pcnl__inner { position: relative; }

.pcnl__close {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  display: grid; place-items: center;
  width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 50%;
  background: transparent; color: #fff; cursor: pointer;
}
.pcnl__close:hover { background: rgba(255, 255, 255, .14); }
.pcnl__close:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }

/* Bandeau noir : l'offre */
.pcnl__band {
  position: relative; overflow: hidden;
  padding: 26px 30px 22px;
  background: var(--pcnl-ink); color: #fff;
}
.pcnl__band::after {
  content: ""; position: absolute; top: -20%; right: 78px;
  width: 46px; height: 140%;
  background: var(--pcnl-red); transform: skewX(-19.5deg);
}

.pcnl__title {
  margin: 14px 0;
  font: 400 26px/1.08 "Archivo Black", sans-serif; letter-spacing: -.01em;
  text-transform: uppercase; text-wrap: balance;
  color: inherit;
}
.pcnl__title:focus { outline: 0; }
.pcnl__title sup { font-size: .55em; vertical-align: .7em; line-height: 0; }
.pcnl__band .pcnl__title { position: relative; z-index: 1; max-width: 80%; margin: 0; font-size: 28px; color: #fff; }
.pcnl__band .pcnl__title em { padding: 0 6px; font-style: normal; background: var(--pcnl-red-bg); color: #fff; }

.pcnl__body { padding: 22px 30px 24px; }

.pcnl__list { display: grid; gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; }
.pcnl__list li { display: grid; grid-template-columns: 28px 1fr; align-items: start; margin: 0; font-size: 15px; line-height: 1.35; }
.pcnl__emo { font-size: 18px; line-height: 1.1; }
.pcnl__list b, .pcnl__list strong { font-weight: 700; }

/* Champ + bouton */
.pcnl__form { position: relative; display: flex; margin: 0; border: 2px solid var(--pcnl-ink); }
.pcnl__form:focus-within { outline: 3px solid rgba(224, 0, 0, .25); outline-offset: 2px; }
.pcnl.is-error .pcnl__form { border-color: var(--pcnl-red-bg); }
.pcnl__input {
  flex: 1; min-width: 0; height: 48px; margin: 0; padding: 0 14px;
  border: 0; border-radius: 0; box-shadow: none; outline: 0;
  background: #fff; color: var(--pcnl-ink);
  font: 16px "neo-sans", sans-serif; /* 16 px : pas de zoom automatique sur iPhone */
}
.pcnl__hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.pcnl__btn {
  height: 48px; margin: 0; padding: 0 18px;
  border: 0; border-radius: 0;
  background: var(--pcnl-red-bg); color: #fff; cursor: pointer;
  font: 400 14px/1 "Archivo Black", sans-serif; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap;
}
.pcnl__btn:hover { background: #c00000; }
.pcnl__btn:focus-visible { outline: 3px solid var(--pcnl-ink); outline-offset: 2px; }
.pcnl__btn[aria-busy="true"] { opacity: .75; cursor: progress; }

.pcnl__err { margin: 8px 0 0; color: var(--pcnl-red-bg); font-size: 13px; font-weight: 700; }
.pcnl__legal { margin: 10px 0 0; color: var(--pcnl-muted); font-size: 12px; line-height: 1.45; }
.pcnl__legal a { color: inherit; text-decoration: underline; }
.pcnl__nope {
  display: inline-block; margin-top: 12px; padding: 0;
  border: 0; background: none; color: var(--pcnl-muted); cursor: pointer;
  font: 13px "neo-sans", sans-serif; text-decoration: underline;
}

/* Après l'inscription */
.pcnl__done .pcnl__title { margin-top: 0; }
.pcnl__done-msg { margin: 0 0 16px; font-size: 15px; }
.pcnl__done .pcnl__btn { height: 44px; }

/* Onglet de rappel, pendant la pause après une fermeture */
.pcnl-tab {
  position: fixed; left: 0; bottom: 90px; z-index: 1000;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 14px 12px 12px;
  border: 0; border-radius: 0;
  background: #e00000; color: #fff; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
  font: 400 13px/1 "Archivo Black", sans-serif; text-transform: uppercase;
}
.pcnl-tab:hover { background: #c00000; }
.pcnl-tab:focus-visible { outline: 3px solid #111; outline-offset: 2px; }

/* Mobile : panneau en bas d'écran, le haut de la page reste visible */
@media (max-width: 767px) {
  .pcnl {
    width: 100%; max-width: 100%; max-height: 92%;
    margin: auto 0 0;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, .3);
  }
  .pcnl::backdrop { background: rgba(0, 0, 0, .35); }
  .pcnl__band { padding: 22px 20px 18px; }
  .pcnl__band::after { right: 64px; width: 36px; }
  .pcnl__band .pcnl__title { font-size: 22px; max-width: calc(100% - 100px); } /* reste à gauche de la barre rouge */
  .pcnl__body { padding: 16px 20px calc(18px + env(safe-area-inset-bottom)); }
  .pcnl__list { gap: 6px; margin-bottom: 14px; }
  .pcnl__list li { font-size: 14px; }
  .pcnl__form { flex-direction: column; gap: 8px; border: 0; }
  .pcnl__form:focus-within { outline: 0; }
  .pcnl__input { flex: none; border: 2px solid var(--pcnl-ink); }
  .pcnl__input:focus { outline: 3px solid rgba(224, 0, 0, .25); outline-offset: 2px; }
  .pcnl.is-error .pcnl__input { border-color: var(--pcnl-red-bg); }
  .pcnl__btn { width: 100%; }
  .pcnl__nope { display: none; } /* la croix et le fond suffisent sur mobile */
  .pcnl-tab { bottom: 24px; padding: 10px 12px; font-size: 12px; }
}

@media (prefers-reduced-motion: no-preference) {
  .pcnl[open] { animation: pcnl-in .28s cubic-bezier(.2, .8, .2, 1); }
  .pcnl[open]::backdrop { animation: pcnl-fade .28s ease-out; }
  @keyframes pcnl-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
  @keyframes pcnl-fade { from { opacity: 0; } }
  @media (max-width: 767px) {
    .pcnl[open] { animation: pcnl-up .35s cubic-bezier(.2, .8, .2, 1); }
    @keyframes pcnl-up { from { transform: translateY(100%); } }
  }
}
