/**
 * Styles - Banniere de consentement + Modal de preferences
 * Loi 25 Comply - CSS natif, aucun framework.
 *
 * Strategie d'isolation :
 *  - Tous les selecteurs critiques sont ancres sur #loi25-banner ou #loi25-modal
 *    pour obtenir une specificite superieure aux styles generiques du theme.
 *  - Les elements interactifs (button, input, label) a l'interieur de ces
 *    conteneurs recoivent un reset explicite des proprietes les plus souvent
 *    ecrasees par les themes WordPress (border, background, color, font-*,
 *    box-shadow, outline, padding, margin, border-radius, cursor).
 *  - Les valeurs sont toutes declarees explicitement (pas de "unset" qui
 *    laisserait l'heritage du theme s'infiltrer).
 */

/* ============================================================
   RESET CIBLE - BANNIERE
   ============================================================ */

#loi25-banner,
#loi25-banner * {
    box-sizing: border-box;
}

#loi25-banner button {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    color: inherit;
    cursor: pointer;
    border-radius: 0;
    box-shadow: none;
    text-decoration: none;
    letter-spacing: normal;
    text-transform: none;
    outline: none;
}

/* ============================================================
   RESET CIBLE - MODAL
   ============================================================ */

#loi25-modal,
#loi25-modal * {
    box-sizing: border-box;
}

#loi25-modal button,
#loi25-modal input[type="checkbox"],
#loi25-modal label {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    color: inherit;
    cursor: pointer;
    border-radius: 0;
    box-shadow: none;
    text-decoration: none;
    letter-spacing: normal;
    text-transform: none;
    outline: none;
}

#loi25-modal h2,
#loi25-modal h3,
#loi25-modal p,
#loi25-modal a,
#loi25-modal nav,
#loi25-modal span {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: normal;
    text-transform: none;
}

/* ============================================================
   BANNIERE PRINCIPALE
   ============================================================ */

#loi25-banner.loi25-banner {
    position: fixed;
    z-index: 99999;
    left: 0;
    right: 0;
    background: #1a1a2e;
    color: #f0f0f0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 -2px 16px rgba(0,0,0,.25);
    transition: transform .3s ease, opacity .3s ease;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
}

#loi25-banner.loi25-banner--hidden  { opacity: 0; pointer-events: none; transform: translateY(20px); }
#loi25-banner.loi25-banner--visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* Positions */
#loi25-banner.loi25-banner--bottom-bar { bottom: 0; top: auto; }
#loi25-banner.loi25-banner--top-bar    { top: 0; bottom: auto; box-shadow: 0 2px 16px rgba(0,0,0,.25); }

#loi25-banner.loi25-banner--popup {
    top: 50%; left: 50%; right: auto; bottom: auto;
    transform: translate(-50%, -50%) scale(.95);
    width: 90%; max-width: 520px;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,.4);
}
#loi25-banner.loi25-banner--popup.loi25-banner--visible { transform: translate(-50%, -50%) scale(1); }

#loi25-banner.loi25-banner--corner-bl { top: auto; right: auto; bottom: 20px; left: 20px; width: 340px; border-radius: 10px; box-shadow: 0 4px 24px rgba(0,0,0,.35); }
#loi25-banner.loi25-banner--corner-br { top: auto; left: auto;  bottom: 20px; right: 20px; width: 340px; border-radius: 10px; box-shadow: 0 4px 24px rgba(0,0,0,.35); }
#loi25-banner.loi25-banner--corner-bl.loi25-banner--hidden,
#loi25-banner.loi25-banner--corner-br.loi25-banner--hidden  { transform: translateY(12px); }
#loi25-banner.loi25-banner--corner-bl.loi25-banner--visible,
#loi25-banner.loi25-banner--corner-br.loi25-banner--visible { transform: translateY(0); }

/* Contenu interieur */
#loi25-banner .loi25-banner__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
#loi25-banner.loi25-banner--popup .loi25-banner__inner,
#loi25-banner.loi25-banner--corner-bl .loi25-banner__inner,
#loi25-banner.loi25-banner--corner-br .loi25-banner__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

#loi25-banner .loi25-banner__content    { flex: 1; min-width: 0; }
#loi25-banner .loi25-banner__title      { font-weight: 600; font-size: 15px; margin: 0 0 4px; color: #fff; }
#loi25-banner .loi25-banner__message    { margin: 0; color: #ccc; font-size: 13px; }
#loi25-banner .loi25-banner__policy-link { color: #7eb8f7; margin-left: 4px; white-space: nowrap; text-decoration: none; }
#loi25-banner .loi25-banner__policy-link:hover { text-decoration: underline; }

/* Boutons banniere */
#loi25-banner .loi25-banner__actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
    align-items: center;
}

#loi25-banner .loi25-btn {
    display: inline-block;
    padding: 9px 20px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, opacity .15s ease;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    letter-spacing: normal;
    text-transform: none;
    box-shadow: none;
    text-decoration: none;
}
#loi25-banner .loi25-btn:focus-visible { outline: 2px solid #7eb8f7; outline-offset: 2px; }

#loi25-banner .loi25-btn--accept  { background: #2e7d32; color: #fff; border: none; }
#loi25-banner .loi25-btn--accept:hover { background: #1b5e20; color: #fff; }

#loi25-banner .loi25-btn--decline {
    background: transparent;
    color: #ccc;
    border: 1px solid rgba(255,255,255,.25);
}
#loi25-banner .loi25-btn--decline:hover { background: rgba(255,255,255,.08); color: #fff; }

#loi25-banner .loi25-btn--manage {
    background: transparent;
    color: #7eb8f7;
    border: none;
    padding: 9px 8px;
    font-size: 12px;
    font-weight: 400;
    text-decoration: underline;
    box-shadow: none;
}
#loi25-banner .loi25-btn--manage:hover { color: #fff; }

/* Bouton de revocation permanent */
.loi25-revoke-btn {
    position: fixed;
    bottom: 12px;
    left: 12px;
    z-index: 99998;
    background: #1a1a2e;
    color: #ccc;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 11px;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: opacity .2s;
    opacity: .7;
    box-shadow: none;
    text-decoration: none;
    letter-spacing: normal;
    text-transform: none;
    line-height: 1.5;
}
.loi25-revoke-btn:hover { opacity: 1; }

/* ============================================================
   MODAL DE PREFERENCES
   ============================================================ */

#loi25-modal.loi25-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0,0,0,.55);
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: none;
    margin: 0;
}
#loi25-modal.loi25-modal--visible {
    display: flex;
}

#loi25-modal .loi25-modal__box {
    background: #fff;
    color: #222;
    border-radius: 10px;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 48px rgba(0,0,0,.35);
    overflow: hidden;
    border: none;
    margin: 0;
    padding: 0;
}

/* En-tete modal */
#loi25-modal .loi25-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
    background: #fff;
    margin: 0;
}
#loi25-modal .loi25-modal__header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111;
    padding: 0;
    border: none;
    background: none;
    line-height: 1.4;
    letter-spacing: normal;
    text-transform: none;
}

#loi25-modal .loi25-modal__close {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: inherit;
    box-shadow: none;
    transition: background .12s, color .12s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}
#loi25-modal .loi25-modal__close:hover { background: #f0f0f0; color: #111; }

/* Corps modal = 2 colonnes */
#loi25-modal .loi25-modal__body {
    display: flex;
    flex: 1;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: none;
    background: #fff;
}

/* Colonne gauche : onglets */
#loi25-modal .loi25-modal__tabs {
    width: 200px;
    flex-shrink: 0;
    border-right: 1px solid #e5e5e5;
    border-left: none;
    border-top: none;
    border-bottom: none;
    overflow-y: auto;
    background: #f8f8f8;
    margin: 0;
    padding: 0;
}

#loi25-modal .loi25-modal__tab-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    border-right: none;
    border-top: none;
    border-bottom: none;
    padding: 13px 16px;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 400;
    cursor: pointer;
    color: #444;
    line-height: 1.4;
    transition: background .12s, border-color .12s;
    border-radius: 0;
    box-shadow: none;
    letter-spacing: normal;
    text-transform: none;
    text-decoration: none;
    margin: 0;
    outline: none;
}
#loi25-modal .loi25-modal__tab-btn:hover { background: #efefef; color: #222; }
#loi25-modal .loi25-modal__tab-btn--active {
    background: #fff;
    border-left: 3px solid #1a3a5c;
    font-weight: 600;
    color: #1a3a5c;
}

/* Colonne droite : contenu du panneau */
#loi25-modal .loi25-modal__panels {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #fff;
    margin: 0;
    border: none;
}
#loi25-modal .loi25-modal__panel { display: none; }
#loi25-modal .loi25-modal__panel--active { display: block; }

#loi25-modal .loi25-modal__panel h3 {
    margin: 0 0 6px;
    padding: 0;
    font-size: 15px;
    font-weight: 600;
    color: #111;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: none;
    background: none;
    line-height: 1.4;
    letter-spacing: normal;
    text-transform: none;
}
#loi25-modal .loi25-modal__panel p {
    margin: 0 0 12px;
    padding: 0;
    font-size: 13px;
    color: #555;
    line-height: 1.6;
    border: none;
    background: none;
}
#loi25-modal .loi25-modal__panel a {
    color: #1a3a5c;
    text-decoration: underline;
}

/* Badge "Toujours actif" */
#loi25-modal .loi25-badge-required {
    font-size: 11px;
    font-weight: 600;
    color: #2e7d32;
    background: #e8f5e9;
    padding: 2px 8px;
    border-radius: 12px;
    flex-shrink: 0;
    border: none;
    line-height: 1.6;
    letter-spacing: normal;
    text-transform: none;
}

/* Toggle on/off */
#loi25-modal .loi25-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}
#loi25-modal .loi25-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
    margin: 0;
    padding: 0;
    border: none;
    appearance: none;
    -webkit-appearance: none;
}
#loi25-modal .loi25-toggle__slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: background .2s;
    border: none;
    box-shadow: none;
}
#loi25-modal .loi25-toggle__slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
    border: none;
}
#loi25-modal .loi25-toggle input:checked + .loi25-toggle__slider { background: #2e7d32; }
#loi25-modal .loi25-toggle input:checked + .loi25-toggle__slider::before { transform: translateX(20px); }
#loi25-modal .loi25-toggle input:focus-visible + .loi25-toggle__slider { outline: 2px solid #1a3a5c; outline-offset: 2px; }

/* Pied de page modal */
#loi25-modal .loi25-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid #e5e5e5;
    border-left: none;
    border-right: none;
    border-bottom: none;
    flex-shrink: 0;
    gap: 12px;
    background: #fff;
    margin: 0;
}

#loi25-modal .loi25-modal__btn {
    padding: 10px 22px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: background .15s;
    line-height: 1.5;
    letter-spacing: normal;
    text-transform: none;
    box-shadow: none;
    text-decoration: none;
    outline: none;
}
#loi25-modal .loi25-modal__btn--primary {
    background: #1a3a5c;
    color: #fff;
    border: none;
}
#loi25-modal .loi25-modal__btn--primary:hover { background: #0f2440; color: #fff; }
#loi25-modal .loi25-modal__btn--secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}
#loi25-modal .loi25-modal__btn--secondary:hover { background: #e4e4e4; color: #333; }

/* ============================================================
   SHORTCODE BOUTON GESTION
   ============================================================ */

.loi25-manage-consent-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #1a3a5c;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    text-decoration: none;
    box-shadow: none;
    letter-spacing: normal;
    text-transform: none;
    line-height: 1.5;
}
.loi25-manage-consent-btn:hover { background: #0f2440; color: #fff; }

/* ============================================================
   CARTE RPRP PUBLIQUE
   ============================================================ */

.loi25-rprp-card {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 16px 20px;
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    background: #fff;
    color: #222;
}
.loi25-rprp-card__label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #888; margin: 0 0 6px; padding: 0; }
.loi25-rprp-card__name  { font-weight: 600; font-size: 15px; margin: 0 0 4px; padding: 0; color: #111; }
.loi25-rprp-card__title   { font-weight: 400; }
.loi25-rprp-card__contact { margin: 2px 0; padding: 0; }
.loi25-rprp-card__contact a { color: inherit; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 600px) {
    #loi25-banner .loi25-banner__inner { padding: 12px 14px; }
    #loi25-banner.loi25-banner--corner-bl,
    #loi25-banner.loi25-banner--corner-br { width: calc(100% - 24px); left: 12px; right: 12px; }
    #loi25-banner .loi25-btn { padding: 8px 14px; font-size: 12px; }

    #loi25-modal .loi25-modal__body { flex-direction: column; }
    #loi25-modal .loi25-modal__tabs {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
        display: flex;
        overflow-x: auto;
        background: #f8f8f8;
    }
    #loi25-modal .loi25-modal__tab-btn {
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
        padding: 10px 14px;
    }
    #loi25-modal .loi25-modal__tab-btn--active {
        border-bottom: 3px solid #1a3a5c;
        border-left: none;
        background: #fff;
    }
    #loi25-modal .loi25-modal__panels { padding: 16px; }
    #loi25-modal .loi25-modal__footer { flex-wrap: wrap; }
}
