/* =====================================================================
   CJT - Bandeau de consentement (LT6) : mesure d'audience et publicité.
   Feuille autonome (hors build Tailwind) chargée par views/layouts/main.php ;
   balisage dans components/consent_banner.php, logique dans js/cjt-consent.js.
   ===================================================================== */

.cjt-consent {
    position: fixed;
    z-index: 60; /* au-dessus de la barre de navigation mobile (z-40) */
    left: max(.75rem, env(safe-area-inset-left));
    right: max(.75rem, env(safe-area-inset-right));
    /* sur mobile, la barre de navigation du bas occupe ~3.5rem + la zone de sécurité */
    bottom: calc(4.25rem + env(safe-area-inset-bottom));
    max-width: 34rem;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1.25rem;
    box-shadow: 0 20px 40px -12px rgba(15, 23, 42, .35);
    padding: 1.1rem 1.1rem 1rem;
    color: #475569;
    font-size: .8125rem;
    line-height: 1.5;
    max-height: calc(100dvh - 6rem);
    overflow-y: auto;
}
.cjt-consent[hidden] { display: none; }

@media (min-width: 768px) {
    .cjt-consent {
        left: auto;
        right: 1.5rem;
        bottom: 1.5rem;
        margin: 0;
    }
}

.cjt-consent__title {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0 0 .4rem;
    font-size: .9375rem;
    font-weight: 800;
    color: #1e293b;
}
.cjt-consent__title i { color: #2563eb; }

.cjt-consent__text { margin: 0 0 .85rem; }
.cjt-consent__text a { color: #2563eb; font-weight: 600; text-decoration: underline; }

/* --- Choix détaillés ---------------------------------------------------- */
.cjt-consent__details { margin: 0 0 .85rem; display: grid; gap: .5rem; }
.cjt-consent__details[hidden] { display: none; }

.cjt-consent__purpose {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .65rem .75rem;
    border: 1px solid #e2e8f0;
    border-radius: .85rem;
    background: #f8fafc;
}
label.cjt-consent__purpose { cursor: pointer; }
.cjt-consent__purpose input {
    margin-top: .2rem;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    accent-color: #2563eb;
}
.cjt-consent__purpose strong { display: block; color: #1e293b; font-size: .8125rem; }
.cjt-consent__purpose span { display: block; font-size: .75rem; color: #64748b; }
.cjt-consent__purpose.is-fixed { background: #fff; }
.cjt-consent__purpose.is-fixed .cjt-consent__tag {
    display: inline-block;
    margin-top: .1rem;
    padding: .05rem .45rem;
    border-radius: 9999px;
    background: #e2e8f0;
    color: #475569;
    font-size: .6875rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* --- Boutons : « Tout refuser » et « Tout accepter » ont le même poids (recommandation CNIL) --- */
.cjt-consent__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.cjt-consent__btn {
    flex: 1 1 8rem;
    padding: .6rem .9rem;
    border-radius: .75rem;
    border: 1px solid #2563eb;
    background: #2563eb;
    color: #fff;
    font-size: .8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}
.cjt-consent__btn:hover { background: #1d4ed8; border-color: #1d4ed8; }
.cjt-consent__btn:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.cjt-consent__btn.is-link {
    flex: 1 1 100%;
    border-color: transparent;
    background: transparent;
    color: #475569;
    font-weight: 600;
    text-decoration: underline;
    padding: .25rem;
}
.cjt-consent__btn.is-link:hover { color: #1e293b; background: transparent; }
.cjt-consent__btn[hidden] { display: none; }

@media print {
    .cjt-consent { display: none !important; }
}
