/* ── Base ── */
body {
    margin: 0;
    padding: 0;
    font-family: 'Space Grotesk', sans-serif;
    background-color: #07090f;
    color: #e8e8e8;
    overflow-x: hidden;
}

/* ── Scroll animations ── */
[data-scroll="fade-up"] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease var(--d, 0s), transform 0.7s ease var(--d, 0s);
}

[data-scroll="fade-up"].visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    [data-scroll="fade-up"] {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ── Container ── */
.legal-container {
    padding: 80px 8vw 140px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ── Page hero bar ── */
.page-hero-bar {
    margin-bottom: 64px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.eyebrow-label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #5599ff;
    margin-bottom: 1.2rem;
}

.page-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.4rem, 6vw, 5rem);
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.05;
}

.page-intro {
    margin: 1.6rem 0 0;
    max-width: 640px;
    font-size: 1.05rem;
    font-weight: 300;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
}

/* ── Layout ── */
.legal-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 80px;
    align-items: start;
}

/* ── Navigation entre pages légales ── */
.legal-nav {
    position: sticky;
    top: 110px;
}

.legal-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.legal-nav a {
    display: block;
    padding: 14px 0 14px 18px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 400;
    transition: color 0.25s ease, border-color 0.25s ease;
}

.legal-nav a:hover {
    color: #ffffff;
    border-left-color: rgba(85, 153, 255, 0.5);
}

.legal-nav a[aria-current="page"] {
    color: #5599ff;
    border-left: 2px solid #5599ff;
    font-weight: 600;
}

/* ── Contenu ── */
.legal-content {
    min-width: 0;
    max-width: 760px;
    font-size: 0.98rem;
    font-weight: 300;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.78);
}

.legal-section + .legal-section {
    margin-top: 56px;
    padding-top: 56px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.legal-content h2 {
    font-size: 1.35rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.01em;
    margin: 0 0 1.2rem;
}

.legal-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 2rem 0 0.8rem;
}

.legal-content p {
    margin: 0 0 1rem;
}

.legal-content ul {
    margin: 0 0 1rem;
    padding-left: 1.2rem;
}

.legal-content li {
    margin-bottom: 0.5rem;
}

.legal-content li::marker {
    color: #5599ff;
}

.legal-content strong {
    font-weight: 600;
    color: #ffffff;
}

.legal-content a {
    color: #7eb3ff;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.legal-content a:hover {
    color: #ffffff;
}

.legal-nav a:focus-visible,
.legal-content a:focus-visible {
    outline: 2px solid #5599ff;
    outline-offset: 3px;
}

.legal-content code {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.85em;
    padding: 2px 6px;
    background: rgba(85, 153, 255, 0.08);
    color: #a9c9ff;
}

/* Encadré de synthèse */
.legal-summary {
    margin: 0 0 56px;
    padding: 24px 28px;
    border-left: 2px solid #5599ff;
    background: rgba(85, 153, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
}

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

/* Fiche d'identité (éditeur, hébergeur...) */
.legal-card {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 12px 24px;
    margin: 0 0 1.4rem;
    padding: 24px 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.legal-card dt {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(85, 153, 255, 0.85);
    padding-top: 4px;
}

.legal-card dd {
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
}

/* Tableaux */
.table-wrapper {
    overflow-x: auto;
    margin: 0 0 1.4rem;
}

.table-wrapper:focus-visible {
    outline: 2px solid #5599ff;
    outline-offset: 4px;
}

.legal-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.legal-table caption {
    text-align: left;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    padding-bottom: 10px;
}

.legal-table th,
.legal-table td {
    text-align: left;
    vertical-align: top;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.legal-table thead th {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(85, 153, 255, 0.85);
    border-bottom-color: rgba(85, 153, 255, 0.25);
}

.legal-table tbody th {
    font-weight: 600;
    color: #ffffff;
}

/* Plan du site */
.sitemap-list {
    list-style: none;
    padding: 0 !important;
}

.sitemap-list li {
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sitemap-list a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 20px;
    padding: 16px 0;
    text-decoration: none;
    color: #ffffff;
    font-weight: 500;
}

.sitemap-list a span {
    font-size: 0.85rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.55);
    text-align: right;
}

.sitemap-list a:hover {
    color: #7eb3ff;
}

.legal-updated {
    margin-top: 64px !important;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ── Theme light ── */
body.light {
    background-color: #f4f4f8;
    color: #111;
}

body.light .page-hero-bar,
body.light .legal-section + .legal-section { border-color: rgba(0,0,0,0.08); }
body.light .eyebrow-label { color: #2266dd; }
body.light .page-title { color: #0a0a0f; }
body.light .page-intro { color: rgba(0,0,0,0.65); }

body.light .legal-nav a { color: rgba(0,0,0,0.6); border-left-color: rgba(0,0,0,0.12); }
body.light .legal-nav a:hover { color: #0a0a0f; border-left-color: rgba(34,102,221,0.5); }
body.light .legal-nav a[aria-current="page"] { color: #2266dd; border-left-color: #2266dd; }

body.light .legal-content { color: rgba(0,0,0,0.75); }
body.light .legal-content h2,
body.light .legal-content h3,
body.light .legal-content strong,
body.light .legal-table tbody th,
body.light .legal-card dd { color: #0a0a0f; }
body.light .legal-content a { color: #1a55c0; }
body.light .legal-content a:hover { color: #0a0a0f; }
body.light .legal-content li::marker { color: #2266dd; }
body.light .legal-content code { background: rgba(34,102,221,0.08); color: #1a55c0; }
body.light .legal-nav a:focus-visible,
body.light .legal-content a:focus-visible { outline-color: #2266dd; }

body.light .legal-summary { background: rgba(34,102,221,0.07); border-left-color: #2266dd; color: rgba(0,0,0,0.8); }
body.light .legal-card { border-color: rgba(0,0,0,0.1); background: #ffffff; }
body.light .legal-card dt,
body.light .legal-table thead th { color: #1a55c0; }
body.light .legal-table thead th { border-bottom-color: rgba(34,102,221,0.3); }
body.light .legal-table th,
body.light .legal-table td { border-bottom-color: rgba(0,0,0,0.08); }
body.light .legal-table caption,
body.light .legal-updated { color: rgba(0,0,0,0.55); }

body.light .sitemap-list li { border-bottom-color: rgba(0,0,0,0.08); }
body.light .sitemap-list a { color: #0a0a0f; }
body.light .sitemap-list a span { color: rgba(0,0,0,0.55); }
body.light .sitemap-list a:hover { color: #1a55c0; }

/* ── Responsive ── */
@media screen and (max-width: 1024px) {
    .legal-layout {
        grid-template-columns: 220px 1fr;
        gap: 48px;
    }
}

@media screen and (max-width: 800px) {
    .legal-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .legal-nav {
        position: static;
    }

    .legal-nav ul {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .legal-nav a {
        padding: 8px 14px;
        border: 1px solid rgba(255, 255, 255, 0.12);
    }

    .legal-nav a[aria-current="page"] {
        border: 1px solid #5599ff;
    }

    body.light .legal-nav a { border-color: rgba(0,0,0,0.12); }
    body.light .legal-nav a[aria-current="page"] { border-color: #2266dd; }
}

@media screen and (max-width: 600px) {
    .legal-container { padding: 60px 6vw 100px; }
    .page-hero-bar { margin-bottom: 40px; padding-bottom: 32px; }
    .legal-card { grid-template-columns: 1fr; gap: 4px; padding: 20px; }
    .legal-card dd { margin-bottom: 12px; }
    .legal-summary { padding: 20px; }
    .sitemap-list a { flex-direction: column; gap: 4px; }
    .sitemap-list a span { text-align: left; }
}

.page-title {
    overflow-wrap: break-word;
    hyphens: auto;
}
