/* ============================================================
   Rendu moderne des pages légales / FAQ (scopé .legal-modern)
   Style du SITE : clair, bleu-violet #6072AC, Poppins.
   Tout est préfixé .legal-modern pour n'affecter que ces pages.
   ============================================================ */

.legal-modern {
    --lm-primary: #6072AC;
    --lm-primary-dark: #4a5a8c;
    --lm-text: #33384a;
    --lm-text-soft: #5a6069;
    --lm-muted: #8a90a0;
    --lm-border: #e3e6ea;
    --lm-bg-soft: #f4f6fa;
    --lm-bg-card: #ffffff;
    font-family: 'Poppins', sans-serif;
    color: var(--lm-text);
    margin-top: 1.5rem;
    max-width: 100%;
    overflow-wrap: break-word;
}

.legal-modern__layout {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 26px;
    align-items: start;
}

/* ---------- En-tete ---------- */
.legal-modern__header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 26px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--lm-border);
}
.legal-modern__header-icon {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.legal-modern__header-icon img {
    max-width: 72px;
    max-height: 72px;
    object-fit: contain;
}
.legal-modern__header-text {
    min-width: 0;
}
.legal-modern__label {
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--lm-primary);
    font-weight: 600;
    margin-bottom: 6px;
}
.legal-modern__title {
    font-size: 28px;
    font-weight: 600;
    color: var(--lm-primary);
    margin: 0 0 6px;
    padding: 0;
    line-height: 1.2;
}
.legal-modern__updated {
    font-size: 13px;
    color: var(--lm-muted);
}

/* ---------- Sommaire ---------- */
.legal-modern__toc {
    position: sticky;
    top: 90px;
    background: var(--lm-bg-card);
    border: 1px solid var(--lm-border);
    border-radius: 12px;
    padding: 16px 12px;
}
.legal-modern__toc-title {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--lm-muted);
    font-weight: 600;
    padding: 0 10px;
    margin-bottom: 10px;
}
.legal-modern__toc-link {
    display: block;
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 14px;
    color: #495057;
    text-decoration: none;
    margin-bottom: 4px;
    transition: background .15s, color .15s;
    cursor: pointer;
    line-height: 1.35;
}
.legal-modern__toc-link:hover {
    background: var(--lm-bg-soft);
    color: var(--lm-primary-dark);
}
.legal-modern__toc-link.is-active {
    background: var(--lm-primary);
    color: #fff;
    font-weight: 500;
}

/* ---------- Contenu ---------- */
.legal-modern__content { min-width: 0; }

.legal-modern__cat { margin-bottom: 34px; scroll-margin-top: 90px; }
.legal-modern__cat:last-child { margin-bottom: 0; }

.legal-modern__cat-title {
    font-size: 19px;
    font-weight: 600;
    color: #212529;
    margin: 0 0 4px;
    padding: 0;
}
.legal-modern__cat-title::after {
    content: "";
    display: block;
    width: 42px;
    height: 3px;
    background: var(--lm-primary);
    border-radius: 2px;
    margin-top: 8px;
    margin-bottom: 18px;
}
.legal-modern__cat-empty {
    color: var(--lm-muted);
    font-size: 14px;
    font-style: italic;
}

/* ---------- Accordéon ---------- */
.legal-modern__item {
    border: 1px solid var(--lm-border);
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
    background: var(--lm-bg-card);
}
.legal-modern__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    padding: 15px 18px;
    background: none;
    border: 0;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--lm-text);
    transition: background .15s;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}
.legal-modern__trigger:focus { outline: none; }
.legal-modern__trigger:focus-visible {
    outline: 2px solid var(--lm-primary);
    outline-offset: -2px;
    border-radius: 6px;
}
.legal-modern__trigger:hover { background: var(--lm-bg-soft); }
.legal-modern__item.is-open > .legal-modern__trigger { background: var(--lm-bg-soft); }

.legal-modern__chevron {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #eef1f7;
    color: var(--lm-primary);
    box-sizing: border-box;
    transition: transform .25s ease, background .2s, color .2s;
}
.legal-modern__item.is-open .legal-modern__chevron {
    transform: rotate(180deg);
    background: var(--lm-primary);
    color: #fff;
}

.legal-modern__panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
}
.legal-modern__item.is-open .legal-modern__panel {
    max-height: 4000px;
}
.legal-modern__panel-inner {
    padding: 4px 18px 18px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--lm-text-soft);
    overflow-x: auto;
}
.legal-modern__panel-inner img { max-width: 100%; height: auto; border-radius: 6px; }
.legal-modern__panel-inner table { max-width: 100%; }
.legal-modern__panel-inner p:first-child { margin-top: 0; }
.legal-modern__panel-inner a { color: var(--lm-primary); }

/* ---------- Vide ---------- */
.legal-modern__empty {
    text-align: center;
    padding: 50px 20px;
    color: var(--lm-muted);
}
.legal-modern__empty i { font-size: 42px; opacity: .5; }
.legal-modern__empty p { margin-top: 12px; font-size: 15px; }

/* ---------- Responsive ---------- */
@media (max-width: 969px) {
    .legal-modern { margin-top: 1rem; }
    .legal-modern__layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    /* En-tete : icone au-dessus, texte centre */
    .legal-modern__header {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        margin-bottom: 18px;
        padding-bottom: 16px;
    }
    .legal-modern__header-icon { width: 60px; height: 60px; }
    .legal-modern__header-icon img { max-width: 60px; max-height: 60px; }
    .legal-modern__title { font-size: 22px; }
    /* Sommaire : barre horizontale scrollable en haut */
    .legal-modern__toc {
        position: static;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 8px;
        padding: 10px;
        -webkit-overflow-scrolling: touch;
    }
    .legal-modern__toc-title { display: none; }
    .legal-modern__toc-link {
        margin-bottom: 0;
        white-space: nowrap;
        flex-shrink: 0;
        padding: 9px 14px;
        font-size: 13.5px;
    }
    /* Contenu */
    .legal-modern__cat { margin-bottom: 24px; }
    .legal-modern__cat-title { font-size: 17px; }
    .legal-modern__trigger {
        padding: 13px 14px;
        font-size: 14px;
        gap: 10px;
    }
    .legal-modern__panel-inner { padding: 4px 14px 16px; font-size: 13.5px; }
    .legal-modern__chevron { width: 26px; height: 26px; }
}

@media (max-width: 480px) {
    .legal-modern__title { font-size: 20px; }
    .legal-modern__trigger { font-size: 13.5px; padding: 12px; }
    .legal-modern__panel-inner img { border-radius: 4px; }
}
