/* ============================================================
   NEWSLETTER LIGHTBOX — overlay + formulaire Brevo compacté
   ============================================================ */

/* ============================================================
   OVERLAY / DIALOG
   ============================================================ */
.r21-lb {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.r21-lb[hidden] {
    display: none;
}

.r21-lb__overlay {
    position: absolute;
    inset: 0;
    background: rgba(33, 31, 31, 0.72);
    animation: r21-lb-fade 0.15s ease;
}

.r21-lb__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    animation: r21-lb-pop 0.18s ease;
}

@keyframes r21-lb-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes r21-lb-pop {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.r21-lb__close {
    position: sticky;
    top: 0;
    left: 100%;
    margin: 10px 10px -34px auto;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-white);
    border: 1px solid #ddd;
    border-radius: 50%;
    color: var(--color-dark);
    font-size: 1rem;
    cursor: pointer;
    z-index: 2;
}

.r21-lb__close:hover {
    background: var(--color-bg);
}

.r21-lb__close-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.r21-lb__body {
    padding: 8px 24px 24px;
}

body.r21-lb-open {
    overflow: hidden;
}

/* ============================================================
   FORMULAIRE BREVO — remplace le CSS externe sib-styles.css
   ============================================================ */
.r21-lb__sib-form,
.sib-form-container {
    text-align: left;
}

.r21-lb__row {
    padding: 8px 0;
}

.r21-lb__row--2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
}

.r21-lb__row--2col .r21-lb__cell {
    padding: 0;
}

.r21-lb__heading p {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-dark);
}

.r21-lb__intro p {
    margin: 0 0 4px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: #555;
}

/* Messages succès / erreur — masqués par défaut, Brevo (main.js) bascule
   leur affichage en style inline au moment de la soumission. */
.sib-form-message-panel {
    display: none;
    margin-bottom: 12px;
    padding: 10px 14px;
    border: 1px solid;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.875rem;
}

.r21-lb__panel--error {
    color: #661d1d;
    background: #ffeded;
    border-color: #ff4949;
}

.r21-lb__panel--success {
    color: #085229;
    background: #e7faf0;
    border-color: #13ce66;
}

.sib-form-message-panel__text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sib-icon.sib-notification__icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Champs texte */
.entry__label {
    display: block;
    margin-bottom: 4px;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-dark);
}

.entry__label[data-required]::after {
    content: ' ' attr(data-required);
    color: var(--color-red);
}

.entry__field .input {
    width: 100%;
    padding: 9px 12px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-dark);
    background: var(--color-white);
    border: 1px solid #ccc;
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.15s;
}

.entry__field .input:focus {
    border-color: var(--color-primary);
}

.entry__error--primary {
    display: block;
}

.entry__error--primary:empty {
    display: none;
}

.entry__error--primary:not(:empty) {
    margin-top: 4px;
    padding: 6px 10px;
    background: #fff0f0;
    border: 1px solid #ffb3b3;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: var(--color-red);
}

/* Groupes de cases à cocher */
.r21-lb__checkbox-grid {
   /*display: grid;
    grid-template-columns: 1fr 1fr;*/
    gap: 2px 14px;
    margin-top: 6px;
}

.r21-lb__checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}

.entry__choice {
    padding: 3px 0;
}

.checkbox__label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: #444;
    line-height: 1.35;
}

.checkbox__label input.input_replaced {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    margin-top: 2px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

/* Décoration native Brevo — non stylée sans sib-styles.css, la case
   native (accent-color ci-dessus) fait déjà office d'indicateur visuel. */
.checkbox__label .checkbox.checkbox_tick_positive {
    display: none;
}

.r21-lb__choice-text {
    flex: 1;
}

/* Consentement pixel tracking */
.sib-optin .entry__label {
    margin-bottom: 6px;
}

/* Bouton d'inscription */
.r21-lb__submit-row {
    padding-top: 4px;
}

.r21-lb__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: var(--color-dark);
    color: var(--color-white);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s;
}

.r21-lb__submit:hover {
    background: var(--color-primary);
    color: var(--color-dark);
}

.r21-lb__submit .icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Masqué par défaut : main.js affiche le loader pendant la soumission */
.sib-hide-loader-icon {
    display: none;
}

/* ============================================================
   STATUT D'ENREGISTREMENT INTERNE — distinct du panneau succès/erreur
   Brevo ci-dessus : reflète l'appel AJAX vers notre propre backend
   (voir assets/js/newsletter-lightbox.js, initSaveStatus).
   ============================================================ */
.r21-lb__save-status {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.8125rem;
    line-height: 1.4;
}

.r21-lb__save-status:not([hidden]) {
    display: flex;
}

.r21-lb__save-status-spinner {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    fill: currentColor;
    animation: r21-lb-spin 0.8s linear infinite;
}

@keyframes r21-lb-spin {
    to { transform: rotate(360deg); }
}

.r21-lb__save-status--loading {
    color: #555;
    background: var(--color-bg);
}

.r21-lb__save-status--success {
    color: #085229;
    background: #e7faf0;
}

.r21-lb__save-status--error {
    color: #661d1d;
    background: #ffeded;
}

.r21-lb__save-status--success .r21-lb__save-status-spinner,
.r21-lb__save-status--error .r21-lb__save-status-spinner {
    display: none;
}

/* Mentions légales */
.r21-lb__legal {
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.r21-lb__legal p {
    margin: 0 0 6px;
    font-family: var(--font-body);
    font-size: 0.72rem;
    line-height: 1.5;
    color: #999;
}

.r21-lb__legal a {
    color: var(--color-primary);
    text-decoration: underline;
}

/* Honeypot anti-bot — invisible et inaccessible */
.input--hidden {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* ============================================================
   CONFIRMATION — page /abonnement/ après retour de redirection Brevo
   ============================================================ */
.r21-subscribe-confirm {
    max-width: 560px;
    margin: 32px auto;
    padding: 32px 28px;
    text-align: center;
    background: var(--color-bg);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius);
}

.r21-subscribe-confirm i {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 12px;
}

.r21-subscribe-confirm h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--color-dark);
    margin: 0 0 8px;
}

.r21-subscribe-confirm p {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: #555;
    margin: 0;
}

.r21-subscribe-confirm p.r21-subscribe-confirm__redirect {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #999;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
    .r21-lb {
        padding: 0;
    }

    .r21-lb__dialog {
        max-width: none;
        max-height: 100vh;
        height: 100%;
        border-radius: 0;
    }

    .r21-lb__row--2col {
        grid-template-columns: 1fr;
        gap: 8px 0;
    }

    .r21-lb__checkbox-grid {
        grid-template-columns: 1fr;
    }
}
