/* =============================================
   LEGAL PAGES (mentions légales + version élèves)
   ============================================= */

.legal-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 960px;
    margin: 0 auto;
}

.legal-meta {
    margin-bottom: 0;
}

.legal-meta i,
.legal-meta svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* --- Sommaire ----------------------------------- */
.legal-toc {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--primary) 8%, var(--bg-card)),
        var(--bg-card));
    border-left: 3px solid var(--primary);
}

.legal-toc-list {
    list-style: decimal inside;
    columns: 2;
    column-gap: 2rem;
    margin: 0;
    padding: 0;
    line-height: 1.9;
}

.legal-toc-list li {
    break-inside: avoid;
}

.legal-toc-list a {
    color: var(--text-main);
    text-decoration: none;
    transition: color var(--transition-normal);
    border-bottom: 1px solid transparent;
}

.legal-toc-list a:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* --- Sections ----------------------------------- */
.legal-section {
    scroll-margin-top: 5rem;
}

.legal-section .section-title {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    color: var(--primary-800);
}

.legal-section .section-title i,
.legal-section .section-title svg {
    width: 22px;
    height: 22px;
    color: var(--primary);
}

.legal-section p {
    line-height: 1.7;
    color: var(--text-main);
    margin: 0 0 1rem;
}

.legal-section p:last-child {
    margin-bottom: 0;
}

.legal-note {
    font-size: 0.9rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border-light);
}

/* --- Listes ------------------------------------- */
.legal-list {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    line-height: 1.8;
}

.legal-list li {
    margin-bottom: 0.4rem;
}

.legal-list li:last-child {
    margin-bottom: 0;
}

.legal-list strong {
    color: var(--text-main);
}

/* --- Description list (key/value) --------------- */
.legal-dl {
    display: grid;
    grid-template-columns: minmax(180px, 220px) 1fr;
    gap: 0.6rem 1.5rem;
    margin: 0 0 0.5rem;
    align-items: baseline;
}

.legal-dl dt {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.legal-dl dd {
    margin: 0;
    color: var(--text-main);
}

.legal-dl dd a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--primary) 40%, transparent);
}

.legal-dl dd a:hover {
    border-bottom-color: var(--primary);
}

/* --- Tableau ------------------------------------ */
.legal-table-wrap {
    margin-top: 0.5rem;
}

.legal-table-wrap .table th {
    font-size: 0.78rem;
}

.legal-table-wrap .table td {
    vertical-align: top;
    line-height: 1.55;
}

/* --- Alertes inline ----------------------------- */
.legal-section .alert {
    margin: 1rem 0 0;
    align-items: flex-start;
}

.legal-section .alert i,
.legal-section .alert svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.legal-section .alert a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

/* --- Version élèves : ton plus chaleureux ------- */
.legal-page--eleves .legal-section .section-title {
    color: var(--success-dark);
}

.legal-page--eleves .legal-section .section-title i,
.legal-page--eleves .legal-section .section-title svg {
    color: var(--success);
}

/* --- Responsive --------------------------------- */
@media (max-width: 768px) {
    .legal-toc-list {
        columns: 1;
    }

    .legal-dl {
        grid-template-columns: 1fr;
        gap: 0.2rem 0;
    }

    .legal-dl dt {
        margin-top: 0.5rem;
    }

    .legal-dl dt:first-child {
        margin-top: 0;
    }
}
