/* =========================================================
   CONSENTEMENT COOKIES — partagé sur toutes les pages
   ========================================================= */
.cookie-consent-open { overflow: hidden; }

.cookie-consent {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: grid;
    place-items: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 180ms ease, visibility 180ms ease;
}
.cookie-consent.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.cookie-consent__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 10, 24, .40);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.cookie-consent__dialog {
    position: relative;
    z-index: 1;
    width: min(650px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    overflow-y: auto;
    overflow-x: visible;
    border-radius: 26px;
    padding: 36px 30px 24px;
    text-align: center;
}
.cookie-consent__icon {
    position: absolute;
    top: -28px;
    left: -30px;
    width: 136px;
    height: 136px;
    display: block;
    pointer-events: none;
    z-index: 2;
}
.cookie-consent__icon img { display: block; width: 100%; height: 100%; object-fit: contain; }
.cookie-consent__dialog h2 { margin: 18px 0 0; font-size: clamp(1.55rem, 3vw, 2rem); line-height: 1.15; }
.cookie-consent__text {
    width: fit-content;
    max-width: 100%;
    margin: 18px auto 24px;
    font-size: .96rem;
    line-height: 1.65;
    text-align: center;
}
.cookie-consent__actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cookie-consent__button,
.cookie-preferences__save {
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid transparent;
    padding: 0 17px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.cookie-consent__button--manage { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.cookie-preferences { display: none; margin-top: 18px; border-radius: 17px; padding: 8px; text-align: left; }
.cookie-preferences.is-open { display: block; }
.cookie-preferences__heading { padding: 9px 11px 12px; font-size: .77rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.cookie-preferences__item { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 72px; padding: 13px 14px; border-radius: 12px; }
.cookie-preferences__item + .cookie-preferences__item { margin-top: 6px; }
.cookie-preferences__copy { min-width: 0; display: grid; gap: 3px; }
.cookie-preferences__copy strong { font-size: .92rem; }
.cookie-preferences__copy span { font-size: .78rem; line-height: 1.4; }
.cookie-switch { position: relative; flex: 0 0 auto; width: 44px; height: 24px; cursor: pointer; }
.cookie-switch input { position: absolute; opacity: 0; pointer-events: none; }
.cookie-switch__track { position: absolute; inset: 0; border-radius: 999px; transition: background 160ms ease; }
.cookie-switch__track::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    top: 3px;
    left: 3px;
    border-radius: 50%;
    background: #fff;
    transition: transform 160ms ease;
}
.cookie-switch input:checked + .cookie-switch__track::after { transform: translateX(20px); }
.cookie-switch--locked { cursor: default; opacity: .78; }
.cookie-preferences__save { width: 100%; margin-top: 8px; }
.cookie-consent__privacy { margin: 28px 0 0; font-size: .76rem; }
.cookie-consent__privacy a { color: inherit; text-underline-offset: 3px; }

html[data-theme="light"] body .cookie-consent__dialog {
    background: rgba(255, 255, 255, .98);
    border: 1px solid #e5d9ef;
    color: #17122d;
    box-shadow: 0 24px 70px rgba(62, 43, 83, .18);
}
html[data-theme="light"] body .cookie-consent__text,
html[data-theme="light"] body .cookie-preferences__copy span,
html[data-theme="light"] body .cookie-consent__privacy { color: #6f6480; }
html[data-theme="light"] body .cookie-consent__button--manage { background: #fff; border-color: #b98bd8; color: #5e3f6f; }
html[data-theme="light"] body .cookie-consent__button--refuse { background: #fff; border-color: #ddd4e7; color: #4d425c; }
html[data-theme="light"] body .cookie-consent__button--accept,
html[data-theme="light"] body .cookie-preferences__save { background: #744b8b; color: #fff; }
html[data-theme="light"] body .cookie-consent__button--manage:hover,
html[data-theme="light"] body .cookie-consent__button--manage:focus-visible { background: #f8f2fb; }
html[data-theme="light"] body .cookie-consent__button--refuse:hover,
html[data-theme="light"] body .cookie-consent__button--refuse:focus-visible { background: #f7f5f9; }
html[data-theme="light"] body .cookie-consent__button--accept:hover,
html[data-theme="light"] body .cookie-consent__button--accept:focus-visible,
html[data-theme="light"] body .cookie-preferences__save:hover,
html[data-theme="light"] body .cookie-preferences__save:focus-visible { background: #674078; }
html[data-theme="light"] body .cookie-preferences { background: #faf8fc; border: 1px solid #e8e0ef; }
html[data-theme="light"] body .cookie-preferences__heading { color: #744b8b; }
html[data-theme="light"] body .cookie-preferences__item { background: #fff; border: 1px solid #ece5f1; }
html[data-theme="light"] body .cookie-preferences__item--locked { background: #f7f4fa; }
html[data-theme="light"] body .cookie-switch__track { background: #c9c3d1; }
html[data-theme="light"] body .cookie-switch input:checked + .cookie-switch__track { background: #8a5ca2; }

html[data-theme="dark"] body .cookie-consent__backdrop { background: rgba(2, 4, 14, .62); }
html[data-theme="dark"] body .cookie-consent__dialog {
    background: #0d0e20;
    border: 1px solid #4a3f70;
    color: #f7f7fa;
    box-shadow: 0 28px 76px rgba(0, 0, 0, .58);
}
html[data-theme="dark"] body .cookie-consent__text,
html[data-theme="dark"] body .cookie-preferences__copy span,
html[data-theme="dark"] body .cookie-consent__privacy { color: #c6c2d2; }
html[data-theme="dark"] body .cookie-consent__button--manage { background: transparent; border-color: #8a5ca2; color: #f2e7fa; }
html[data-theme="dark"] body .cookie-consent__button--refuse { background: #11142a; border-color: #49435f; color: #f7f7fa; }
html[data-theme="dark"] body .cookie-consent__button--accept,
html[data-theme="dark"] body .cookie-preferences__save { background: #744b8b; color: #fff; }
html[data-theme="dark"] body .cookie-consent__button--manage:hover,
html[data-theme="dark"] body .cookie-consent__button--manage:focus-visible { background: #171532; }
html[data-theme="dark"] body .cookie-consent__button--refuse:hover,
html[data-theme="dark"] body .cookie-consent__button--refuse:focus-visible { background: #181a35; }
html[data-theme="dark"] body .cookie-consent__button--accept:hover,
html[data-theme="dark"] body .cookie-consent__button--accept:focus-visible,
html[data-theme="dark"] body .cookie-preferences__save:hover,
html[data-theme="dark"] body .cookie-preferences__save:focus-visible { background: #8a5ca2; }
html[data-theme="dark"] body .cookie-preferences { background: #101226; border: 1px solid #2e2b4b; }
html[data-theme="dark"] body .cookie-preferences__heading { color: #c39be7; }
html[data-theme="dark"] body .cookie-preferences__item { background: #11142a; border: 1px solid #262642; }
html[data-theme="dark"] body .cookie-preferences__item--locked { background: #17172d; }
html[data-theme="dark"] body .cookie-switch__track { background: #4b4b60; }
html[data-theme="dark"] body .cookie-switch input:checked + .cookie-switch__track { background: #744b8b; }

.cookie-manage-link {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: none;
    padding: 0;
    color: inherit;
    font: inherit;
    font-size: inherit;
    cursor: pointer;
    text-decoration: none;
    opacity: .85;
}
.cookie-manage-link:hover,
.cookie-manage-link:focus-visible { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.cookie-footer-separator { margin: 0 7px; opacity: .6; }

@media (max-width: 680px) {
    .cookie-consent { padding: 16px; }
    .cookie-consent__dialog { padding: 88px 18px 18px; border-radius: 20px; }
    .cookie-consent__dialog h2 { margin-top: 0; }
    .cookie-consent__text-break { display: none; }
    .cookie-consent__actions { grid-template-columns: 1fr; }
    .cookie-consent__button--manage { order: 1; }
    .cookie-consent__button--refuse { order: 2; }
    .cookie-consent__button--accept { order: 3; }
    .cookie-consent__icon { width: 104px; height: 104px; top: -16px; left: -18px; }
}
