/* Assistant IA 2HDTech — styles autonomes (le Tailwind du thème est purgé). Palette du thème. */
:root {
  --hdc-primary: #0A1628; --hdc-primary-500: #1B2D4F; --hdc-accent: #2E7BF6; --hdc-accent-dark: #1A5CD4;
  --hdc-cream: #F5F5F0; --hdc-cream-dark: #E8E8E3; --hdc-text: #0A1628; --hdc-muted: #6b7280;
  --hdc-ok: #22c55e; --hdc-warn: #f59e0b; --hdc-err: #ef4444;
  --hdc-font-display: "Plus Jakarta Sans", system-ui, sans-serif; --hdc-font-body: "DM Sans", system-ui, sans-serif;
}
#chatbot-popup.chatbot-popup--assistant { width: 380px; max-width: calc(100vw - 2rem); height: 560px; max-height: calc(100vh - 7rem); padding: 0; overflow: hidden; display: flex; flex-direction: column; }
#chatbot-popup.chatbot-popup--assistant.hidden { display: none; }
@media (max-width: 480px) {
  #chatbot-popup.chatbot-popup--assistant { position: fixed; inset: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; border-radius: 0; }
  /* Plein écran : le bouton flottant recouvrirait le champ de saisie → on le masque, le X de l'en-tête ferme le chat. */
  #chatbot-widget.chatbot-widget--open #chatbot-toggle { display: none; }
}
.hdtech-chat { display: flex; flex-direction: column; height: 100%; font-family: var(--hdc-font-body); color: var(--hdc-text); background: #fff; }
.hdtech-chat__header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--hdc-primary); color: #fff; }
.hdtech-chat__avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--hdc-accent); display: grid; place-items: center; flex-shrink: 0; }
.hdtech-chat__avatar svg { width: 20px; height: 20px; }
.hdtech-chat__title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.hdtech-chat__title strong { font-family: var(--hdc-font-display); font-size: 15px; }
.hdtech-chat__status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; opacity: .85; }
.hdtech-chat__status i { width: 8px; height: 8px; border-radius: 50%; background: var(--hdc-ok); display: inline-block; }
.hdtech-chat__status[data-state="escalated"] i { background: var(--hdc-warn); animation: hdc-pulse 1.2s ease-in-out infinite; }
.hdtech-chat__status[data-state="human"] i { background: var(--hdc-warn); }
.hdtech-chat__status[data-state="closed"] i { background: var(--hdc-muted); }
.hdtech-chat__iconbtn { background: transparent; border: 0; color: #fff; opacity: .75; cursor: pointer; padding: 6px; border-radius: 8px; }
.hdtech-chat__iconbtn:hover { opacity: 1; background: rgba(255,255,255,.1); }
.hdtech-chat__iconbtn svg { width: 18px; height: 18px; }
.hdtech-chat__close { margin-left: 2px; }
.hdtech-chat__log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #fff; scroll-behavior: smooth; }
.hdtech-msg { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.45; word-wrap: break-word; white-space: pre-wrap; position: relative; animation: hdc-in .2s ease-out; }
.hdtech-msg--assistant { align-self: flex-start; background: var(--hdc-cream); color: var(--hdc-text); border-bottom-left-radius: 6px; }
.hdtech-msg--user { align-self: flex-end; background: var(--hdc-accent); color: #fff; border-bottom-right-radius: 6px; }
.hdtech-msg--admin { align-self: flex-start; background: var(--hdc-primary-500); color: #fff; border-bottom-left-radius: 6px; }
.hdtech-msg--admin::before { content: "Conseiller"; display: block; font-size: 11px; opacity: .7; margin-bottom: 2px; font-weight: 600; letter-spacing: .02em; }
.hdtech-msg--system { align-self: center; background: transparent; color: var(--hdc-muted); font-size: 12px; font-style: italic; text-align: center; max-width: 95%; padding: 4px 8px; }
.hdtech-msg--error { align-self: center; background: #fef2f2; color: #991b1b; font-size: 13px; text-align: center; }
.hdtech-msg--error button { margin-left: 8px; background: transparent; border: 1px solid currentColor; color: inherit; border-radius: 6px; padding: 2px 8px; cursor: pointer; font-size: 12px; }
.hdtech-msg a { color: inherit; text-decoration: underline; }
.hdtech-msg time { position: absolute; bottom: -16px; right: 8px; font-size: 10px; color: var(--hdc-muted); opacity: 0; transition: opacity .15s; }
.hdtech-msg:hover time { opacity: 1; }
.hdtech-typing { align-self: flex-start; background: var(--hdc-cream); border-radius: 16px; padding: 12px 16px; display: inline-flex; gap: 4px; }
.hdtech-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--hdc-muted); animation: hdc-bounce 1s infinite; }
.hdtech-typing span:nth-child(2) { animation-delay: .15s; } .hdtech-typing span:nth-child(3) { animation-delay: .3s; }
.hdtech-chat__suggestions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 8px; }
.hdtech-chat__suggestions:empty { display: none; }
.hdtech-chip { border: 1px solid var(--hdc-accent); color: var(--hdc-accent); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; font-family: inherit; transition: background .15s, color .15s; }
.hdtech-chip:hover { background: var(--hdc-accent); color: #fff; }
.hdtech-chat__form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--hdc-cream-dark); background: #fff; }
.hdtech-chat__input { flex: 1; resize: none; border: 1px solid var(--hdc-cream-dark); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 14px; line-height: 1.4; max-height: 120px; background: var(--hdc-cream); color: var(--hdc-text); outline: none; }
.hdtech-chat__input:focus { border-color: var(--hdc-accent); box-shadow: 0 0 0 2px rgba(46,123,246,.2); }
.hdtech-chat__input:disabled { opacity: .6; }
.hdtech-chat__send { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--hdc-accent); color: #fff; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; transition: background .15s, transform .15s; }
.hdtech-chat__send:hover { background: var(--hdc-accent-dark); transform: translateY(-1px); }
.hdtech-chat__send:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.hdtech-chat__send svg { width: 18px; height: 18px; }
.hdtech-chat__footnote { margin: 0; padding: 0 12px 8px; font-size: 10px; color: var(--hdc-muted); text-align: center; }
.hdtech-chat__footnote span { margin-right: 6px; color: var(--hdc-warn); }
#chatbot-toggle .hdtech-badge { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--hdc-err); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
@keyframes hdc-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes hdc-bounce { 0%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-5px); } }
@keyframes hdc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
