/* ==========================================================================
   POLYNESAIR — Newsletter : style du formulaire d'inscription (inclus dans vos pages)
   Tout est préfixé « nlf- » pour ne jamais modifier le reste de la page.
   Couleurs réglables via les options PHP (accent, fond, texte, arrondi, largeur).
   ========================================================================== */
.nlf {
    --nlf-accent: #13a8b4;
    --nlf-fond: #ffffff;
    --nlf-texte: #0b2545;
    --nlf-arrondi: 16px;
    --nlf-largeur: 560px;
    --nlf-erreur: #c2412d;
    --nlf-ok: #187a46;
    max-width: var(--nlf-largeur);
    margin: 0 auto;
    color: var(--nlf-texte);
    font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    text-align: left;
}
.nlf *, .nlf *::before, .nlf *::after { box-sizing: border-box; }
.nlf--carte {
    background: var(--nlf-fond);
    border-radius: var(--nlf-arrondi);
    padding: 28px 26px 22px;
    box-shadow: 0 2px 6px rgba(11, 37, 69, .06), 0 18px 40px rgba(11, 37, 69, .12);
}
.nlf--transparent { background: transparent; padding: 0; }
.nlf-form { margin: 0; }

.nlf-titre { font-family: "Playfair Display", Georgia, serif; font-size: 1.5em; font-weight: 700; line-height: 1.25; margin: 0 0 6px; color: inherit; }
.nlf-intro { margin: 0 0 18px; opacity: .85; font-size: .95em; }

.nlf-ligne { display: flex; flex-wrap: wrap; gap: 0 14px; }
.nlf-ligne > .nlf-champ { flex: 1 1 200px; }
.nlf-champ { margin: 0 0 14px; }
.nlf-champ label { display: block; font-weight: 600; font-size: .88em; margin: 0 0 5px; color: var(--nlf-libelles, inherit); }
.nlf-req { color: var(--nlf-accent); }
.nlf input[type=text], .nlf input[type=email] {
    display: block; width: 100%; margin: 0; font: inherit; font-size: 1em; color: var(--nlf-champ-texte, #1d2733);
    background: var(--nlf-champ-fond, #fff); border: 1px solid var(--nlf-champ-bord, #cbd5e1); border-radius: 10px; padding: 12px 14px; min-height: 48px;
    box-shadow: none; transition: border-color .15s, box-shadow .15s;
}
.nlf input[type=text]:focus, .nlf input[type=email]:focus {
    outline: none; border-color: var(--nlf-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nlf-accent) 25%, transparent);
}
.nlf input[aria-invalid=true] { border-color: var(--nlf-erreur); }
.nlf-captcha input { max-width: 120px; text-align: center; font-weight: 700; letter-spacing: .1em; }
.nlf-question { font-weight: 600; }

/* Piège à robots : hors de l'écran (pas display:none, que certains robots détectent) */
.nlf-hp { position: absolute !important; left: -10000px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }

.nlf-accord { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 18px; font-size: .86em; }
.nlf-accord input { width: 20px; height: 20px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--nlf-accent); cursor: pointer; }
.nlf-accord label { cursor: pointer; }
.nlf-accord a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.nlf-bouton {
    display: block; width: 100%; margin: 0; border: 0; border-radius: 12px; padding: 14px 20px; min-height: 50px;
    font: inherit; font-weight: 700; font-size: 1.02em; color: var(--nlf-bouton-texte, #fff); background: var(--nlf-bouton-fond, var(--nlf-accent)); cursor: pointer;
    box-shadow: 0 6px 18px color-mix(in srgb, var(--nlf-bouton-fond, var(--nlf-accent)) 35%, transparent); transition: filter .15s, transform .05s;
}
.nlf-bouton:hover { filter: brightness(.93); }
.nlf-bouton:active { transform: translateY(1px); }
.nlf-bouton:focus-visible { outline: 3px solid color-mix(in srgb, var(--nlf-accent) 45%, transparent); outline-offset: 3px; }
.nlf-bouton[disabled] { opacity: .65; cursor: wait; }

.nlf-message { margin: 12px 0 0; font-size: .92em; font-weight: 600; min-height: 1em; }
.nlf-message.nlf-erreur { color: var(--nlf-erreur); }
.nlf-message.nlf-ok { color: var(--nlf-ok); }

/* Après succès : message de remerciement à la place du formulaire */
.nlf-merci { text-align: center; padding: 10px 0; }
.nlf-merci-icone { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center;
    font-size: 26px; color: #fff; background: var(--nlf-accent); }
.nlf-merci p { margin: 0; font-weight: 600; }

@media (max-width: 480px) {
    .nlf--carte { padding: 22px 18px 18px; }
    .nlf-titre { font-size: 1.3em; }
}
@media (prefers-reduced-motion: reduce) { .nlf * { transition: none !important; } }

/* Étape 6 : case facultative « mesure des ouvertures » (discrète, jamais pré-cochée) */
.nlf-accord--facultatif { margin-top: -8px; font-size: .8em; opacity: .85; }

/* ==========================================================================
   Étape 7 — formulaires créés dans l'admin (thèmes, couleurs, mentions)
   ========================================================================== */
.nlf input::placeholder { color: var(--nlf-champ-texte, #1d2733); opacity: .45; }
.nlf--majuscules .nlf-champ label { text-transform: uppercase; letter-spacing: .08em; font-size: .76em; font-weight: 700; }
.nlf--titre-texte .nlf-titre { font-family: inherit; font-weight: 800; font-size: 1.3em; }
.nlf-mention { margin: 14px 0 0; font-size: .74em; line-height: 1.5; text-align: center; opacity: .6; }
/* Thème sombre : bordure discrète, ombre plus profonde, messages lisibles sur fond foncé */
.nlf--fonce { --nlf-erreur: #ff8f7e; --nlf-ok: #5fe0a0; border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25), 0 18px 40px rgba(0, 0, 0, .35); }
.nlf--fonce .nlf-intro { opacity: .78; }
.nlf--fonce .nlf-merci p { color: var(--nlf-texte); }
.nlf--fonce input[type=text]:focus, .nlf--fonce input[type=email]:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--nlf-accent) 35%, transparent); }

/* Protection contre les styles de la page d'accueil (ex. « .ma-section p { color… } ») :
   les textes du formulaire gardent TOUJOURS leurs propres couleurs et tailles. */
.nlf p.nlf-titre { color: var(--nlf-texte); font-size: 1.5em; line-height: 1.25; margin: 0 0 6px; font-weight: 700; }
.nlf--titre-texte p.nlf-titre { font-size: 1.3em; font-weight: 800; }
.nlf p.nlf-intro { color: var(--nlf-texte); font-size: .95em; line-height: 1.5; margin: 0 0 18px; }
.nlf p.nlf-mention { color: var(--nlf-texte); font-size: .74em; line-height: 1.5; margin: 14px 0 0; }
.nlf p.nlf-message { font-size: .92em; line-height: 1.5; margin: 12px 0 0; }
.nlf p.nlf-message.nlf-erreur { color: var(--nlf-erreur); }
.nlf p.nlf-message.nlf-ok { color: var(--nlf-ok); }
.nlf .nlf-merci p { color: var(--nlf-texte); font-size: 1em; line-height: 1.5; margin: 0; }
.nlf .nlf-accord label, .nlf .nlf-champ label { line-height: 1.5; }
