/* ==========================================================================
   voicetocell · bandeau cookie (views/partials/cookie-banner.php)
   Carte sombre en bas à gauche, même verre que les panneaux de l'espace connecté.
   « Personnaliser » fait pivoter la carte (assets/js/cookie-banner.js).
   ========================================================================== */

.cookie-banner {
    position: fixed;
    bottom: calc(16px + env(safe-area-inset-bottom));
    left: calc(16px + env(safe-area-inset-left));
    z-index: 90;
    width: min(22rem, calc(100vw - 2rem));
    perspective: 1000px;
    animation: cookie-in .5s var(--ease-out) both;
}

/* Espace connecté sur mobile : au-dessus de la barre d'onglets */
@media (max-width: 900px) {
    .app-page .cookie-banner { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

.cookie-banner__card {
    transform-style: preserve-3d;
    transition: transform .18s ease-in;
}

.cookie-banner__card.is-turning { transform: rotateY(90deg); }

.cookie-banner__face {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line-2);
    border-radius: 20px;
    background: linear-gradient(180deg, rgb(255 255 255 / .03), transparent 45%), rgb(12 12 24 / .94);
    box-shadow: 0 24px 60px -20px rgb(0 0 0 / .8), 0 0 40px -18px var(--glow);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.cookie-banner__face[hidden] { display: none; }

.cookie-banner__eyebrow { font-size: 10px; }

.cookie-banner__text { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.cookie-banner__text a { color: var(--lilac); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.cookie-banner__text a:hover { color: var(--text); }

.cookie-banner__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cookie-banner__actions--split { align-items: center; justify-content: space-between; }

/* Boutons : même pilule que .btn--small, sans le libellé qui roule (place comptée) */
.cookie-banner__btn {
    flex: 1 1 auto;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: rgb(8 8 20 / .75);
    color: var(--text-2);
    font: 650 10px/1 var(--sans);
    font-stretch: 87.5%;
    letter-spacing: .1em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: color .25s, border-color .25s, background .25s, transform .15s var(--ease-out);
}

.cookie-banner__btn:hover { border-color: var(--text); background: var(--text); color: var(--void); }
.cookie-banner__btn:active { transform: scale(.97); }

.cookie-banner__btn--primary { border-color: var(--text); background: var(--text); color: var(--void); }
.cookie-banner__btn--primary:hover { border-color: var(--lilac); background: linear-gradient(100deg, #b7c4ff, var(--lilac)); }

.cookie-banner__actions--split .cookie-banner__btn { flex: 0 0 auto; padding: 0 18px; }

.cookie-banner__back {
    padding: 6px 0;
    border: 0;
    background: none;
    color: var(--text-3);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: color .25s;
}
.cookie-banner__back:hover { color: var(--text); }

.cookie-banner__rows { display: grid; gap: 12px; }
.cookie-banner__row { display: flex; align-items: center; gap: 12px; }
.cookie-banner__row-text { min-width: 0; }
.cookie-banner__row-title { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.cookie-banner__row-detail { display: block; font-size: 12px; line-height: 1.45; color: var(--text-3); }

/* Interrupteur : même rendu que .switch__track du socle */
.cookie-banner__switch {
    position: relative;
    flex: none;
    width: 42px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--line-2);
    cursor: pointer;
    transition: background .3s, box-shadow .3s;
}

.cookie-banner__switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-2);
    transition: transform .45s var(--ease-spring), background .3s;
}

.cookie-banner__switch[aria-checked='true'] { background: linear-gradient(135deg, var(--blue), var(--violet)); box-shadow: 0 0 14px -4px var(--glow); }
.cookie-banner__switch[aria-checked='true']::after { background: #fff; transform: translateX(18px); }
.cookie-banner__switch:disabled { cursor: not-allowed; opacity: .55; }
.cookie-banner__switch:focus-visible { outline: 2px solid var(--lilac); outline-offset: 3px; }

@keyframes cookie-in {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}

/* Lien « Gérer les cookies » rendu comme un lien dans les pieds de page */
.cookie-settings-link {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    text-decoration: inherit;
    cursor: pointer;
}

.site-footer__nav .cookie-settings-link { color: var(--text-2); font-size: 14px; transition: color .25s; }
.site-footer__nav .cookie-settings-link:hover { color: var(--text); }
.auth__foot .cookie-settings-link { text-decoration: underline; text-underline-offset: 3px; }
.auth__foot .cookie-settings-link:hover { color: var(--text-2); }

@media (prefers-reduced-motion: reduce) {
    .cookie-banner,
    .cookie-banner__card,
    .cookie-banner__card.is-turning { transform: none; transition: none; animation: none; }
}

.legal__body .cookie-settings-link { color: var(--lilac); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.legal__body .cookie-settings-link:hover { color: var(--text); }
