/* ==========================================================================
   Petit agent Walexia (assets/js/agent.js, includes/agent.php) — charte Walexia claire (29/10/2026, retour de
   l'utilisateur : « trop sombre », logo Walexia, police plus moderne, moins de texte).
   Feuille autonome : ne dépend ni de walexia.css ni de walexia-da2.css, et résiste aux styles du thème
   (sélecteurs préfixés par .wxa).
   - Blanc et vert Walexia : bouton d'ouverture et bouton principal en dégradé sur #34D36B, texte encre (8,6:1),
     jamais de vert foncé en fond ; messages du visiteur en bulle verte claire, comme sur WhatsApp.
   - Logo Walexia dans l'en-tête, pictogramme sur le bouton et à côté des réponses.
   - Plus Jakarta Sans (assets/fonts/), Arimo à défaut.
   - Bouton en bas à droite, panneau ancré au même endroit (400 px), plein écran sous 640 px.
   ========================================================================== */
.wxa {
  --wxa-green: #34D36B;
  --wxa-green-hover: #2BBE5F;
  --wxa-green-text: #15803D;
  --wxa-ink: #0E1F18;
  --wxa-text: #24332D;
  --wxa-muted: #54656F;
  --wxa-bg: #F7FDF9;
  --wxa-tint: #EDFBF2;
  --wxa-bubble: #D9FDD3;
  --wxa-surface: #FFFFFF;
  --wxa-border: rgba(14, 31, 24, .09);
  --wxa-border-strong: rgba(14, 31, 24, .18);
  --wxa-grad-action: linear-gradient(135deg, color-mix(in srgb, #34D36B 72%, #FFFFFF) 0%, #34D36B 52%, #2BBE5F 100%);
  --wxa-grad-head: linear-gradient(160deg, color-mix(in srgb, #34D36B 22%, #FFFFFF) 0%, color-mix(in srgb, #34D36B 9%, #FFFFFF) 55%, #FFFFFF 100%);
  --wxa-shadow-action: 0 1px 2px rgba(14, 31, 24, .12), 0 10px 24px -10px rgba(21, 128, 61, .55);
  --wxa-font: "Plus Jakarta Sans", Arimo, Arial, sans-serif;
  --wxa-gap: 24px;
  --wxa-ease: cubic-bezier(.2, .7, .2, 1);
  font-family: var(--wxa-font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--wxa-text);
  -webkit-font-smoothing: antialiased;
}
.wxa *, .wxa *::before, .wxa *::after { box-sizing: border-box; }
.wxa p { margin: 0; }
.wxa img { display: block; max-width: none; height: auto; border: 0; }
.wxa button {
  margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
  font: inherit; color: inherit; letter-spacing: inherit; line-height: inherit; text-transform: none; cursor: pointer;
}
.wxa svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wxa :focus-visible { outline: 2px solid var(--wxa-ink); outline-offset: 2px; }
.wxa .wxa-sr {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.wxa .wxa-label { font-size: 11px; font-weight: 700; line-height: 1.4; letter-spacing: .08em; text-transform: uppercase; color: var(--wxa-green-text); }

/* Bouton d'ouverture ------------------------------------------------------- */
.wxa .wxa-launcher {
  position: fixed; z-index: 2147482990; right: var(--wxa-gap); bottom: calc(var(--wxa-gap) + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 20px 6px 6px; border-radius: 999px;
  background: var(--wxa-grad-action); color: var(--wxa-ink); font-size: 15px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), var(--wxa-shadow-action), 0 0 0 4px rgba(255, 255, 255, .85);
  transition: opacity 220ms ease, transform 320ms var(--wxa-ease), box-shadow 200ms ease, visibility 0s;
}
.wxa .wxa-launcher:hover, .wxa .wxa-launcher:focus { background: var(--wxa-grad-action); color: var(--wxa-ink); transform: translateY(-1px); }
.wxa .wxa-launcher__mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(14, 31, 24, .12); }
.wxa .wxa-launcher__mark img { width: 26px; height: 26px; }
/* Au-dessus du bouton flottant « Réserver » de la page Tarifs (52 px + 12 px d'écart). */
.wxa .wxa-launcher.is-raised, .wxa .wxa-launcher.is-raised:hover { transform: translateY(-64px); }
/* Rangé : carte « Démo par secteur », bandeau cookies sur mobile, panneau ouvert. */
.wxa .wxa-launcher.is-tucked, .wxa.is-open .wxa-launcher {
  opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(12px);
  transition: opacity 220ms ease, transform 320ms var(--wxa-ease), visibility 0s linear 220ms;
}

/* Panneau ------------------------------------------------------------------ */
.wxa .wxa-panel {
  position: fixed; z-index: 2147482995; right: var(--wxa-gap); bottom: calc(var(--wxa-gap) + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; overflow: hidden;
  width: min(400px, calc(100vw - 2 * var(--wxa-gap)));
  /* Hauteur du contenu, jusqu'à 640 px : le panneau grandit vers le haut avec la conversation. */
  max-height: min(640px, calc(100vh - 2 * var(--wxa-gap)));
  max-height: min(640px, calc(100dvh - 2 * var(--wxa-gap)));
  border-radius: 22px; background: var(--wxa-surface);
  box-shadow: 0 0 0 1px var(--wxa-border), 0 30px 60px -24px rgba(14, 31, 24, .35), 0 12px 32px -18px rgba(21, 128, 61, .35);
  opacity: 0; transform: translateY(14px) scale(.985); transform-origin: 100% 100%;
  transition: opacity 220ms ease, transform 320ms var(--wxa-ease);
}
.wxa .wxa-panel[hidden] { display: none; }
.wxa .wxa-panel.is-shown { opacity: 1; transform: none; }

.wxa .wxa-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 10px 14px 18px;
  background: var(--wxa-grad-head); border-bottom: 1px solid var(--wxa-border);
}
.wxa .wxa-head__brand { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.wxa .wxa-logo { width: 112px; height: 24px; object-fit: contain; object-position: left center; }
.wxa .wxa-tag {
  padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .8); box-shadow: inset 0 0 0 1px rgba(21, 128, 61, .18);
  font-size: 11.5px; font-weight: 700; color: var(--wxa-green-text); white-space: nowrap;
}
.wxa .wxa-icon-btn { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; color: var(--wxa-ink); }
.wxa .wxa-icon-btn:hover, .wxa .wxa-icon-btn:focus { background: rgba(14, 31, 24, .06); color: var(--wxa-ink); }

.wxa .wxa-log {
  flex: 1; display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 16px 16px 14px; background: var(--wxa-bg);
}
.wxa .wxa-msg--me {
  align-self: flex-end; max-width: 84%; padding: 8px 13px; border-radius: 16px 16px 4px 16px;
  background: var(--wxa-bubble); color: var(--wxa-ink); font-size: 14.5px; font-weight: 500; line-height: 1.45; overflow-wrap: anywhere;
  box-shadow: 0 1px 1px rgba(14, 31, 24, .06);
}
.wxa .wxa-msg--bot { display: flex; align-items: flex-start; gap: 8px; }
.wxa .wxa-avatar { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #FFFFFF; box-shadow: inset 0 0 0 1px var(--wxa-border); }
.wxa .wxa-avatar img { width: 18px; height: 18px; }
.wxa .wxa-card {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 11px 14px; border-radius: 4px 16px 16px 16px;
  background: var(--wxa-surface); box-shadow: inset 0 0 0 1px var(--wxa-border), 0 1px 2px rgba(14, 31, 24, .04);
}
.wxa .wxa-text { font-size: 14.5px; line-height: 1.55; color: var(--wxa-text); }
.wxa .wxa-text + .wxa-text { margin-top: -4px; }
.wxa .wxa-readmore { align-self: flex-start; font-size: 13.5px; font-weight: 700; color: var(--wxa-green-text); }
.wxa .wxa-readmore:hover, .wxa .wxa-readmore:focus { background: none; color: var(--wxa-ink); }
.wxa .wxa-readmore::after { content: " ↓"; }

.wxa .wxa-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wxa .wxa-chip, .wxa .wxa-chip:visited {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px; border-radius: 999px;
  background: var(--wxa-tint); color: var(--wxa-green-text); font-size: 13px; font-weight: 700; line-height: 1.3; text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(21, 128, 61, .16); transition: background-color 160ms ease;
}
.wxa .wxa-chip::after { content: "→"; }
.wxa .wxa-chip:hover, .wxa .wxa-chip:focus { background: color-mix(in srgb, #34D36B 22%, #FFFFFF); color: var(--wxa-ink); text-decoration: none; }

.wxa .wxa-suggest { display: flex; flex-direction: column; gap: 8px; }
.wxa .wxa-questions { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.wxa .wxa-questions li { margin: 0; padding: 0; }
.wxa .wxa-question {
  display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; height: auto; padding: 10px 14px; white-space: normal; overflow-wrap: anywhere; border-radius: 14px; text-align: left;
  background: var(--wxa-surface); box-shadow: inset 0 0 0 1px var(--wxa-border); color: var(--wxa-ink);
  font-size: 14px; font-weight: 600; line-height: 1.35; transition: box-shadow 160ms ease, background-color 160ms ease;
}
.wxa .wxa-question::after { content: "→"; margin-left: auto; padding-left: 8px; color: var(--wxa-green-text); font-weight: 700; }
.wxa .wxa-question:hover, .wxa .wxa-question:focus { background: var(--wxa-tint); box-shadow: inset 0 0 0 1px rgba(21, 128, 61, .3); color: var(--wxa-ink); }
.wxa .wxa-card .wxa-question { padding: 8px 12px; background: var(--wxa-bg); }

.wxa .wxa-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 36px; }
.wxa .wxa-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 18px; border-radius: 999px;
  font-size: 14px; font-weight: 700; line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 160ms ease;
}
.wxa .wxa-btn--main, .wxa .wxa-btn--main:visited { background: var(--wxa-grad-action); color: var(--wxa-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), var(--wxa-shadow-action); }
.wxa .wxa-btn--main:hover, .wxa .wxa-btn--main:focus { background: var(--wxa-grad-action); color: var(--wxa-ink); transform: translateY(-1px); }
.wxa .wxa-btn--ghost, .wxa .wxa-btn--ghost:visited { background: var(--wxa-surface); color: var(--wxa-ink); box-shadow: inset 0 0 0 1px var(--wxa-border-strong); }
.wxa .wxa-btn--ghost:hover, .wxa .wxa-btn--ghost:focus { background: var(--wxa-surface); color: var(--wxa-ink); box-shadow: inset 0 0 0 1px var(--wxa-green-text); }
.wxa .wxa-more { align-self: flex-start; margin-left: 36px; padding: 2px 0; font-size: 13px; font-weight: 600; color: var(--wxa-muted); text-decoration: underline; text-underline-offset: 3px; }
.wxa .wxa-more:hover, .wxa .wxa-more:focus { background: none; color: var(--wxa-ink); }

.wxa .wxa-typing { gap: 5px; align-items: center; height: 28px; padding-left: 36px; }
.wxa .wxa-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--wxa-green); opacity: .3; animation: wxa-blink 1s ease-in-out infinite; }
.wxa .wxa-typing span:nth-child(2) { animation-delay: .15s; }
.wxa .wxa-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes wxa-blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

.wxa .wxa-foot { padding: 10px 14px 8px; background: var(--wxa-surface); border-top: 1px solid var(--wxa-border); }
.wxa .wxa-form {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 5px 5px 5px 16px; border-radius: 999px;
  background: var(--wxa-surface); box-shadow: inset 0 0 0 1px var(--wxa-border-strong);
}
.wxa .wxa-form:focus-within { box-shadow: inset 0 0 0 1.5px var(--wxa-green-text), 0 0 0 4px rgba(52, 211, 107, .18); }
.wxa .wxa-form .wxa-input, .wxa .wxa-form .wxa-input:focus {
  flex: 1; min-width: 0; width: auto; height: auto; margin: 0; padding: 8px 0; border: 0; border-radius: 0; outline: none;
  background: transparent; box-shadow: none; font: inherit; font-size: 15px; color: var(--wxa-ink);
}
.wxa .wxa-form .wxa-input::placeholder { color: #8A979F; opacity: 1; }
.wxa .wxa-send { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--wxa-grad-action); color: var(--wxa-ink); }
.wxa .wxa-send:hover, .wxa .wxa-send:focus { background: var(--wxa-grad-action); color: var(--wxa-ink); filter: brightness(.97); }
.wxa .wxa-powered { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 7px; font-size: 11px; color: var(--wxa-muted); }
.wxa .wxa-powered strong { font-weight: 800; letter-spacing: .02em; color: var(--wxa-ink); }
.wxa .wxa-powered img { width: auto; height: 14px; }

/* Mobile : plein écran, cibles de 44 px, champ en 16 px (pas de zoom sur iPhone) ---------------------- */
@media (max-width: 640px) {
  .wxa { --wxa-gap: 16px; }
  .wxa .wxa-launcher { min-height: 48px; padding: 4px 16px 4px 4px; font-size: 14px; }
  .wxa .wxa-launcher__mark { width: 40px; height: 40px; }
  .wxa .wxa-panel {
    top: 0; right: 0; bottom: auto; left: 0; width: 100%; height: 100vh; height: 100dvh; max-height: none; border-radius: 0;
    transform: translateY(24px); transform-origin: 50% 100%;
  }
  .wxa .wxa-head { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  .wxa .wxa-icon-btn { width: 44px; height: 44px; }
  .wxa .wxa-btn { min-height: 44px; }
  .wxa .wxa-question { padding-block: 12px; }
  .wxa .wxa-foot { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  .wxa .wxa-form .wxa-input, .wxa .wxa-form .wxa-input:focus { font-size: 16px; }
  .wxa .wxa-send { width: 40px; height: 40px; }
}
html.wxa-lock, html.wxa-lock body { overflow: hidden; }
/* Panneau plein écran : le bouton « Gérer les cookies » (consent.js, en bas à gauche) passerait sur le champ. */
html.wxa-lock .wxc-fab { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  .wxa .wxa-launcher, .wxa .wxa-panel, .wxa .wxa-launcher.is-tucked, .wxa.is-open .wxa-launcher { transition: none; }
  .wxa .wxa-launcher:hover, .wxa .wxa-btn--main:hover { transform: none; }
  .wxa .wxa-typing span { animation: none; opacity: .7; }
}
@media print { .wxa { display: none; } }

/* ==========================================================================
   Charte « Encre & aurore » (29/10/2026, demande de Walexia : « réadapte la DA du site, je veux le bouton liquide »)
   - Bouton d'ouverture en verre liquide : fond translucide flouté, reflet clair en haut, liseré blanc fin et ombre
     douce ; un reflet glisse lentement d'un bord à l'autre (mouvement réduit : reflet fixe).
   - Encre #121417 pour les boutons principaux et l'envoi, comme sur le site ; en-tête blanc sous un halo pastel
     (menthe, ciel, lilas) ; étiquettes en JetBrains Mono ; le vert ne sert plus qu'aux repères (point « en ligne »,
     coches, bulle du visiteur façon WhatsApp).
   ========================================================================== */
.wxa {
  --wxa-ink: #121417;
  --wxa-text: #2B3036;
  --wxa-muted: #5C636A;
  --wxa-bg: #FAF9F6;
  --wxa-tint: #F3F1EC;
  --wxa-border: rgba(18, 20, 23, .08);
  --wxa-border-strong: rgba(18, 20, 23, .16);
  --wxa-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --wxa-aurora:
    radial-gradient(60% 120% at 100% 0%, rgba(52, 211, 107, .16), transparent 70%),
    radial-gradient(50% 120% at 0% 0%, rgba(124, 196, 255, .18), transparent 70%),
    radial-gradient(40% 90% at 60% 100%, rgba(201, 167, 255, .12), transparent 70%);
}
@keyframes wxa-liquid { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(190%, 0, 0); } }

/* Bouton d'ouverture en verre liquide */
.wxa .wxa-launcher, .wxa .wxa-launcher:hover, .wxa .wxa-launcher:focus {
  color: var(--wxa-ink);
  background:
    radial-gradient(42% 120% at var(--wxa-gx, 22%) 0%, rgba(255, 255, 255, .95), transparent 72%),
    radial-gradient(60% 100% at calc(100% - var(--wxa-gx, 22%)) 120%, rgba(255, 255, 255, .55), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .72), rgba(255, 255, 255, .42));
  -webkit-backdrop-filter: blur(16px) saturate(1.8); backdrop-filter: blur(16px) saturate(1.8);
  overflow: hidden; isolation: isolate;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .95),
    inset 0 -1px 1px rgba(255, 255, 255, .45),
    inset 0 0 0 1px rgba(18, 20, 23, .08),
    0 18px 40px -18px rgba(18, 20, 23, .45),
    0 4px 12px -6px rgba(18, 20, 23, .18);
}
.wxa .wxa-launcher:hover, .wxa .wxa-launcher:focus {
  box-shadow:
    inset 0 1px 0 #FFFFFF,
    inset 0 -1px 1px rgba(255, 255, 255, .55),
    inset 0 0 0 1px rgba(18, 20, 23, .12),
    0 22px 46px -18px rgba(18, 20, 23, .5),
    0 6px 14px -6px rgba(18, 20, 23, .2);
}
.wxa .wxa-launcher__mark { position: relative; background: #FFFFFF; box-shadow: inset 0 0 0 1px rgba(18, 20, 23, .06), 0 2px 6px -2px rgba(18, 20, 23, .2); }
/* Reflet du verre : seul ce calque bouge, le bouton n'est pas redessiné à chaque image. */
.wxa .wxa-launcher::before { content: ""; position: absolute; z-index: -1; top: -20%; bottom: -20%; left: -10%; width: 44%; background: radial-gradient(closest-side, rgba(255, 255, 255, .95), transparent); pointer-events: none; }
/* Point « en ligne » */
.wxa .wxa-launcher__mark::after { content: ""; position: absolute; right: 1px; bottom: 1px; width: 10px; height: 10px; border-radius: 50%; background: #34D36B; box-shadow: 0 0 0 2px #FFFFFF; }
@media (prefers-reduced-motion: no-preference) {
  .wxa .wxa-launcher::before { animation: wxa-liquid 3s ease-in-out infinite alternate; }
  .wxa .wxa-launcher:hover::before { animation-duration: 1.3s; }
}

/* Panneau */
.wxa .wxa-panel { box-shadow: 0 0 0 1px var(--wxa-border), 0 34px 70px -28px rgba(18, 20, 23, .42); }
.wxa .wxa-head { background: var(--wxa-aurora), #FFFFFF; }
.wxa .wxa-tag { padding: 4px 9px; background: var(--wxa-tint); box-shadow: none; font: 500 10.5px/1.2 var(--wxa-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--wxa-muted); }
.wxa .wxa-icon-btn:hover, .wxa .wxa-icon-btn:focus { background: rgba(18, 20, 23, .06); }
.wxa .wxa-label { font: 500 10.5px/1.4 var(--wxa-mono); letter-spacing: .1em; color: var(--wxa-muted); }
.wxa .wxa-readmore { color: var(--wxa-ink); text-decoration: underline; text-decoration-color: #34D36B; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.wxa .wxa-chip, .wxa .wxa-chip:visited { background: #FFFFFF; color: var(--wxa-ink); box-shadow: inset 0 0 0 1px var(--wxa-border-strong); }
.wxa .wxa-chip:hover, .wxa .wxa-chip:focus { background: var(--wxa-tint); color: var(--wxa-ink); }
.wxa .wxa-question::after { color: var(--wxa-ink); }
.wxa .wxa-question:hover, .wxa .wxa-question:focus { background: #F6F5F1; box-shadow: inset 0 0 0 1px var(--wxa-border-strong); }
.wxa .wxa-btn--main, .wxa .wxa-btn--main:visited, .wxa .wxa-btn--main:hover, .wxa .wxa-btn--main:focus { background: var(--wxa-ink); color: #FFFFFF; box-shadow: 0 1px 2px rgba(18, 20, 23, .18), 0 12px 26px -14px rgba(18, 20, 23, .6); }
.wxa .wxa-btn--main:hover, .wxa .wxa-btn--main:focus { background: #2A2F35; }
.wxa .wxa-btn--ghost:hover, .wxa .wxa-btn--ghost:focus { box-shadow: inset 0 0 0 1px var(--wxa-ink); }
.wxa .wxa-form:focus-within { box-shadow: inset 0 0 0 1.5px var(--wxa-ink), 0 0 0 4px rgba(18, 20, 23, .06); }
.wxa .wxa-send, .wxa .wxa-send:hover, .wxa .wxa-send:focus { background: var(--wxa-ink); color: #FFFFFF; filter: none; }
.wxa .wxa-send:hover, .wxa .wxa-send:focus { background: #2A2F35; }
@media (prefers-reduced-motion: reduce) {
  .wxa .wxa-launcher::before { animation: none; }
}

/* Feuille chargée après le premier affichage : l'assistant, masqué en attendant (includes/agent.php), apparaît ici. */
.wxa { visibility: visible; }
