/* ============================================================
   Mentions légales / CGU / Politique de confidentialité — /cgu.html
   Design V4 (mêmes tokens que _connected_header et le dashboard).
   Toutes les valeurs en px car le bundle force html { font-size: 10px }
   (legacy 62.5%).
   ============================================================ */

/* ----- Override container largeur pour matcher le header V4 ----- */
body > header > .container,
.cgu-hero > .container,
.cgu-page > .container {
    width: 100% !important;
    max-width: 1440px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    box-sizing: border-box !important;
}

body > header > .container {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

body > header > .container::before,
body > header > .container::after,
.cgu-hero > .container::before,
.cgu-hero > .container::after,
.cgu-page > .container::before,
.cgu-page > .container::after {
    content: none !important;
    display: none !important;
}

@media (min-width: 768px) {
    body > header .hamburger-btn {
        display: none !important;
    }
}

/* ----- Boutons & logo du _visitor_header ----- */
body > header .public-buttons {
    gap: 14px !important;
}

body > header .public-buttons .btn {
    padding: 11px 22px !important;
    border-radius: 999px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    border: 1px solid transparent !important;
}

body > header .public-buttons .btn.btn-secondary {
    background: transparent !important;
    color: #475569 !important;
    border-color: #e5e7eb !important;
}

body > header .public-buttons .btn.btn-secondary:hover {
    background: #f8fafc !important;
    color: #181c2f !important;
    border-color: #cbd5e1 !important;
    text-decoration: none !important;
}

body > header .public-buttons .btn:not(.btn-secondary) {
    background: #f47d3c !important;
    color: #ffffff !important;
}

body > header .public-buttons .btn:not(.btn-secondary):hover {
    background: #e9651f !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

body > header .header-logo-v4 .header-logo-text-v4 {
    font-size: 20px !important;
    font-weight: 800 !important;
}

/* ----- Overrides _connected_header (page consultée connecté) ----- */
body > header.site-header-v4 {
    height: 75px !important;
}
body > header.site-header-v4 .header-container-v4 {
    padding: 14px clamp(16px, 3vw, 32px) !important;
}
body > header.site-header-v4 .header-logo-v4 { gap: 8px !important; }
body > header.site-header-v4 .header-logo-v4 img { height: 36px !important; }
body > header.site-header-v4 .header-logo-text-v4 { font-size: 18px !important; font-weight: 700 !important; }
body > header.site-header-v4 .header-nav-v4 { gap: 4px !important; }
body > header.site-header-v4 .nav-link-v4 { padding: 8px 16px !important; font-size: 14px !important; border-radius: 8px !important; }
body > header.site-header-v4 .header-right-v4 { gap: 8px !important; }
body > header.site-header-v4 .header-icon-btn-v4 { width: 40px !important; height: 40px !important; }
body > header.site-header-v4 .header-icon-btn-v4 svg { width: 20px !important; height: 20px !important; }
body > header.site-header-v4 .header-profile-v4 { gap: 12px !important; padding: 6px 12px 6px 6px !important; }
body > header.site-header-v4 .header-profile-avatar-v4 { width: 32px !important; height: 32px !important; }
body > header.site-header-v4 .header-profile-name-v4 { font-size: 14px !important; }
body > header.site-header-v4 .header-profile-chevron-v4 { width: 16px !important; height: 16px !important; }

/* ============================================================
   Hero
   ============================================================ */

.cgu-hero {
    position: relative;
    background: linear-gradient(135deg, #fff5ec 0%, #fffaf5 60%, #ffffff 100%);
    border-bottom: 1px solid #f4d5b8;
    padding: 48px 0 52px;
    overflow: hidden;
}

.cgu-hero::before {
    content: "";
    position: absolute;
    top: -80px;
    right: -80px;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(244, 125, 60, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.cgu-hero > .container {
    position: relative;
    z-index: 1;
}

.cgu-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 16px;
}

.cgu-breadcrumb a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.15s;
}

.cgu-breadcrumb a:hover {
    color: #f47d3c;
    text-decoration: underline;
}

.cgu-breadcrumb-sep {
    color: #f4d5b8;
    font-weight: 600;
}

.cgu-breadcrumb-current {
    color: #181c2f;
    font-weight: 600;
}

.cgu-hero-title {
    margin: 0 0 16px 0;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.15;
    font-weight: 800;
    color: #181c2f;
    letter-spacing: -0.02em;
}

.cgu-hero-subtitle {
    margin: 0 0 20px 0;
    max-width: 720px;
    font-size: 16px;
    line-height: 1.6;
    color: #475569;
}

.cgu-hero-update {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #f4d5b8;
    font-size: 13px;
    font-weight: 600;
    color: #b8531f;
}

/* ============================================================
   Layout : sommaire sticky + contenu
   ============================================================ */

.cgu-page {
    background: #f8fafc;
    padding: 40px 0 64px;
}

.cgu-layout {
    display: block;
}

@media (min-width: 992px) {
    .cgu-layout {
        display: grid;
        grid-template-columns: 288px minmax(0, 1fr);
        gap: 32px;
        align-items: start;
    }
}

/* ----- Sommaire ----- */

.cgu-toc {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 8px 16px;
    margin-bottom: 24px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Bouton de repli — mobile uniquement */
.cgu-toc-toggle {
    display: block;
    width: 100%;
    padding: 12px 0;
    background: none;
    border: 0;
    text-align: left;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    color: #181c2f;
    position: relative;
}

.cgu-toc-toggle::after {
    content: "";
    position: absolute;
    right: 4px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid #94a3b8;
    border-bottom: 2px solid #94a3b8;
    transform: translateY(-70%) rotate(45deg);
    transition: transform 0.2s;
}

.cgu-toc-toggle[aria-expanded="true"]::after {
    transform: translateY(-30%) rotate(-135deg);
}

/* Sommaire replié tant que le bouton n'est pas déplié (mobile). */
.cgu-toc-toggle[aria-expanded="false"] ~ .cgu-toc-list {
    display: none;
}

.cgu-toc-title {
    display: none;
    margin: 0 0 12px 0;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}

.cgu-toc-list {
    list-style: none;
    margin: 0 0 12px 0;
    padding: 0;
}

.cgu-toc-list li {
    margin: 0;
}

.cgu-toc-link {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    border-left: 2px solid transparent;
    font-size: 13.5px;
    line-height: 1.4;
    color: #475569;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.cgu-toc-link:hover,
.cgu-toc-link:focus {
    background: #f8fafc;
    color: #181c2f;
    text-decoration: none;
}

.cgu-toc-link.is-active {
    background: #fff7ed;
    border-left-color: #f47d3c;
    color: #b8531f;
    font-weight: 600;
}

/* Entrées de premier niveau : les trois blocs */
.cgu-toc-link--bloc {
    font-size: 14px;
    font-weight: 700;
    color: #181c2f;
}

.cgu-toc-sublist {
    list-style: none;
    margin: 0 0 4px 12px;
    padding: 0;
}

@media (min-width: 992px) {
    .cgu-toc {
        position: sticky;
        top: 95px;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        margin-bottom: 0;
        padding: 20px 12px 12px;
    }

    /* Sur desktop le sommaire est toujours déplié : plus de bouton, et la
       liste reste visible quel que soit l'état aria-expanded du bouton. */
    .cgu-toc-toggle {
        display: none;
    }

    .cgu-toc-toggle[aria-expanded="false"] ~ .cgu-toc-list {
        display: block;
    }

    .cgu-toc-title {
        display: block;
        padding-left: 12px;
    }
}

/* ----- Contenu ----- */

.cgu-content {
    min-width: 0;
}

/* Trois blocs : mentions légales, CGU, politique de confidentialité */
.cgu-bloc + .cgu-bloc {
    margin-top: 48px;
}

.cgu-bloc-title {
    margin: 0 0 20px 0;
    padding-left: 14px;
    border-left: 4px solid #f47d3c;
    font-size: 28px;
    line-height: 1.2;
    font-weight: 800;
    color: #181c2f;
    letter-spacing: -0.02em;
    /* décalage pour le header fixe (75px) lors des ancres */
    scroll-margin-top: 95px;
}

.cgu-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 28px 28px 12px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    /* décalage pour le header fixe (75px) lors des ancres */
    scroll-margin-top: 95px;
}

.cgu-section-title {
    margin: 0 0 20px 0;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 22px;
    line-height: 1.3;
    font-weight: 700;
    color: #181c2f;
    letter-spacing: -0.01em;
}

.cgu-section-body {
    font-size: 15px;
    line-height: 1.7;
    color: #334155;
}

.cgu-section-body p {
    margin: 0 0 14px 0;
}

.cgu-section-body b,
.cgu-section-body strong {
    color: #181c2f;
    font-weight: 700;
}

.cgu-section-body a {
    color: #d1621f;
    text-decoration: underline;
    word-break: break-word;
}

.cgu-section-body a:hover {
    color: #b8531f;
}

@media (max-width: 767px) {
    .cgu-hero {
        padding: 32px 0 36px;
    }

    .cgu-page {
        padding: 24px 0 40px;
    }

    .cgu-section {
        padding: 20px 18px 8px;
        border-radius: 12px;
    }

    .cgu-section-title {
        font-size: 19px;
    }

    .cgu-bloc-title {
        font-size: 23px;
    }

    .cgu-bloc + .cgu-bloc {
        margin-top: 36px;
    }
}