/*
 * Banniere et modale de consentement aux cookies (CNIL / RGPD).
 *
 * Ce fichier etait fondu dans app_common.css, qui n'est charge que par
 * l'entrypoint `app`, donc uniquement par les pages qui etendent
 * base.html.twig. Le profil public et le widget embarque sont des documents
 * autonomes : ils n'avaient ni la banniere ni sa mise en forme, alors que ce
 * sont precisement les deux pages ou la mesure d'audience a lieu.
 *
 * Il est desormais importe par `app` ET par `consent`, l'entrypoint minimal des
 * pages autonomes (cf. assets/consent.js).
 *
 * Chaque jeton de theme employe ici porte une valeur de repli en second
 * argument. Le profil public ne charge pas tokens.css : sans repli, la couleur
 * vaudrait « rien » et le texte du bandeau deviendrait illisible, voire
 * invisible. Un test verrouille la regle
 * (tests/Unit/Template/ConsentBannerCoverageTest.php).
 */
.ez-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    background: #ffffff;
    color: #1a1a1a;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.12);
    padding: 16px 20px;
    font-size: 14px;
    line-height: 1.5;
}
body.dark-mode .ez-cookie-banner {
    background: #1f2333;
    color: #e7e9f1;
    border-top-color: rgba(255, 255, 255, 0.08);
}
.ez-cookie-banner__inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    align-items: center;
    justify-content: space-between;
}
.ez-cookie-banner__text { flex: 1 1 320px; min-width: 280px; }
.ez-cookie-banner__text strong { display: block; margin-bottom: 4px; font-size: 15px; }
.ez-cookie-banner__text p { margin: 0; color: var(--text-secondary, #6b7280); }
/* Le bandeau est blanc en theme clair et sombre en dark-mode : la couleur du
   lien suit, sinon le contraste tombe sous le seuil AA dans un des deux cas. */
.ez-cookie-banner__text a { color: var(--primary-accessible, #4c5fd0); text-decoration: underline; }
body.dark-mode .ez-cookie-banner__text p { color: #cbd0e0; }
body.dark-mode .ez-cookie-banner__text a { color: var(--primary-lighter, #b5bff5); }
.ez-cookie-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ez-btn {
    appearance: none;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    padding: 9px 16px;
    border-radius: 10px;
    transition: background-color .15s ease, transform .05s ease;
}
.ez-btn:active { transform: translateY(1px); }
.ez-btn-primary { background: var(--primary-surface, #5b21af); color: #fff; }
.ez-btn-primary:hover { background: #5567d6; }
.ez-btn-secondary { background: #e7e9f5; color: #2b2f44; }
body.dark-mode .ez-btn-secondary { background: #2c3146; color: #e7e9f1; }
.ez-btn-ghost { background: transparent; color: inherit; border-color: rgba(0,0,0,0.15); }
body.dark-mode .ez-btn-ghost { border-color: rgba(255,255,255,0.2); }

/* Modale de personnalisation */
.ez-cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.ez-cookie-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}
.ez-cookie-modal__dialog {
    position: relative;
    background: #ffffff;
    color: #1a1a1a;
    border-radius: 16px;
    max-width: 560px;
    width: 100%;
    padding: 24px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
body.dark-mode .ez-cookie-modal__dialog { background: #1f2333; color: #e7e9f1; }
.ez-cookie-modal__dialog h2 { margin-top: 0; font-size: 20px; }
.ez-cookie-modal__intro { color: inherit; opacity: 0.8; margin-bottom: 16px; }
.ez-cookie-category {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
body.dark-mode .ez-cookie-category { border-color: rgba(255, 255, 255, 0.1); }
.ez-cookie-category__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ez-cookie-category__title { font-weight: 600; }
.ez-cookie-category__desc { margin: 6px 0 0; font-size: 13px; opacity: 0.75; }
.ez-cookie-category__badge {
    font-size: 12px;
    background: #e7e9f5;
    color: #2b2f44;
    padding: 3px 8px;
    border-radius: 999px;
}
body.dark-mode .ez-cookie-category__badge { background: #2c3146; color: #e7e9f1; }
.ez-cookie-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
}
.ez-cookie-switch input { opacity: 0; width: 0; height: 0; }
.ez-cookie-switch__slider {
    position: absolute;
    inset: 0;
    background: #c8ccd9;
    border-radius: 999px;
    transition: background-color .15s ease;
}
.ez-cookie-switch__slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .15s ease;
}
.ez-cookie-switch input:checked + .ez-cookie-switch__slider { background: #667eea; }
.ez-cookie-switch input:checked + .ez-cookie-switch__slider::before { transform: translateX(18px); }
.ez-cookie-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}
@media (max-width: 600px) {
    .ez-cookie-banner__inner { flex-direction: column; align-items: stretch; }
    .ez-cookie-banner__actions { justify-content: stretch; }
    .ez-btn { flex: 1 1 0; }
}

