/* Styles limités à la FAQ et à l'assistant : ne modifie pas le reste du site. */
.mw-faq {
    max-width: 58rem; 
    margin: 3rem auto; 
    padding: 0 1rem;
}

.mw-faq__eyebrow {
    font-weight: 700; color: var(--navy, #173266);
}

.mw-faq__intro {
    margin-bottom: 1.25rem;
}
.mw-faq__intro h2 {
    margin: .4rem 0 .8rem;
}

.mw-faq__item {
    border: 1px solid #b9d5db; 
    border-radius: .65rem;
    margin: .65rem 0;
    background: #fff;}

.mw-faq__item summary {
    font-weight: 650;
    cursor: pointer;
    padding: 1rem 1.2rem;}

.mw-faq__item summary:hover {
    background: #eff8fa;
}

.mw-faq__answer {
    padding: 0 1.2rem 1rem;
}
.mw-faq__answer p {
    margin: .6rem 0;
}

.mw-faq__answer a {
    color: var(--navy, #173266); text-underline-offset: .15em;
}

.mw-assistant {
    font-family: inherit; 
    font-size: .95rem; 
    color: #17343f; 
    position: fixed;
    right: max(1rem, env(safe-area-inset-right)); 
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 1000;
}

.mw-assistant * {
    box-sizing: border-box;
}

.mw-assistant__trigger, 
.mw-assistant__quote, 
.mw-assistant__lead button[type="submit"] {
    background: var(--navy, #173266);
    color: #fff; 
    border: 0; 
    border-radius: 2rem; 
    padding: .8rem 1rem; 
    font: inherit; 
    font-weight: 650; 
    cursor: pointer;
}

.mw-assistant__trigger {
    box-shadow: 0 4px 14px #0002;
    display: block;
    margin-left: auto;
    max-width: 100%;
    min-height: 44px;
}

.mw-assistant__trigger-short {
    display: none;
}

.mw-assistant__panel {
    width: min(25rem, calc(100vw - 2rem)); 
    max-height: min(78vh, 43rem); 
    max-height: min(78dvh, 43rem); 
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain; 
    margin-bottom: .7rem; 
    border: 1px solid #bad5df; 
    border-radius: .85rem; 
    background: #fff; 
    box-shadow: 0 6px 24px #0003;
}

.mw-assistant__panel[hidden], 
.mw-assistant__lead[hidden],
.mw-assistant__ask[hidden],
.mw-assistant__choices[hidden],
.mw-assistant__quote[hidden] {
    display: none;
}

.mw-assistant__header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #eaf6fa; 
    padding: .9rem 1rem; 
    display: flex; 
    justify-content: 
    space-between; 
    gap: 1rem; 
    align-items: center;
}

.mw-assistant__header strong {
    display: block;
}

.mw-assistant__header small {
    display: block;
}

.mw-assistant__close {
    border: 0; 
    background: transparent; 
    font-size: 1.5rem; 
    padding: .2rem .5rem; 
    cursor: pointer;
}
.mw-assistant__history {
    padding: 1rem; 
    max-height: 12rem; 
    overflow-y: auto; 
    display: grid;
    gap: .65rem;
}

.mw-assistant__bubble {
    padding: .7rem .85rem; 
    border-radius: .8rem; 
    max-width: 95%; 
    white-space: pre-wrap; 
    overflow-wrap: anywhere; 
    background: #eef6f8;
}
.mw-assistant__bubble--user {
    justify-self: end; 
    background: #d9eee8;
}

.mw-assistant__choices {
    padding: .6rem 1rem; 
    display: flex; 
    flex-wrap: wrap; 
    gap: .45rem;
}

.mw-assistant__choices button {
    border: 1px solid #97bdc9; 
    background: #fff; 
    border-radius: 2rem; 
    padding: .4rem .65rem; 
    cursor: pointer; 
    color: inherit; 
    font: inherit;
}

.mw-assistant__ask, 
.mw-assistant__lead {
    padding: .6rem 1rem 1rem;
}

.mw-assistant label {
    display: block; 
    font-size: .88rem; font-weight: 650; margin: .6rem 0 .3rem;}
.mw-assistant input, 
.mw-assistant select, 
.mw-assistant textarea {
    font: inherit; 
    width: 100%; 
    min-width: 0; 
    border: 1px solid #7f9ca6; 
    border-radius: .35rem; 
    padding: .55rem; 
    background: #fff; 
    color: #17343f;
}

.mw-assistant__inline {
    display: flex; 
    gap: .4rem;
}

.mw-assistant__inline button {
    border: none; 
    border-radius: .35rem; 
    background: var(--navy, #173266); 
    color: #fff; 
    font: inherit; 
    padding: .55rem; 
    cursor: pointer;
}

.mw-assistant__hint, 
.mw-assistant__notice {
    font-size: .78rem; 
    line-height: 1.4; 
    color: #3d5963;
}

.mw-assistant__quote {
    display: block; 
    width: calc(100% - 2rem); 
    margin: .5rem 1rem 1rem;
}

.mw-assistant__lead h3 {
    font-size: 1.1rem;
    margin: .2rem 0;
}

.mw-assistant__lead button[type="submit"] {
    margin: .85rem 0;
    width: 100%;
}

.mw-assistant__cancel {
    background: none; 
    border: 0; 
    color: var(--navy, #173266); 
    text-decoration: underline; 
    padding: .3rem; 
    cursor: pointer; 
    font: inherit;
}

.mw-assistant__turnstile {
    min-height: 65px; 
    margin-top: .6rem;
}

.mw-assistant__result:not(:empty) {
    margin: .8rem 0 .2rem;
    padding: .7rem;
    line-height: 1.45;
    border-left: 3px solid var(--teal-dark, #087b75);
    background: #eef6f8;
    color: #17343f;
    overflow-wrap: anywhere;
}

.mw-assistant input[aria-invalid="true"],
.mw-assistant select[aria-invalid="true"],
.mw-assistant textarea[aria-invalid="true"] {
    border: 2px solid #a82727;
}

.mw-assistant :focus-visible, 
.mw-faq :focus-visible {
    outline: 3px solid var(--teal-dark, #087b75); 
    outline-offset: 3px;
}

/* Sur téléphone, le déclencheur n'occupe qu'une petite zone en bas à droite. */
@media (max-width: 480px) {
    .mw-assistant {
        left: max(.5rem, env(safe-area-inset-left));
        right: max(.5rem, env(safe-area-inset-right));
        bottom: max(.5rem, env(safe-area-inset-bottom));
        pointer-events: none;
    }

    .mw-assistant__trigger,
    .mw-assistant__panel {
        pointer-events: auto;
    }

    .mw-assistant__trigger {
        width: max-content;
        padding: .6rem .85rem;
        font-size: .9rem;
        line-height: 1.25;
        text-align: center;
        white-space: normal;
    }

    .mw-assistant__trigger-full {
        display: none;
    }

    .mw-assistant__trigger-short {
        display: inline;
    }

    .mw-assistant--open .mw-assistant__trigger {
        display: none;
    }

    .mw-assistant__panel {
        width: 100%;
        max-width: 100%;
        height: min(85vh, 38rem);
        height: min(85dvh, 38rem);
        max-height: calc(100vh - 1.5rem);
        max-height: calc(100dvh - 1.5rem);
        margin-bottom: 0;
    }

    .mw-assistant__inline {
        flex-wrap: wrap;
    }

    .mw-assistant__inline input {
        flex: 1 1 11rem;
    }
}

@media (max-width: 380px) {
    .mw-assistant__turnstile {
        min-height: 140px; /* Mode compact du widget Turnstile */
    }
}

@media (max-width: 480px) and (max-height: 460px) {
    .mw-assistant__panel {
        height: calc(100vh - 1rem);
        height: calc(100dvh - 1rem);
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mw-assistant *, 
    .mw-faq * {
        scroll-behavior: auto;
    }
}
