/* ============================================================
   Life'Scape — Bandeau de consentement aux cookies
   ============================================================
   Remplace Axeptio. Style « carte » posée en bas à gauche, dans la charte du
   site : titres Gelasio, texte Montserrat, boutons Work Sans, brun #483c3c et
   or #C19A59.
   ============================================================ */

.ls-consent,
.ls-consent * {
    box-sizing: border-box;
}

/* ---------- Carte principale ---------- */

.ls-consent {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 99999;

    width: 400px;
    max-width: calc(100vw - 32px);

    background: #fff;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(72, 60, 60, 0.28);
    overflow: hidden;

    font-family: 'Montserrat', sans-serif;
    color: #464646;

    /* État fermé par défaut : évite tout clignotement avant la décision du JS */
    opacity: 0;
    transform: translateY(24px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.ls-consent.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.ls-consent[hidden] {
    display: none;
}

/* ---------- Bandeau supérieur ---------- */

.ls-consent__head {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 18px 22px;
    background: #483c3c;
    color: #fff;
}

.ls-consent__emoji {
    font-size: 26px;
    line-height: 1;
    /* Petit balancement, clin d'œil au ton ludique d'un escape game */
    animation: ls-consent-tilt 3.2s ease-in-out infinite;
}

@keyframes ls-consent-tilt {
    0%, 100% { transform: rotate(-8deg); }
    50%      { transform: rotate(8deg); }
}

.ls-consent__title {
    margin: 0;
    font-family: 'Gelasio', serif;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

/* ---------- Corps ---------- */

.ls-consent__body {
    padding: 20px 22px 6px;
}

.ls-consent__text {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

.ls-consent__text a {
    color: #483c3c;
    text-decoration: underline;
}

/* ---------- Réglages détaillés (repliés) ---------- */

.ls-consent__details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.ls-consent__details.is-open {
    max-height: 420px;
    overflow-y: auto;
}

.ls-consent__option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #eee;
}

.ls-consent__option:last-child {
    border-bottom: 0;
}

.ls-consent__option-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #483c3c;
}

.ls-consent__option-desc {
    display: block;
    margin-top: 2px;
    font-size: 12.5px;
    line-height: 1.5;
    color: #666;
}

/* Interrupteur */

.ls-consent__switch {
    position: relative;
    flex: 0 0 auto;
    width: 44px;
    height: 24px;
    margin-top: 2px;
}

.ls-consent__switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.ls-consent__slider {
    position: absolute;
    inset: 0;
    background: #cfcfcf;
    border-radius: 999px;
    transition: background 0.25s ease;
    pointer-events: none;
}

.ls-consent__slider::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.ls-consent__switch input:checked + .ls-consent__slider {
    background: #C19A59;
}

.ls-consent__switch input:checked + .ls-consent__slider::before {
    transform: translateX(20px);
}

.ls-consent__switch input:focus-visible + .ls-consent__slider {
    outline: 2px solid #483c3c;
    outline-offset: 2px;
}

/* Le cookie strictement nécessaire ne se désactive pas. */
.ls-consent__switch input:disabled + .ls-consent__slider {
    background: #C19A59;
    opacity: 0.45;
}

.ls-consent__switch input:disabled {
    cursor: not-allowed;
}

/* ---------- Actions ---------- */

.ls-consent__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 22px 20px;
}

.ls-consent__btn {
    flex: 1 1 0;
    min-width: 120px;
    padding: 12px 18px;

    font-family: 'Work Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: center;

    border: 1px solid transparent;
    border-radius: 2rem;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.ls-consent__btn:hover {
    transform: translateY(-2px);
}

.ls-consent__btn--accept {
    background: #483c3c;
    color: #fff;
}

.ls-consent__btn--accept:hover {
    background: #2d2424;
}

.ls-consent__btn--refuse {
    background: transparent;
    color: #483c3c;
    border-color: #cfc7c7;
}

.ls-consent__btn--refuse:hover {
    background: #f3f0f0;
}

.ls-consent__link {
    display: block;
    width: 100%;
    padding: 0 22px 18px;

    background: none;
    border: 0;
    cursor: pointer;

    font-family: 'Montserrat', sans-serif;
    font-size: 12.5px;
    color: #666;
    text-align: center;
    text-decoration: underline;
}

.ls-consent__link:hover {
    color: #483c3c;
}

/* ---------- Pastille de réouverture ---------- */

.ls-consent-badge {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 99998;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;

    background: #483c3c;
    color: #fff;
    border: 0;
    border-radius: 50%;
    box-shadow: 0 8px 22px rgba(72, 60, 60, 0.3);
    cursor: pointer;

    font-size: 20px;
    line-height: 1;

    opacity: 0;
    transform: scale(0.7);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease, background 0.25s ease;
}

.ls-consent-badge.is-visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.ls-consent-badge:hover {
    background: #C19A59;
    transform: scale(1.08);
}

/* ---------- Mobile ---------- */

@media (max-width: 600px) {
    .ls-consent {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
    }

    .ls-consent__actions {
        flex-direction: column;
    }

    .ls-consent__btn {
        width: 100%;
    }

    .ls-consent-badge {
        left: 16px;
        bottom: 16px;
    }
}

/* ---------- Accessibilité ---------- */

@media (prefers-reduced-motion: reduce) {
    .ls-consent,
    .ls-consent-badge,
    .ls-consent__details,
    .ls-consent__slider::before {
        transition: none;
    }

    .ls-consent__emoji {
        animation: none;
    }
}
