/* Bulle de discussion Sauron IA (js/sauron-ia.js). Sous le bandeau cookies (z-index 1000)
   pour ne jamais cacher ses boutons. */
#sauron-ia {
    font-family: var(--police-principale);
}

.sauron-lanceur {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 999;
    width: 68px;
    height: 68px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 45%, #4a1204 0%, #1c0602 70%, #0d0301 100%);
    box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.55), 0 10px 28px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: sauron-entree 0.6s cubic-bezier(.34, 1.56, .64, 1) backwards;
}

.sauron-lanceur:hover,
.sauron-lanceur:focus-visible {
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.8), 0 14px 36px rgba(0, 0, 0, 0.45);
    outline: none;
}

.sauron-lanceur[hidden],
.sauron-panneau[hidden] {
    display: none;
}

.sauron-oeil-lanceur {
    width: 54px;
    height: 54px;
    overflow: visible;
}

.sauron-pastille {
    position: absolute;
    top: -3px;
    left: -3px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--couleur-accent);
    color: #1c0602;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.sauron-pupille {
    transition: transform 0.25s ease-out;
}

.sauron-halo {
    transform-origin: 32px 32px;
    animation: sauron-flamme 2.4s ease-in-out infinite;
}

.sauron-panneau {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 999;
    width: min(390px, calc(100vw - 32px));
    height: min(580px, calc(100vh - 100px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--couleur-blanc);
    color: var(--couleur-texte);
    border-radius: 16px;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.32);
}

.sauron-tete {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #1c0602, #3d2212);
    color: #fff;
}

.sauron-oeil-tete {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    overflow: visible;
}

.sauron-titres {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.sauron-titres b {
    font-family: var(--police-titres);
    font-size: 17px;
}

.sauron-titres span {
    font-size: 12px;
    color: #e9b356;
}

.sauron-fermer {
    margin-left: auto;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #f7e3bb;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.sauron-fermer:hover {
    background: rgba(255, 255, 255, 0.12);
}

.sauron-fil {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--couleur-fond);
}

.sauron-bulle {
    max-width: 88%;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.sauron-bulle-oeil {
    align-self: flex-start;
    background: var(--couleur-blanc);
    border: 1px solid #eadfcb;
    border-bottom-left-radius: 4px;
}

.sauron-bulle-oeil a {
    color: var(--couleur-primaire);
    font-weight: 600;
}

.sauron-bulle-moi {
    align-self: flex-end;
    background: var(--couleur-primaire);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.sauron-bulle-erreur {
    background: #fbeae7;
    border-color: #f0c3ba;
    color: #a3301f;
}

.sauron-points {
    display: inline-flex;
    gap: 4px;
}

.sauron-points i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--couleur-accent);
    animation: sauron-point 1s infinite;
}

.sauron-points i:nth-child(2) { animation-delay: 0.15s; }
.sauron-points i:nth-child(3) { animation-delay: 0.3s; }

.sauron-faq {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 14px;
    background: var(--couleur-fond);
}

.sauron-faq:not(:empty) {
    padding-bottom: 10px;
}

.sauron-faq button {
    padding: 6px 11px;
    border: 1px solid var(--couleur-primaire);
    border-radius: 999px;
    background: var(--couleur-blanc);
    color: var(--couleur-primaire-fonce);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}

.sauron-faq button:hover {
    background: var(--couleur-primaire-clair);
}

.sauron-saisie {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #eadfcb;
}

.sauron-saisie input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #d8c7a8;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
}

.sauron-saisie input:focus {
    outline: none;
    border-color: var(--couleur-accent);
    box-shadow: 0 0 0 3px var(--couleur-accent-clair);
}

.sauron-saisie button {
    width: 44px;
    flex-shrink: 0;
    border: none;
    border-radius: 10px;
    background: var(--couleur-primaire);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

.sauron-saisie button:disabled {
    opacity: 0.5;
    cursor: wait;
}

.sauron-mention {
    margin: 0;
    padding: 0 12px 10px;
    font-size: 11px;
    line-height: 1.4;
    color: #8a7a63;
}

.sauron-mention a {
    color: inherit;
}

@keyframes sauron-entree {
    from { opacity: 0; transform: translateY(16px) scale(0.6); }
    to { opacity: 1; transform: none; }
}

@keyframes sauron-flamme {
    0%, 100% { opacity: 0.75; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

@keyframes sauron-point {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

@media (max-width: 600px) {
    .sauron-lanceur {
        right: 16px;
        bottom: 16px;
        width: 60px;
        height: 60px;
    }

    .sauron-oeil-lanceur {
        width: 48px;
        height: 48px;
    }

    .sauron-panneau {
        right: 8px;
        bottom: 8px;
        width: calc(100vw - 16px);
        height: calc(100vh - 80px);
        height: calc(100dvh - 80px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .sauron-lanceur,
    .sauron-halo,
    .sauron-points i {
        animation: none;
    }

    .sauron-pupille,
    .sauron-lanceur {
        transition: none;
    }
}
