/* ==========================================================================
   Bulle Actiman — invitation au pré-diagnostic (chantier Bulle Actiman, 11/2026)
   Gabarit : actimur_bulle_actiman_markup() dans functions.php
   Comportement : js/bulle-actiman.js
   ========================================================================== */

.bulle-actiman {
  --bulle-orange: #e36124;
  --bulle-orange-fonce: #cf551d;
  --bulle-orange-texte: #c24f1b;
  --bulle-encre: #241d18;
  --bulle-gris: #75665b;
  --bulle-peche: #fcece5;
  --bulle-pastille: #f5efe9;
  --bulle-vert: #96A825;
  --bulle-barre: 0px; /* hauteur de la barre mobile fixe, posée par le script */
  --bulle-bas: env(safe-area-inset-bottom, 0px);
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 9000;
  width: 0;
  height: 0;
  font-family: "Roboto", Arial, sans-serif;
  color: var(--bulle-encre);
  transition: opacity .3s ease-out, visibility .3s;
}
.bulle-actiman *,
.bulle-actiman *::before,
.bulle-actiman *::after { box-sizing: border-box; }

/* Écartée : formulaire de devis à l'écran, saisie en cours, fenêtre du guide ou menu ouvert */
.bulle-actiman.is-away,
html.guide-popin-open .bulle-actiman,
html.mm-opened .bulle-actiman { opacity: 0; visibility: hidden; pointer-events: none; }

/* --- Actiman dans son rond -------------------------------------------- */
.bulle-actiman__avatar {
  position: fixed;
  right: 28px;
  bottom: calc(28px + var(--bulle-bas));
  width: 72px;
  height: 72px;
  padding: 0;
  margin: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--bulle-peche);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 10px 24px -8px rgba(36, 29, 24, .45), 0 2px 4px rgba(36, 29, 24, .12);
  transition: transform .25s cubic-bezier(.16, 1, .3, 1);
}
.bulle-actiman__avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bulle-actiman__avatar:hover { transform: translateY(-2px); }

/* --- Étiquette, bulle repliée ------------------------------------------ */
.bulle-actiman__tip {
  position: fixed;
  right: 112px;
  bottom: calc(44px + var(--bulle-bas));
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 11px 14px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--bulle-encre);
  font: 700 14px/1 "Roboto", Arial, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(36, 29, 24, .4), 0 1px 3px rgba(36, 29, 24, .1);
  transition: opacity .25s ease-out;
}
.bulle-actiman__tip b { color: var(--bulle-orange-texte); font-weight: 700; }

/* --- Carte du message --------------------------------------------------- */
.bulle-actiman__card {
  position: fixed;
  right: 28px;
  bottom: calc(116px + var(--bulle-bas));
  width: 340px;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 22px 22px 20px;
  border-top: 4px solid var(--bulle-orange);
  border-radius: 18px 18px 6px 18px;
  background: #fff;
  box-shadow: 0 28px 50px -22px rgba(36, 29, 24, .5), 0 2px 6px rgba(36, 29, 24, .08);
  transform-origin: 100% 100%;
  transition: opacity .3s cubic-bezier(.16, 1, .3, 1), transform .4s cubic-bezier(.16, 1, .3, 1), filter .3s ease-out, visibility .3s;
}
.bulle-actiman__who { margin: 0 0 10px; font: 700 13px/1 "Outfit", "Roboto", Arial, sans-serif; letter-spacing: .02em; color: var(--bulle-gris); }
.bulle-actiman__who b { color: var(--bulle-orange-texte); }
.bulle-actiman__msg { margin: 0 0 14px; padding-right: 18px; font: 400 17px/1.45 "Roboto", Arial, sans-serif; color: var(--bulle-encre); }
.bulle-actiman__msg strong { font-weight: 700; }
.bulle-actiman__meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.bulle-actiman__meta li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--bulle-pastille);
  color: #6b5f56;
  font: 500 12.5px/1 "Roboto", Arial, sans-serif;
}
.bulle-actiman__meta li::before { content: none; }
.bulle-actiman__meta svg { width: 13px; height: 13px; color: var(--bulle-vert); flex: none; }
.bulle-actiman__cta,
.bulle-actiman__cta:visited {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 18px;
  border-radius: 999px;
  background: var(--bulle-orange);
  color: #fff;
  font: 700 16px/1 "Roboto", Arial, sans-serif;
  text-decoration: none;
  box-shadow: 0 10px 20px -8px rgba(227, 97, 36, .55);
}
.bulle-actiman__cta:hover,
.bulle-actiman__cta:focus { background: var(--bulle-orange-fonce); color: #fff; text-decoration: none; }
.bulle-actiman__cta svg { width: 18px; height: 18px; flex: none; }
.bulle-actiman__close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--bulle-gris);
  cursor: pointer;
}
.bulle-actiman__close:hover { background: var(--bulle-pastille); color: var(--bulle-encre); }
.bulle-actiman__close svg { width: 18px; height: 18px; }

.bulle-actiman :focus-visible { outline: 3px solid var(--bulle-orange); outline-offset: 2px; }

/* --- États ouvert / replié --------------------------------------------- */
.bulle-actiman[data-state="closed"] .bulle-actiman__card {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(.92);
  filter: blur(4px);
  pointer-events: none;
}
.bulle-actiman[data-state="open"] .bulle-actiman__tip { opacity: 0; visibility: hidden; pointer-events: none; }
/* À côté du formulaire collant de la colonne (ordinateur) : pas d'étiquette, elle chevaucherait la colonne */
.bulle-actiman.is-beside-form .bulle-actiman__tip { display: none; }

/* --- Mobile ------------------------------------------------------------- */
@media (max-width: 767px) {
  .bulle-actiman__avatar { right: 16px; bottom: calc(16px + var(--bulle-bas)); width: 60px; height: 60px; }
  .bulle-actiman__tip { display: none; }
  .bulle-actiman__card { left: 16px; right: 16px; width: auto; max-width: none; bottom: calc(90px + var(--bulle-bas)); padding: 20px 18px 18px; }
  .bulle-actiman__msg { font-size: 16px; }

  /* Page avec barre fixe en bas (accueil, LP) : Actiman dépasse de la barre */
  .bulle-actiman.is-docked .bulle-actiman__avatar {
    right: 10px;
    bottom: var(--bulle-barre);
    width: 86px;
    height: 76px;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }
  .bulle-actiman.is-docked .bulle-actiman__avatar img { height: auto; object-fit: initial; }
  .bulle-actiman.is-docked .bulle-actiman__tip {
    display: flex;
    right: 92px;
    bottom: calc(var(--bulle-barre) + 12px);
    padding: 10px 13px;
    font-size: 13px;
  }
  .bulle-actiman.is-docked .bulle-actiman__card { left: 12px; right: 12px; bottom: calc(var(--bulle-barre) + 88px); }
}

@media (prefers-reduced-motion: reduce) {
  .bulle-actiman,
  .bulle-actiman * { transition-duration: .01ms !important; }
}

/* --- Badge reCAPTCHA ------------------------------------------------------
   Masqué là où la bulle s'affiche : la mention imposée par Google est ajoutée
   sous chaque formulaire (filtre actimur_recaptcha_mention, functions.php). */
.grecaptcha-badge { visibility: hidden !important; }
.actimur-recaptcha-mention {
  margin: 10px 0 0;
  font: 400 11.5px/1.45 "Roboto", Arial, sans-serif;
  color: #6b5f56;
  text-align: center;
}
.actimur-recaptcha-mention a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
