/* Bandeau de consentement cookies (27/09/2026)
   Markup : app/Views/partials/cookie-consent.php — JS : cookie-consent.js */

:root {
    --cc-bg: #4d4d4d;
    --cc-ink: #fff;
    --cc-accent: #e905ed;          /* rose Uprinter (logo, bouton loupe) */
    --cc-accent-dark: #c304c6;
    --cc-radius: 26px;
}

/* ── Bandeau bas de page ─────────────────────────────────────────────── */
.cc-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1080;                 /* au-dessus du panneau de recherche (1060) */
    background: var(--cc-bg);
    color: var(--cc-ink);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, .25);
    max-height: 85vh;
    overflow-y: auto;
    animation: ccUp .25s ease-out;
}
.cc-banner[hidden] { display: none; }

.cc-banner__inner {
    max-width: 1920px;
    margin: 0 auto;
    padding: 40px 45px 36px;
}

.cc-banner__title {
    margin: 0 0 16px;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

.cc-banner__text p:not(.cc-banner__title) {
    margin: 0;
    font-size: 1rem;
    line-height: 1.55;
}

.cc-banner a { color: #ff9dff; text-decoration: none; }
.cc-banner a:hover { text-decoration: underline; }
.cc-banner a:focus-visible,
.cc-banner button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.cc-banner__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 16px 28px;
    margin-top: 16px;
    padding-right: 10%;
}

/* ── Boutons (bandeau + paramètres) ─────────────────────────────────── */
.cc-link {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-size: 1rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.cc-btn {
    min-width: 190px;
    padding: 14px 32px;
    border-radius: var(--cc-radius);
    border: 2px solid transparent;
    font: inherit;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}

.cc-btn--primary { background: var(--cc-accent); color: #fff; }
.cc-btn--primary:hover { background: var(--cc-accent-dark); }

/* « Tout refuser » aussi visible que « Tout accepter » : même taille, même
   niveau — c'est ce qu'attend la CNIL (refuser aussi simple qu'accepter). */
.cc-btn--ghost { background: transparent; color: inherit; border-color: currentColor; }
.cc-btn--ghost:hover { background: rgba(255, 255, 255, .12); }

/* ── Fenêtre « Gérer les paramètres » ──────────────────────────────── */
.cc-settings {
    width: min(640px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    padding: 0;
    border: 0;
    border-radius: 16px;
    color: #1a1a1a;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
}
.cc-settings::backdrop { background: rgba(20, 20, 20, .55); }
.cc-settings[open] { display: flex; animation: ccIn .18s ease-out; }

.cc-settings__form { display: flex; flex-direction: column; width: 100%; max-height: inherit; margin: 0; }

.cc-settings__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid #ecebef;
}
.cc-settings__title { margin: 0; font-size: 1.3rem; font-weight: 700; }

.cc-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #f3f2f5;
    color: #1a1a1a;
    cursor: pointer;
}
.cc-close:hover { background: #e6e4ea; }

.cc-settings__body { padding: 8px 24px 16px; overflow-y: auto; }
.cc-settings__intro { margin: 12px 0 8px; color: #555; font-size: .95rem; }

.cc-cat { padding: 16px 0; border-bottom: 1px solid #ecebef; }
.cc-cat:last-child { border-bottom: 0; }
.cc-cat__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cc-cat__title { margin: 0; font-size: 1.05rem; font-weight: 700; }
.cc-cat__desc { margin: 6px 0 0; color: #555; font-size: .92rem; line-height: 1.5; }
.cc-always { color: #1f8a4c; font-size: .85rem; font-weight: 600; white-space: nowrap; }

/* Interrupteur */
.cc-switch { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.cc-switch input { position: absolute; inset: 0; z-index: 1; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cc-switch__ui {
    width: 46px;
    height: 26px;
    border-radius: 13px;
    background: #c9c7ce;
    position: relative;
    transition: background-color .15s;
}
.cc-switch__ui::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: transform .15s;
}
.cc-switch input:checked + .cc-switch__ui { background: var(--cc-accent); }
.cc-switch input:checked + .cc-switch__ui::after { transform: translateX(20px); }
.cc-switch input:focus-visible + .cc-switch__ui { outline: 2px solid var(--cc-accent); outline-offset: 2px; }

.cc-settings__foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #ecebef;
    background: #faf9fb;
    border-radius: 0 0 16px 16px;
}
.cc-settings__foot .cc-btn { min-width: 0; padding: 11px 20px; font-size: .95rem; }
.cc-settings__foot .cc-btn--ghost { color: #1a1a1a; border-color: #c9c7ce; }
.cc-settings__foot .cc-btn--ghost:hover { background: #f0eef3; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .cc-banner__actions { padding-right: 0; }
}

@media (max-width: 767.98px) {
    .cc-banner__inner { padding: 22px 18px 20px; }
    .cc-banner__title { font-size: 1.25rem; margin-bottom: 10px; }
    .cc-banner__text p:not(.cc-banner__title) { font-size: .88rem; }
    .cc-banner__actions { flex-direction: column-reverse; align-items: stretch; gap: 10px; }
    .cc-btn { width: 100%; min-width: 0; padding: 12px 20px; }
    .cc-link { align-self: center; padding: 6px 0; }
    .cc-settings__foot { flex-direction: column-reverse; }
    .cc-settings__foot .cc-btn { width: 100%; }
}

@keyframes ccUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes ccIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .cc-banner, .cc-settings[open] { animation: none; }
}
