/* AI-Bambino (copie de test) — assistant de discussion IA : bouton flottant et panneau.
   Couleurs et polices de Bambino (variables de main.css). Aucune ressource externe. */
.chat-bouton { position: fixed; right: 16px; bottom: 16px; z-index: 250; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 18px 10px 14px; border: 2px solid #fff; border-radius: 999px; background: #d83229; color: #fff; font: 600 .95rem/1.1 var(--sans); box-shadow: 0 8px 24px rgba(0, 38, 28, .28); cursor: pointer; } /* rouge des boutons du site (contraste 4,8:1 avec le blanc) */
.chat-bouton:hover { background: #c42a23; }
.chat-bouton:focus-visible { outline: 3px solid var(--vert); outline-offset: 3px; }
.chat-bouton svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chat-bouton[hidden] { display: none; }
@media (max-width: 560px) {
  .chat-bouton { padding: 12px; min-width: 52px; min-height: 52px; justify-content: center; }
  .chat-bouton__txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

.chat { position: fixed; right: 16px; bottom: 16px; z-index: 300; display: flex; flex-direction: column; width: min(400px, calc(100vw - 32px)); height: min(620px, calc(100vh - 32px)); height: min(620px, calc(100dvh - 32px)); background: #fff; color: var(--texte); border: 2px solid var(--vert); border-radius: 18px; box-shadow: 0 18px 50px rgba(0, 38, 28, .35); overflow: hidden; font: 400 1rem/1.5 var(--sans); }
.chat[hidden] { display: none; }
.chat-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 18px; background: var(--vert); color: #fff; }
.chat-tete h2 { margin: 0; font: 400 1rem/1.2 var(--display); letter-spacing: .02em; color: #fff; }
.chat-fermer { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; }
.chat-fermer:hover { background: rgba(255, 255, 255, .14); }
.chat-fermer:focus-visible { outline: 3px solid var(--rose); outline-offset: 1px; }
.chat-fermer svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.chat-avert { margin: 0; padding: 8px 18px; background: var(--rose-pale); color: var(--texte-2); font-size: .82rem; line-height: 1.4; border-bottom: 1px solid var(--rose); }
.chat-avert a { color: var(--vert); font-weight: 600; text-decoration: underline; }
.chat-fil { flex: 1; overflow-y: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.chat-m { margin: 0; max-width: 88%; padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .95rem; }
.chat-m a { color: inherit; font-weight: 600; text-decoration: underline; }
.chat-m.ia { align-self: flex-start; background: var(--menthe); color: var(--vert-nuit); border-bottom-left-radius: 4px; }
.chat-m.moi { align-self: flex-end; background: var(--vert); color: #fff; border-bottom-right-radius: 4px; }
.chat-m.note { background: var(--rose-pale); color: var(--texte-2); }
.chat-m.attente { color: var(--texte-2); font-style: italic; }
/* 1.0.3 : récapitulatif d'une demande, à confirmer par le visiteur */
.chat-recap { align-self: stretch; margin: 0; padding: 12px 14px; border: 2px solid var(--vert); border-radius: 14px; background: #fff; color: var(--texte); font-size: .9rem; }
.chat-recap__titre { margin: 0 0 6px; font-weight: 700; color: var(--vert-nuit); }
.chat-recap dl { margin: 0; display: grid; gap: 4px; }
.chat-recap dl div { display: grid; grid-template-columns: minmax(80px, 34%) 1fr; gap: 8px; }
.chat-recap dt { font-weight: 600; color: var(--texte-2); }
.chat-recap dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.chat-recap__avis { margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; background: #fff3d4; color: var(--texte); font-weight: 600; }
.chat-recap__boutons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chat-recap__boutons button { min-height: 44px; padding: 10px 16px; border-radius: 999px; border: 2px solid var(--vert); font: 600 .9rem/1 var(--sans); cursor: pointer; }
.chat-recap__oui { background: var(--vert); color: #fff; }
.chat-recap__oui:hover { background: var(--vert-nuit); }
.chat-recap__modif { background: #fff; color: var(--vert); }
.chat-recap__boutons button:disabled { opacity: .5; cursor: default; }
.chat-recap__boutons button:focus-visible { outline: 3px solid var(--rouge); outline-offset: 2px; }
.chat-saisie { display: flex; align-items: flex-end; gap: 8px; margin: 0; padding: 10px 12px 12px; border-top: 1px solid rgba(0, 77, 56, .15); }
/* 16 px : Safari sur iPhone ne zoome pas au toucher du champ */
.chat-saisie textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 140px; padding: 10px 12px; border: 1.5px solid rgba(0, 77, 56, .35); border-radius: 12px; font: 400 16px/1.4 var(--sans); color: var(--texte); background: #fff; resize: none; }
.chat-saisie textarea:focus { outline: none; border-color: var(--vert); box-shadow: 0 0 0 3px rgba(0, 77, 56, .18); }
.chat-envoyer { flex: none; min-height: 44px; padding: 10px 16px; border: 2px solid var(--vert); border-radius: 999px; background: var(--vert); color: #fff; font: 600 .9rem/1 var(--sans); cursor: pointer; }
.chat-envoyer:hover { background: var(--vert-nuit); }
.chat-envoyer:disabled { opacity: .5; cursor: default; }
.chat-envoyer:focus-visible { outline: 3px solid var(--rouge); outline-offset: 2px; }
.chat .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 480px) {
  .chat { right: 0; bottom: 0; width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; border: 0; }
}
@media print { .chat-bouton, .chat { display: none !important; } }
