/* ============================================================
   LEGAL — mentions légales, CGU, politique de confidentialité
   Dépend de : bases/variables · bases/components
   ============================================================ */

/* HERO */
.legal-hero {
    background: var(--dark-bg);
    padding: 56px 0 48px;
    border-bottom: 0.5px solid var(--dark-border);
}

.legal-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.12);
    color: #60A5FA;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    border: 0.5px solid rgba(96, 165, 250, 0.3);
    margin-bottom: 16px;
}

.legal-title {
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 600;
    color: var(--dark-text-primary);
    line-height: 1.2;
    margin-bottom: 10px;
    max-width: 720px;
}

.legal-meta { font-size: 13px; color: var(--dark-text-secondary); }

/* LAYOUT */
.legal-body {
    background: var(--light-bg-alt);
    padding: 48px 0 72px;
}

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

@media (min-width: 1024px) {
    .legal-grid { grid-template-columns: 220px 1fr; gap: 48px; }
}

/* TABLE DES MATIÈRES */
.legal-toc {
    background: var(--light-bg);
    border: 0.5px solid var(--light-border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

@media (min-width: 1024px) { .legal-toc { position: sticky; top: 80px; } }

.toc-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--light-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toc-list li { list-style: none; }

.toc-list a {
    display: block;
    font-size: 13px;
    color: var(--light-text-secondary);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    line-height: 1.4;
    transition: background var(--tr), color var(--tr);
}

.toc-list a:hover { background: var(--light-bg-alt); color: var(--accent); }

/* ARTICLE */
.legal-article {
    background: var(--light-bg);
    border: 0.5px solid var(--light-border);
    border-radius: var(--radius-lg);
    padding: 32px;
}

@media (max-width: 479px) { .legal-article { padding: 20px 16px; } }

/* Bannière intro */
.legal-intro-banner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: rgba(59, 130, 246, 0.04);
    border: 0.5px solid rgba(59, 130, 246, 0.15);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin-bottom: 32px;
    color: var(--light-text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.legal-intro-banner svg { flex-shrink: 0; color: var(--accent); margin-top: 2px; }
.legal-intro-banner p  { margin: 0; }

/* Sections */
.legal-section {
    margin-bottom: 36px;
    padding-bottom: 36px;
    border-bottom: 0.5px solid var(--light-border);
}

.legal-section:last-of-type { margin-bottom: 32px; padding-bottom: 0; border-bottom: none; }

.legal-section h2 { font-size: 18px; font-weight: 600; color: var(--light-text-primary); margin-bottom: 14px; line-height: 1.3; padding-top: 4px; }
.legal-section h3 { font-size: 14px; font-weight: 600; color: var(--light-text-primary); margin: 20px 0 10px; }

.legal-section p {
    font-size: 14px;
    color: var(--light-text-secondary);
    line-height: 1.75;
    margin-bottom: 12px;
}

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

.legal-section a { color: var(--accent); transition: color var(--tr); }
.legal-section a:hover { color: var(--accent-hover); text-decoration: underline; }

/* Liste */
.legal-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.legal-list li {
    font-size: 14px;
    color: var(--light-text-secondary);
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
}

.legal-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.5;
}

/* Note */
.legal-note {
    font-size: 12px !important;
    color: var(--light-text-muted) !important;
    font-style: italic;
    background: var(--light-bg-alt);
    border-left: 2px solid var(--light-border);
    padding: 8px 12px !important;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* TABLEAUX D'INFOS */
.info-table {
    border: 0.5px solid var(--light-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 16px 0;
}

.info-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 16px;
    padding: 12px 16px;
    border-bottom: 0.5px solid var(--light-border);
    align-items: baseline;
}

.info-row:last-child { border-bottom: none; }

.info-row--header {
    background: var(--light-bg-alt);
    font-weight: 600;
    font-size: 12px;
    color: var(--light-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-row span:first-child { font-size: 13px; font-weight: 500; color: var(--light-text-muted); }
.info-row span:last-child,
.info-row span:nth-child(2) { font-size: 13px; color: var(--light-text-primary); }
.info-row:nth-child(even)   { background: var(--light-bg-alt); }
.info-row a { color: var(--accent); }
.info-row a:hover { text-decoration: underline; }

/* CARDS RGPD */
.legal-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 16px 0;
}

@media (min-width: 640px) { .legal-cards { grid-template-columns: 1fr 1fr; } }

.legal-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--light-bg-alt);
    border: 0.5px solid var(--light-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}

.legal-card-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: rgba(59, 130, 246, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent);
}

.legal-card strong { display: block; font-size: 13px; font-weight: 500; color: var(--light-text-primary); margin-bottom: 3px; }
.legal-card p      { font-size: 12px !important; color: var(--light-text-muted) !important; line-height: 1.5 !important; margin: 0 !important; }

/* COOKIES */
.cookie-types { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }

.cookie-type-card {
    background: var(--light-bg-alt);
    border: 0.5px solid var(--light-border);
    border-left: 3px solid transparent;
    border-radius: var(--radius-md);
    padding: 16px 18px;
}

.cookie-type--essential  { border-left-color: #22C55E; }
.cookie-type--analytics  { border-left-color: #3B82F6; }
.cookie-type--functional { border-left-color: #F59E0B; }
.cookie-type--marketing  { border-left-color: #EC4899; }

.cookie-type-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }

.cookie-type-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    letter-spacing: 0.3px;
}

.cookie-type-badge.essential  { background: rgba(34,197,94,0.1);  color: #15803D; }
.cookie-type-badge.analytics  { background: rgba(59,130,246,0.1); color: #1D4ED8; }
.cookie-type-badge.functional { background: rgba(245,158,11,0.1); color: #B45309; }
.cookie-type-badge.marketing  { background: rgba(236,72,153,0.1); color: #BE185D; }

.cookie-type-status { font-size: 11px; color: var(--light-text-muted); }

.cookie-type-card p {
    font-size: 13px !important;
    color: var(--light-text-secondary) !important;
    line-height: 1.6 !important;
    margin-bottom: 6px !important;
}

.cookie-type-card p em { font-size: 12px; color: var(--light-text-muted); }

/* Tableau cookies */
.cookie-table { border: 0.5px solid var(--light-border); border-radius: var(--radius-md); overflow: hidden; margin: 12px 0 20px; }

.cookie-table-header,
.cookie-table-row {
    display: grid;
    grid-template-columns: 1.2fr 2fr 1fr;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 0.5px solid var(--light-border);
    align-items: baseline;
}

.cookie-table-row:last-child { border-bottom: none; }

.cookie-table-header {
    background: var(--light-bg-alt);
    font-size: 11px;
    font-weight: 600;
    color: var(--light-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cookie-table-row:nth-child(even) { background: var(--light-bg-alt); }
.cookie-table-row span { font-size: 13px; color: var(--light-text-secondary); line-height: 1.4; }

.cookie-table-row code {
    font-size: 12px;
    font-family: 'Courier New', monospace;
    background: rgba(59, 130, 246, 0.06);
    color: #1D4ED8;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Bouton préférences cookies */
.cookie-pref-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background var(--tr);
    margin: 12px 0 20px;
}

.cookie-pref-btn:hover { background: var(--accent-hover); }

/* Liens navigateurs */
.browser-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

.browser-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--accent);
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.06);
    border: 0.5px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-full);
    transition: background var(--tr);
}

.browser-link:hover { background: rgba(59, 130, 246, 0.12); }

/* CTA BAS DE PAGE */
.legal-cta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    background: var(--dark-bg);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-top: 32px;
}

@media (min-width: 640px) { .legal-cta { flex-direction: row; align-items: center; justify-content: space-between; } }

.legal-cta p { font-size: 14px !important; color: var(--dark-text-secondary) !important; margin: 0 !important; line-height: 1.5 !important; }

.legal-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-md);
    flex-shrink: 0;
    transition: background var(--tr);
}

.legal-cta-btn:hover { background: var(--accent-hover); }

/* FOCUS */
.toc-list a:focus-visible,
.legal-section a:focus-visible,
.legal-cta-btn:focus-visible,
.cookie-pref-btn:focus-visible,
.browser-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 3px;
}

/* IMPRESSION */
@media print {
    .legal-hero    { background: #fff !important; color: #000 !important; }
    .legal-toc     { display: none; }
    .legal-grid    { grid-template-columns: 1fr; }
    .legal-article { border: none; padding: 0; }
    .legal-cta     { display: none; }
    .legal-section h2 { color: #000 !important; }
    .legal-section p, .legal-list li { color: #333 !important; }
}