
/* Consentement : préférences, conservation locale et mesure d’audience. */

.cookie-settings {
    grid-column: 1 / -1;
    scroll-margin-top: 24px;
}

.cookie-settings-heading, .cookie-category {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.cookie-settings-heading h2 {
    margin-bottom: 8px;
}

.cookie-settings p, .cookie-banner p {
    line-height: 1.6;
}

.cookie-settings-heading p {
    margin: 0 0 20px;
    color: #475569;
}

.cookie-scope, .cookie-badge {
    flex-shrink: 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 12px;
    font-weight: 600;
}

.cookie-category {
    padding: 18px 0;
    border-top: 1px solid #dbe3ee;
}

.cookie-category h3 {
    margin: 0 0 6px;
    font-size: 15px;
}

.cookie-category p {
    max-width: 720px;
    margin: 0;
    color: #475569;
    font-size: 14px;
}

.cookie-status {
    padding: 12px 14px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #334155;
    font-size: 14px;
}

.cookie-choice-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cookie-choice-actions button {
    margin: 0;
    padding: 11px 16px;
    border: 1px solid #64748b;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
}

.cookie-choice-actions button:hover {
    background: #eff6ff;
    border-color: #2563eb;
}

.cookie-choice-actions button[aria-pressed="true"] {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1e40af;
    box-shadow: inset 0 0 0 1px #2563eb;
}

.cookie-choice-actions button:focus-visible, .cookie-policy-link:focus-visible, .cookie-footer-link button:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 4px;
}

.cookie-settings-note {
    margin: 16px 0 8px;
    color: #475569;
    font-size: 13px;
}

.cookie-policy-link {
    color: #1d4ed8;
    font-size: 13px;
    text-underline-offset: 3px;
}

.cookie-footer-link {
    text-align: center;
    padding: 12px 20px 20px;
}

.cookie-footer-link button {
    border: 0;
    padding: 6px 10px;
    background: transparent;
    color: #475569;
    font: inherit;
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.cookie-banner {
    position: fixed;
    left: 18px;
    right: 18px;
    bottom: 18px;
    z-index: 1000;
    max-width: 1000px;
    margin: auto;
    padding: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: #fff;
    color: #0f172a;
    border: 1px solid #dbe3ee;
    border-radius: 16px;
    box-shadow: 0 18px 45px #0f172a29;
    box-sizing: border-box;
    max-height: calc(100dvh - 36px);
    overflow: auto;
}

.cookie-banner[hidden], .cookie-choice-actions button[hidden] {
    display: none;
}

.cookie-banner h2 {
    margin: 0;
    font-size: 17px;
}

.cookie-banner p {
    margin: 8px 0;
    color: #475569;
    font-size: 14px;
}

.cookie-banner #cookieBannerStatus:empty {
    display: none;
}

.cookie-banner .cookie-choice-actions {
    flex-shrink: 0;
}

/* Variantes du thème sombre ; conserver l’ordre de surcharge. */

html.dark .cookie-settings-heading p, html.dark .cookie-category p, html.dark .cookie-settings-note, html.dark .cookie-banner p, html.dark .cookie-footer-link button {
    color: #b4c2d5;
}

html.dark .cookie-category {
    border-color: #334155;
}

html.dark .cookie-banner {
    background: #111827;
    border-color: #334155;
    color: #e5edf7;
}

html.dark .cookie-scope, html.dark .cookie-badge, html.dark .cookie-status {
    background: #1e293b;
    color: #c7ddff;
}

html.dark .cookie-choice-actions button {
    background: #182131;
    color: #e5edf7;
    border-color: #64748b;
}

html.dark .cookie-choice-actions button:hover, html.dark .cookie-choice-actions button[aria-pressed="true"] {
    background: #1e3a5f;
    border-color: #93c5fd;
    color: #dbeafe;
}

html.dark .cookie-policy-link {
    color: #93c5fd;
}

/* Adaptation de la mise en page : (max-width:700px). */

@media(max-width:700px) {
    .cookie-banner {
        flex-direction: column;
        align-items: stretch;
        padding: 18px;
        gap: 16px;
    }

    .cookie-choice-actions {
        width: 100%;
    }

    .cookie-choice-actions button {
        flex: 1;
    }

    .cookie-settings-heading {
        flex-direction: column;
        gap: 0;
        margin-bottom: 18px;
    }

    .cookie-settings-heading p {
        margin-bottom: 10px;
    }

    .cookie-category {
        gap: 12px;
        flex-wrap: wrap;
    }
}

.cookie-settings:focus {
    outline: none;
}

.cookie-settings:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 4px;
}

/* Adaptation de la mise en page : (max-width:900px). */

@media(max-width:900px) {
    .cookie-settings {
        scroll-margin-top: 100px;
    }
}
