/* Widget du chatbot — chargé uniquement lorsque l'assistant est activé. */
.chatbot { position: fixed; bottom: 1.25rem; z-index: 60; font-size: 1rem; }
.chatbot-right { right: 1.25rem; }
.chatbot-left { left: 1.25rem; }

.chatbot-toggle {
    display: grid; place-items: center; width: 3.6rem; height: 3.6rem; border: 0; border-radius: 50%; cursor: pointer;
    background: var(--gold); color: #fff; box-shadow: 0 10px 28px rgba(42, 42, 40, .35); transition: transform .2s, background .2s;
}
.chatbot-toggle:hover { background: var(--gold-light); transform: scale(1.06); }
.chatbot-toggle-icon { width: 1.7rem; height: 1.7rem; }
.chatbot.is-open .chatbot-toggle { display: none; }

.chatbot-panel {
    position: absolute; bottom: 0; width: min(390px, calc(100vw - 2rem)); height: min(580px, calc(100vh - 2.5rem));
    display: flex; flex-direction: column; background: #fff; box-shadow: 0 24px 60px rgba(42, 42, 40, .35);
    border-top: 4px solid var(--gold); overflow: hidden;
}
.chatbot-panel[hidden] { display: none; }
.chatbot-right .chatbot-panel { right: 0; }
.chatbot-left .chatbot-panel { left: 0; }

.chatbot-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 1rem; background: var(--anthracite); color: #fff; }
.chatbot-title { font-weight: 800; letter-spacing: .02em; }
.chatbot-actions { display: flex; gap: .25rem; }
.chatbot-actions button { display: grid; place-items: center; width: 2rem; height: 2rem; border: 0; background: transparent; color: #e6e2d4; cursor: pointer; border-radius: 4px; }
.chatbot-actions button:hover { background: rgba(255, 255, 255, .12); color: var(--gold-light); }
.chatbot-actions svg { width: 1.2rem; height: 1.2rem; }

.chatbot-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .65rem; background: #fff; }
.chatbot-msg { max-width: 86%; padding: .65rem .85rem; font-size: .95rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.chatbot-msg-assistant { align-self: flex-start; background: #fff; border-left: 3px solid var(--gold); box-shadow: 0 1px 2px rgba(42, 42, 40, .08); }
.chatbot-msg-user { align-self: flex-end; background: var(--anthracite); color: #fff; }
.chatbot-msg a { color: var(--gold); font-weight: 700; }
.chatbot-msg.is-typing { color: var(--grey); font-style: italic; animation: chatbot-pulse 1.2s ease-in-out infinite; }
@keyframes chatbot-pulse { 50% { opacity: .45; } }

.chatbot-suggestions { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1rem; background: #fff; }
.chatbot-suggestions:not(:empty) { padding-bottom: .75rem; }
.chatbot-suggestions button { font: inherit; font-size: .82rem; font-weight: 600; padding: .45rem .75rem; border: 1px solid var(--gold); background: #fff; color: var(--anthracite); cursor: pointer; text-align: left; }
.chatbot-suggestions button:hover { background: var(--gold); color: #fff; }

.chatbot-form { display: flex; align-items: flex-end; gap: .5rem; padding: .75rem 1rem; border-top: 1px solid #e4e0d3; background: #fff; }
.chatbot-form textarea { flex: 1; resize: none; font: inherit; font-size: .95rem; padding: .6rem .75rem; border: 1px solid #cfcbbd; max-height: 120px; }
.chatbot-form textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.chatbot-send { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border: 0; background: var(--gold); color: #fff; cursor: pointer; flex: none; }
.chatbot-send:hover { background: var(--gold-light); }
.chatbot-send svg { width: 1.2rem; height: 1.2rem; }
.chatbot-disclaimer { padding: 0 1rem .7rem; font-size: .72rem; color: var(--grey); background: #fff; }

@media (max-width: 640px) {
    .chatbot { bottom: .75rem; }
    .chatbot-right { right: .75rem; }
    .chatbot-left { left: .75rem; }
    .chatbot.is-open { top: 0; right: 0; bottom: 0; left: 0; inset: 0; }
    .chatbot.is-open .chatbot-panel { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; width: 100%; height: 100%; border-top-width: 0; }
}
@media print { .chatbot { display: none; } }
