/* =========================================================
   L'assistant du site (js/assistant.js, 23.10.2026)
   - .agent : la petite pastille en bas à droite et sa fenêtre (toutes les pages)
   On n'anime que transform et opacity. Sans JavaScript : rien n'est affiché.
   ========================================================= */
.no-js .chat { display: none; }
.agent-svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.agent-ancres { display: none; }

/* (10.11.2026 : la grande barre « Que cherchez-vous ? » a quitté le 1er écran, pour 2 points d'attention seulement ;
   la pastille apparaît dès le premier scroll) */

/* ---------- 2. La pastille (toutes les pages) ---------- */
.agent { position: fixed; right: 1rem; bottom: 1rem; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: .7rem; }
.agent-bouton {
  display: flex; align-items: center; gap: .6rem; height: 3.1rem; padding: 0 1.15rem 0 .45rem; cursor: pointer;
  border-radius: 999px; font: inherit; font-size: .92rem; font-weight: 500; color: var(--blanc);
  background: rgba(10,24,38,.94); border: 1px solid rgba(217,164,65,.45);
  box-shadow: 0 16px 32px -14px rgba(8,18,28,.65);
  transition: transform .3s ease, border-color .3s ease;
}
.agent-bouton-icone {
  display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: var(--dore); color: var(--lac-profond); font-size: 1rem;
}
@media (hover: hover) { .agent-bouton:hover { transform: translateY(-3px); border-color: var(--dore); } }
.agent-ouvert .agent-bouton { border-color: var(--dore); }
/* Téléphone : la pastille seule, ronde et discrète */
@media (max-width: 47.99em) {
  .agent-bouton { width: 3.1rem; padding: 0; justify-content: center; }
  .agent-bouton-texte { display: none; }
}
/* Pendant le 1er écran, la pastille se fait discrète (js/intro.js) : la carte « Assistant du site » occupe ce coin ;
   mais si l'assistant est ouvert (carte ou raccourci « / »), sa fenêtre reste visible.
   Visible TOUT DE SUITE (pas de transition de visibilité) : sinon le champ est encore « invisible » au moment
   de recevoir le curseur et le navigateur refuse de l'y mettre (13.11.2026) */
/* (pareil pendant le film des Services sur téléphone : .chat-svc, 17.11.2026) */
.agent.chat-discret.agent-ouvert, .agent.chat-svc.agent-ouvert { opacity: 1; visibility: visible; transform: none; transition: opacity .3s ease, transform .3s ease; }
.agent.chat-discret.agent-ouvert .agent-bouton, .agent.chat-svc.agent-ouvert .agent-bouton { visibility: hidden; }

/* ---------- 3. La fenêtre ---------- */
.agent-panneau {
  width: min(24rem, calc(100vw - 2rem)); height: min(34rem, calc(100vh - 7rem)); height: min(34rem, calc(100dvh - 7rem));
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 1.25rem; background: var(--blanc); color: var(--encre);
  border: 1px solid rgba(14,34,51,.1); box-shadow: 0 30px 70px -24px rgba(8,18,28,.55);
  transform-origin: 100% 100%; animation: agent-ouvre .28s cubic-bezier(.2,.8,.2,1) both;
}
.agent-panneau[hidden] { display: none; }
@keyframes agent-ouvre { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.agent-entete {
  display: flex; align-items: center; gap: .75rem; padding: .85rem .8rem .85rem 1rem; color: var(--blanc);
  background: radial-gradient(18rem 8rem at 100% 0%, rgba(217,164,65,.22), transparent 70%), linear-gradient(135deg, var(--lac), var(--lac-profond));
}
.agent-avatar { flex: none; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--dore); color: var(--lac-profond); font-size: 1.1rem; }
.agent-entete-texte { flex: 1; min-width: 0; }
.agent-titre { margin: 0; font-family: var(--police-titre); font-stretch: 108%; font-weight: 500; font-size: 1.05rem; line-height: 1.25; }
.agent-statut { display: flex; align-items: center; gap: .45rem; margin: .1rem 0 0; font-size: .8rem; color: rgba(246,244,239,.82); }
.agent-demo { padding: .08rem .5rem; border-radius: 999px; font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--lac-profond); background: var(--dore-clair); }
.agent-fermer { flex: none; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border: 0; border-radius: 50%; cursor: pointer; background: transparent; color: inherit; font-size: 1.15rem; }
@media (hover: hover) { .agent-fermer:hover { background: rgba(246,244,239,.12); } }

.agent-messages { flex: 1; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 1rem; display: flex; flex-direction: column; gap: .65rem; }
.agent-msg { max-width: 88%; padding: .7rem .9rem; border-radius: 1rem; font-size: .92rem; line-height: 1.5; animation: agent-ouvre .3s ease-out both; }
.agent-msg-bot { align-self: flex-start; background: #fff; border: 1px solid rgba(14,34,51,.09); border-bottom-left-radius: .35rem; box-shadow: 0 6px 16px -12px rgba(14,34,51,.35); }
.agent-msg-moi { align-self: flex-end; background: var(--lac-profond); color: var(--blanc); border-bottom-right-radius: .35rem; }
.agent-msg strong { color: var(--lac-profond); }
.agent-note { display: block; margin-top: .45rem; font-size: .76rem; color: var(--gris); }
/* « l'assistant écrit » : trois points */
.agent-ecrit { display: inline-flex; gap: .28rem; padding: .2rem 0; }
.agent-ecrit span { width: .42rem; height: .42rem; border-radius: 50%; background: var(--gris); animation: agent-point 1s ease-in-out infinite; }
.agent-ecrit span:nth-child(2) { animation-delay: .15s; }
.agent-ecrit span:nth-child(3) { animation-delay: .3s; }
@keyframes agent-point { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
/* destinations proposées */
.agent-choix { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.agent-choix-lien {
  padding: .38rem .75rem; border-radius: 999px; font-size: .82rem; font-weight: 500; text-decoration: none;
  color: var(--lac-profond); background: rgba(29,69,97,.06); border: 1px solid rgba(29,69,97,.18);
  transition: background-color .25s ease, border-color .25s ease;
}
@media (hover: hover) { .agent-choix-lien:hover { background: rgba(217,164,65,.14); border-color: var(--dore); } }
/* (19.11.2026) « Vous parlez de… ? » : de vrais boutons, même allure que les liens de destination */
button.agent-choix-lien { font: inherit; font-size: .82rem; font-weight: 500; cursor: pointer; }
button.agent-choix-lien:focus-visible { outline: 2px solid var(--dore); outline-offset: 2px; }
button.agent-choix-lien:disabled { cursor: default; opacity: .55; }
/* « Je vous emmène… » avec une jauge, puis le lien pour y aller tout de suite */
.agent-emmene { display: block; margin-top: .7rem; font-size: .82rem; color: var(--gris); }
.agent-jauge { display: block; height: 2px; margin-top: .4rem; border-radius: 2px; background: var(--dore); transform-origin: left center; animation: agent-jauge var(--duree, 1.3s) linear both; }
@keyframes agent-jauge { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.agent-lien {
  display: inline-flex; align-items: center; gap: .4rem; margin-top: .55rem; padding: .45rem .9rem; border-radius: 999px;
  font-size: .85rem; font-weight: 600; text-decoration: none; color: var(--lac-profond); background: var(--dore);
}
.agent-lien .agent-svg { transition: transform .25s ease; }
@media (hover: hover) { .agent-lien:hover .agent-svg { transform: translateX(3px); } }

/* questions rapides (défilent à l'horizontale) */
.agent-idees { display: flex; gap: .4rem; padding: .55rem 1rem; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; border-top: 1px solid rgba(14,34,51,.07); }
.agent-idees::-webkit-scrollbar { display: none; }
.agent-idees button {
  flex: none; padding: .35rem .75rem; border-radius: 999px; cursor: pointer; font: inherit; font-size: .8rem;
  color: #6b4c0f; background: #fff; border: 1px solid rgba(217,164,65,.6);
}
@media (hover: hover) { .agent-idees button:hover { background: rgba(217,164,65,.12); } }
.agent-saisie { display: flex; align-items: center; gap: .5rem; padding: .6rem .6rem .6rem 1rem; background: #fff; border-top: 1px solid rgba(14,34,51,.08); }
.agent-saisie input { flex: 1; min-width: 0; padding: .55rem 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 16px; color: var(--encre); }
.agent-saisie input::placeholder { color: #6b7780; }
.agent-saisie button { flex: none; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border: 0; border-radius: 50%; cursor: pointer; background: var(--lac-profond); color: var(--blanc); font-size: 1rem; }
@media (hover: hover) { .agent-saisie button:hover { background: var(--lac); } }
.agent-saisie:focus-within { box-shadow: inset 0 2px 0 var(--dore); }

/* Téléphone : la fenêtre s'ouvre comme une feuille, presque en plein écran */
@media (max-width: 47.99em) {
  .agent { right: .8rem; bottom: .8rem; }
  .agent-panneau { position: fixed; left: .5rem; right: .5rem; bottom: .5rem; width: auto; height: min(36rem, calc(100dvh - 5rem)); }
  .agent.agent-ouvert .agent-bouton { visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .agent-panneau, .agent-msg { animation: none; }
  .agent-jauge { animation: none; transform: none; }
}
