/**
 * Fenêtre d'inscription aux offres, ouverte par la carte du méga-menu — charte VLL
 * (cf. blocs-vll/docs/tokens.md).
 *
 * Feuille autonome : elle est chargée sur toutes les pages quand la carte ouvre la
 * fenêtre, elle ne dépend donc ni de tunnel.css ni des blocs. Tout est préfixé `.rsl-nl-` et
 * rien n'est écrit sur `body` (hors verrouillage du défilement) : une fenêtre
 * modale n'a pas à modifier la page qui la porte.
 */

.rsl-nl {
    --nl-primary: #1972b1;
    --nl-secondary: #e5a92e;
    --nl-dark: #3e405b;
    --nl-text: #515151;
    --nl-grey: #f5f5f6;
    --nl-border: #ebebee;

    position: fixed;
    left: 0;
    right: 0;
    /* Hauteur et décalage = zone réellement VISIBLE, posés par le script
       depuis visualViewport : clavier ouvert, la fenêtre suit l'écran utile.
       Sans script : 100 % du viewport. Aucune unité vh ici : Safari iOS la
       mesure sur le grand viewport et coupait la boîte en haut et en bas. */
    top: var(--rsl-nl-vvt, 0px);
    height: var(--rsl-nl-vvh, 100%);
    /* Au-dessus de l'en-tête collant (#btNav = 10001) mais SOUS le bandeau Axeptio. */
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: Montserrat, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    opacity: 0;
    visibility: hidden;
    transition: opacity .28s ease, visibility .28s ease;
}
.rsl-nl.est-ouvert { opacity: 1; visibility: visible; }

.rsl-nl__voile {
    position: absolute;
    inset: 0;
    background: rgba(24, 26, 42, .55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    /* Un doigt posé sur le voile ne fait rien défiler, ni la fenêtre ni la page. */
    touch-action: none;
}

.rsl-nl__boite {
    position: relative;
    display: grid;
    grid-template-columns: 44% 1fr;
    /* Une seule rangée, autorisée à RÉTRÉCIR (minmax 0) : sans cela, la
       colonne du formulaire impose sa hauteur naturelle, la boîte la rogne au
       `max-height` et le bouton d'inscription disparaît sous le bord — vu en
       recette sur un écran de 900 px. Avec minmax(0,1fr), c'est le contenu qui
       défile à l'intérieur, jamais la fenêtre qui se coupe. */
    grid-template-rows: minmax(0, 1fr);
    width: min(920px, 100%);
    /* 100 % = la zone visible moins les marges du conteneur, jamais vh. */
    max-height: min(100%, 720px);
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(20, 22, 40, .34);
    transform: translateY(18px) scale(.985);
    transition: transform .34s cubic-bezier(0, 0, .025, 1.02);
}
.rsl-nl.est-ouvert .rsl-nl__boite { transform: none; }

/* ------------------------------------------------------------------ */
/* Colonne visuelle                                                    */
/* ------------------------------------------------------------------ */

.rsl-nl__visuel {
    position: relative;
    background: var(--nl-dark) center/cover no-repeat;
    min-height: 300px;
    min-width: 0;
}



/* ------------------------------------------------------------------ */
/* Colonne formulaire                                                  */
/* ------------------------------------------------------------------ */

.rsl-nl__corps {
    display: flex;
    flex-direction: column;
    padding: 28px 32px 14px;
    min-height: 0;
    overflow: hidden;
    color: var(--nl-text);
}

.rsl-nl__sur {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 8px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--nl-primary);
}
.rsl-nl__sur::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--nl-secondary);
}

.rsl-nl__titre {
    margin: 0 0 8px;
    font-size: clamp(21px, 2.2vw, 26px);
    line-height: 1.2;
    font-weight: 800;
    color: var(--nl-dark);
}
.rsl-nl__titre em { font-style: normal; color: var(--nl-primary); }

.rsl-nl__texte {
    margin: 0 0 14px;
    font-size: 13.5px;
    line-height: 1.55;
}

/* ----- Formulaire ----- */

/* Le thème applique une marge générique à tout <form> (48px) : elle creusait
   un vide dans le modal. Le formulaire du popup n'en veut pas. Colonne flex
   qui peut rétrécir (min-height 0) : c'est sa zone défilante qui absorbe le
   manque de place, jamais le bouton. */
.rsl-nl__form {
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
    min-height: 0;
    margin: 0;
}
/* Ce qui défile : champs et case. Le titre reste au-dessus, le bouton reste
   au-dessous : on les atteint toujours, clavier ouvert compris. Le défilement
   ne se propage pas à la page (overscroll-behavior). */
.rsl-nl__defile {
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    /* marge interne : l'anneau de focus des champs n'est pas rogné */
    padding: 4px 4px 0;
    margin: -4px -4px 0;
}
.rsl-nl__pied { flex: 0 0 auto; }

.rsl-nl__champs { display: flex; gap: 10px; margin-bottom: 10px; }
.rsl-nl__champs input {
    flex: 1 1 50%;
    min-width: 0;
    width: 100%;
    padding: 12px 15px;
    font-family: inherit;
    font-size: 14px;
    color: var(--nl-dark);
    background: #fff;
    border: 1px solid var(--nl-border);
    border-radius: 12px;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.rsl-nl__champs input::placeholder { color: #a7abb8; }
.rsl-nl__champs input:focus {
    outline: none;
    border-color: var(--nl-primary);
    box-shadow: 0 0 0 3px rgba(25, 114, 177, .14);
}
/* Pot de miel : invisible pour l'œil ET pour les lecteurs d'écran, mais bien
   présent dans le DOM — c'est tout l'intérêt, les robots le remplissent. */
.rsl-nl__miel {
    position: absolute !important;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.rsl-nl__consent {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0 0 13px;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--nl-text);
    cursor: pointer;
}
.rsl-nl__consent input {
    margin: 1px 0 0;
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    accent-color: var(--nl-primary);
}
.rsl-nl__consent a { color: var(--nl-primary); }

.rsl-nl__cta {
    display: block;
    width: 100%;
    padding: 14px 20px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: var(--nl-primary);
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.rsl-nl__cta:hover {
    background: #145d90;
    box-shadow: 0 10px 22px rgba(25, 114, 177, .26);
    transform: translateY(-1px);
}
.rsl-nl__cta[disabled] { opacity: .6; cursor: progress; transform: none; }

.rsl-nl__note {
    margin: 10px 0 0;
    font-size: 11px;
    line-height: 1.5;
    color: #9aa0a6;
    text-align: center;
}
.rsl-nl__erreur {
    margin: 0 0 12px;
    padding: 10px 13px;
    font-size: 12.5px;
    color: #8a2424;
    background: #fcf0f1;
    border-radius: 10px;
}
.rsl-nl__erreur[hidden] { display: none; }

/* ----- Verrou de la page ----- */

/* La page derrière la fenêtre est figée à sa position de lecture (variable
   posée par le script) et restituée à la fermeture. Un simple overflow hidden
   sur html ne suffit pas : Safari iOS continue de faire défiler la page sous
   le voile. */
body.rsl-nl-verrou {
    position: fixed;
    top: calc(-1 * var(--rsl-nl-scroll, 0px));
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
}

/* ----- Fermeture ----- */

.rsl-nl__fermer {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 6;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--nl-dark);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, .9);
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(20, 22, 40, .38);
    transition: background .2s ease, transform .2s ease;
}
.rsl-nl__fermer:hover { background: #000; transform: rotate(90deg); }

.rsl-nl__non {
    display: block; width: 100%; margin: 8px 0 0; padding: 3px 8px 0;
    background: none; border: 0; font-family: inherit; font-size: 12.5px;
    font-weight: 600; color: #9aa0a6; text-align: center;
    text-decoration: underline; cursor: pointer;
}
.rsl-nl__non:hover { color: var(--nl-dark); }

/* ----- Remerciement ----- */

.rsl-nl__merci { text-align: center; padding: 26px 6px 10px; }
.rsl-nl__merci-icone {
    width: 62px;
    height: 62px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--nl-secondary);
    border-radius: 50%;
    color: var(--nl-dark);
    font-size: 30px;
    font-weight: 800;
}
.rsl-nl__merci h2 { margin: 0 0 10px; font-size: 23px; color: var(--nl-dark); font-weight: 800; }
.rsl-nl__merci p { margin: 0 0 6px; font-size: 14px; line-height: 1.6; }

/* ------------------------------------------------------------------ */
/* Mobile — vrai POPUP centré et compact, jamais plein écran               */
/* ------------------------------------------------------------------ */

@media (max-width: 860px) {
    .rsl-nl { padding: 14px; align-items: center; }
    .rsl-nl__boite {
        /* Image en petite bannière + formulaire dessous. En FLEX colonne, la
           fenêtre épouse EXACTEMENT la hauteur du contenu (pas d'étirement) et
           ne dépasse jamais la zone visible : au-delà, les champs défilent à
           l'intérieur, la croix et le bouton restent toujours visibles. */
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 440px;
        max-height: 100%;
        border-radius: 18px;
        transform: translateY(16px) scale(.98);
    }
    .rsl-nl__visuel { flex: 0 0 auto; }
    .rsl-nl__corps { flex: 0 1 auto; min-height: 0; }
    .rsl-nl__visuel { min-height: 104px; max-height: 128px; }
    .rsl-nl__corps { padding: 16px 16px calc(8px + env(safe-area-inset-bottom)); }
    .rsl-nl__sur { font-size: 10px; margin-bottom: 6px; }
    .rsl-nl__titre { font-size: 18px; margin-bottom: 6px; }
    .rsl-nl__texte { font-size: 12.5px; line-height: 1.45; margin-bottom: 8px; }
    .rsl-nl__champs { flex-direction: column; gap: 8px; margin-bottom: 8px; }
    .rsl-nl__champs input { padding: 11px 13px; font-size: 13.5px; }
    .rsl-nl__consent { font-size: 11px; margin-bottom: 10px; }
    .rsl-nl__cta { padding: 13px; font-size: 14px; }
    .rsl-nl__note { font-size: 10.5px; margin-top: 8px; }
    .rsl-nl__non { font-size: 13px; margin-top: 6px; }
    .rsl-nl__fermer { top: 8px; right: 8px; width: 40px; height: 40px; }
}

/* Écrans courts (petits téléphones, paysage) : on masque l'image pour garder
   le formulaire ET la croix visibles. */
@media (max-height: 640px) and (max-width: 860px) {
    .rsl-nl__visuel { display: none; }
    /* Sans image, la croix surplombe le corps : le titre lui laisse la place. */
    .rsl-nl__titre { padding-right: 40px; }
}

@media (prefers-reduced-motion: reduce) {
    .rsl-nl, .rsl-nl__boite, .rsl-nl__cta, .rsl-nl__fermer { transition: none; }
}

.rsl-nl__mention { margin: 6px 0 0; font-size: 10.5px; line-height: 1.35; color: #9aa0a6; text-align: center; }
