/* Assistant AlterEgo — widget. Couleurs et polices du thème (repli si absent). */
.aea {
  --aea-ink: var(--wp--preset--color--ink, #141413);
  --aea-paper: var(--wp--preset--color--paper, #FBF8F3);
  --aea-sand: var(--wp--preset--color--sand, #EFE9DF);
  --aea-line: var(--wp--preset--color--line, #DDD6CA);
  --aea-bronze: var(--wp--preset--color--bronze, #B94E33);
  --aea-sans: var(--wp--preset--font-family--sans, "Instrument Sans", Arial, sans-serif);
  --aea-display: var(--wp--preset--font-family--display, "Bricolage Grotesque", Arial, sans-serif);
  position: fixed; right: 20px; bottom: 20px; z-index: 9990;
  font-family: var(--aea-sans); color: var(--aea-ink); font-size: 15px; line-height: 1.5;
}
.aea *, .aea *::before, .aea *::after { box-sizing: border-box; }
.aea button { font: inherit; cursor: pointer; }

/* Bouton d'ouverture */
.aea__ouvrir {
  display: inline-flex; align-items: center; gap: .6rem; height: 52px; padding: 0 1.25rem 0 1rem;
  border: 0; border-radius: 999px; background: var(--aea-ink); color: #fff;
  font-family: var(--aea-display); font-weight: 700; font-size: .9375rem; letter-spacing: -.005em;
  box-shadow: 0 14px 34px -14px rgba(20, 20, 19, .55); transition: transform .2s ease, background .2s ease;
}
.aea__ouvrir:hover { background: var(--aea-bronze); transform: translateY(-1px); }
.aea__ouvrir svg { width: 20px; height: 20px; flex: none; }
.aea__ouvrir .aea__pt { width: 8px; height: 8px; border-radius: 50%; background: var(--aea-bronze); flex: none; }
.aea.is-open .aea__ouvrir { display: none; }

/* Panneau */
.aea__panneau {
  display: none; flex-direction: column; width: 400px; max-width: calc(100vw - 24px); height: 640px; max-height: calc(100vh - 40px);
  background: var(--aea-paper); border: 1px solid var(--aea-line); border-radius: 22px; overflow: hidden;
  box-shadow: 0 30px 70px -30px rgba(20, 20, 19, .45);
}
.aea.is-open .aea__panneau { display: flex; animation: aea-monte .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes aea-monte { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.aea__tete { display: flex; align-items: center; gap: .75rem; padding: 1rem 1rem 1rem 1.25rem; background: var(--aea-ink); color: #fff; }
.aea__tete-t { flex: 1; min-width: 0; }
.aea__tete-t strong { display: block; font-family: var(--aea-display); font-weight: 700; font-size: 1rem; line-height: 1.2; }
.aea__tete-t small { display: block; font-size: .75rem; opacity: .7; margin-top: .15rem; }
.aea__fermer { width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255,255,255,.08); color: #fff; display: grid; place-items: center; }
.aea__fermer:hover { background: rgba(255,255,255,.16); }
.aea__fermer svg { width: 16px; height: 16px; }

.aea__fil { flex: 1; overflow-y: auto; padding: 1.1rem 1rem .5rem; scroll-behavior: smooth; }
.aea__msg { max-width: 88%; margin: 0 0 .7rem; padding: .7rem .95rem; border-radius: 16px; font-size: .9375rem; line-height: 1.55; white-space: pre-wrap; word-wrap: break-word; animation: aea-monte .25s ease; }
.aea__msg--a { background: #fff; border: 1px solid var(--aea-line); border-bottom-left-radius: 6px; }
.aea__msg--v { margin-left: auto; background: var(--aea-ink); color: #fff; border-bottom-right-radius: 6px; }
.aea__msg a { color: var(--aea-bronze); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.aea__msg--v a { color: #f0c4b3; }
.aea__msg ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.aea__msg li { margin: .15rem 0; }
.aea__attente { display: inline-flex; gap: 4px; padding: .85rem 1rem; }
.aea__attente i { width: 6px; height: 6px; border-radius: 50%; background: var(--aea-bronze); opacity: .4; animation: aea-pulse 1s infinite; }
.aea__attente i:nth-child(2) { animation-delay: .15s; } .aea__attente i:nth-child(3) { animation-delay: .3s; }
@keyframes aea-pulse { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

.aea__sugg { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 1rem .75rem; }
.aea__sugg button { border: 1px solid var(--aea-line); background: #fff; color: var(--aea-ink); border-radius: 999px; padding: .4rem .8rem; font-size: .8125rem; }
.aea__sugg button:hover { border-color: var(--aea-bronze); color: var(--aea-bronze); }

/* Formulaire de rendez-vous dans le fil */
.aea__form { background: #fff; border: 1px solid var(--aea-bronze); border-radius: 16px; padding: 1rem; margin: 0 0 .7rem; max-width: 100%; }
.aea__form p { margin: 0 0 .6rem; font-size: .875rem; }
.aea__form label { display: block; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: #6c675e; margin: .5rem 0 .2rem; }
.aea__form input, .aea__form select { width: 100%; height: 40px; border: 1px solid var(--aea-line); border-radius: 8px; padding: 0 .7rem; font: inherit; font-size: .9375rem; background: var(--aea-paper); }
.aea__form input:focus, .aea__form select:focus { outline: 2px solid var(--aea-bronze); outline-offset: 1px; }
.aea__form .aea__deux { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.aea__form .aea__consent { text-transform: none; letter-spacing: 0; display: flex; gap: .55rem; align-items: flex-start; margin-top: .75rem; font-size: .8125rem; line-height: 1.45; color: #4a4740; }
.aea__consent input { width: 16px; height: 16px; margin-top: 2px; flex: none; }
.aea__form .aea__env { margin-top: .75rem; width: 100%; height: 42px; border: 0; border-radius: 999px; background: var(--aea-bronze); color: #fff; font-family: var(--aea-display); font-weight: 700; }
.aea__form .aea__env:hover { background: var(--aea-ink); }
.aea__form .aea__env[disabled] { opacity: .6; cursor: default; }
.aea__err { color: #a32d2d; font-size: .8125rem; margin: .5rem 0 0; }
.aea__ok { background: var(--aea-sand); border-radius: 12px; padding: .8rem 1rem; font-size: .9rem; }

/* Saisie */
.aea__saisie { display: flex; gap: .5rem; align-items: flex-end; padding: .75rem 1rem; border-top: 1px solid var(--aea-line); background: #fff; }
.aea__saisie textarea { flex: 1; resize: none; min-height: 42px; max-height: 120px; border: 1px solid var(--aea-line); border-radius: 12px; padding: .6rem .8rem; font: inherit; font-size: .9375rem; line-height: 1.4; background: var(--aea-paper); }
.aea__saisie textarea:focus { outline: 2px solid var(--aea-bronze); outline-offset: 1px; }
.aea__envoyer { width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--aea-ink); color: #fff; display: grid; place-items: center; flex: none; }
.aea__envoyer:hover { background: var(--aea-bronze); }
.aea__envoyer[disabled] { opacity: .4; cursor: default; }
.aea__envoyer svg { width: 18px; height: 18px; }
.aea__pied { padding: .45rem 1rem .7rem; font-size: .6875rem; color: #6c675e; background: #fff; text-align: center; }
.aea__pied a { color: inherit; }

@media (max-width: 560px) {
  .aea { right: 12px; bottom: 12px; }
  .aea.is-open { inset: 0; right: 0; bottom: 0; }
  .aea__panneau { width: 100vw; max-width: none; height: 100%; max-height: none; border-radius: 0; border: 0; }
  .aea__ouvrir span.aea__lbl { display: none; }
  .aea__ouvrir { padding: 0 1rem; }
}
@media (prefers-reduced-motion: reduce) { .aea *, .aea *::before, .aea *::after { animation: none !important; transition: none !important; } }
@media print { .aea { display: none; } }
