/* Assistant de questions fréquentes Paradiggm
   Fonctionne entièrement dans le navigateur : aucun service tiers, aucun cookie,
   les questions tapées ne sont ni enregistrées ni transmises.
   Suit automatiquement le mode clair ou sombre du site (variables de couleur de index.html). */

.pg-bot-launch {
  position: fixed; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px 12px 12px; border: 0; border-radius: 999px;
  background: var(--btn, #3A3D45); color: var(--btn-text, #FFFFFF); cursor: pointer;
  font: 600 .95rem/1 "Poppins", Arial, sans-serif;
  box-shadow: 0 16px 34px -12px rgba(22, 23, 27, .5);
  transition: transform .2s ease;
}
.pg-bot-launch:hover { transform: translateY(-2px); }
.pg-bot-launch[aria-expanded="true"] { display: none; }
.pg-bot-dot {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #6D79F4, #E85CF5);
  display: grid; place-items: center; color: #FFFFFF;
}
.pg-bot-dot svg { width: 15px; height: 15px; }

.pg-bot {
  position: fixed; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 31;
  width: 390px; max-width: calc(100vw - 32px);
  height: 600px; max-height: calc(100vh - 120px);
  display: flex; flex-direction: column;
  background: var(--card, #FFFFFF); color: var(--text, #3A3D45);
  border: 1px solid var(--line, #E4E5EB); border-radius: 22px;
  box-shadow: 0 28px 70px -20px rgba(22, 23, 27, .45);
  font-family: "Poppins", Arial, sans-serif; overflow: hidden;
}
.pg-bot[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .pg-bot:not([hidden]) { animation: pg-bot-in .25s cubic-bezier(.2, .8, .2, 1); }
  @keyframes pg-bot-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
}

.pg-bot-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 14px 16px 18px; background: var(--band, #3A3D45); color: #FFFFFF;
}
.pg-bot-head .pg-bot-dot { width: 36px; height: 36px; }
.pg-bot-head .pg-bot-dot svg { width: 17px; height: 17px; }
.pg-bot-title { flex: 1; min-width: 0; }
.pg-bot-title b { display: block; font-weight: 600; font-size: 1rem; line-height: 1.3; }
.pg-bot-title small { display: block; font-size: .8rem; color: #C9CBD3; line-height: 1.4; }
.pg-bot-close {
  width: 38px; height: 38px; border-radius: 50%; border: 0; flex: none;
  background: rgba(255, 255, 255, .12); color: #FFFFFF; cursor: pointer;
  display: grid; place-items: center;
}
.pg-bot-close:hover { background: rgba(255, 255, 255, .22); }
.pg-bot-close svg { width: 16px; height: 16px; }
.pg-bot :focus-visible { outline: 3px solid var(--focus, #5560E8); outline-offset: 2px; }
.pg-bot-head :focus-visible { outline-color: #FFFFFF; }

.pg-bot-log {
  position: relative; flex: 1; overflow-y: auto; padding: 20px 14px 8px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-alt, #F4F4F7); overscroll-behavior: contain;
}
.pg-msg {
  max-width: 88%; padding: 11px 15px; border-radius: 16px;
  font-size: .93rem; line-height: 1.6; overflow-wrap: anywhere;
}
.pg-msg p { margin: 0; }
.pg-msg p + p, .pg-msg p + ul, .pg-msg ul + p { margin-top: 8px; }
.pg-msg ul { margin: 0; padding-left: 18px; list-style: disc; }
.pg-msg li + li { margin-top: 3px; }
.pg-msg a { color: inherit; font-weight: 600; text-underline-offset: 3px; }
.pg-msg-bot { align-self: flex-start; background: var(--card, #FFFFFF); border: 1px solid var(--line, #E4E5EB); border-bottom-left-radius: 6px; }
.pg-msg-user { align-self: flex-end; background: var(--btn, #3A3D45); color: var(--btn-text, #FFFFFF); border-bottom-right-radius: 6px; }

.pg-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 6px; }
.pg-chip {
  border: 1px solid var(--line, #E4E5EB); background: var(--card, #FFFFFF); color: var(--text, #3A3D45);
  border-radius: 999px; padding: 8px 13px; cursor: pointer; text-align: left;
  font: 500 .84rem/1.35 "Poppins", Arial, sans-serif;
}
.pg-chip:hover { border-color: #AB6BF4; }
.pg-chip-cta { background: var(--btn, #3A3D45); color: var(--btn-text, #FFFFFF); border-color: transparent; text-decoration: none; display: inline-block; }
.pg-chip-cta:hover { border-color: transparent; opacity: .9; }

.pg-bot-form {
  display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line, #E4E5EB); background: var(--card, #FFFFFF);
}
.pg-bot-form input {
  flex: 1; min-width: 0; border: 1px solid var(--line, #E4E5EB); border-radius: 999px;
  padding: 12px 16px; background: var(--bg, #FFFFFF); color: var(--text, #3A3D45);
  font: 400 .93rem/1.3 "Poppins", Arial, sans-serif;
}
.pg-bot-form input::placeholder { color: var(--muted, #666A75); }
.pg-bot-form input:focus { outline: none; border-color: #AB6BF4; box-shadow: 0 0 0 3px rgba(171, 107, 244, .25); }
.pg-bot-form button {
  width: 46px; height: 46px; border-radius: 50%; border: 0; flex: none; cursor: pointer;
  background: linear-gradient(135deg, #6D79F4, #E85CF5); color: #FFFFFF; display: grid; place-items: center;
}
.pg-bot-form button svg { width: 18px; height: 18px; }
.pg-bot-note { margin: 0; padding: 0 16px 10px; background: var(--card, #FFFFFF); font-size: .72rem; color: var(--muted, #666A75); line-height: 1.4; }

.pg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Mobile : bouton rond à droite, pour laisser la place au bouton « Demander un appel » centré */
@media (max-width: 760px) {
  .pg-bot-launch { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); padding: 11px; }
  .pg-bot-launch .pg-bot-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .pg-bot-launch .pg-bot-dot { width: 32px; height: 32px; }
  .pg-bot { right: 8px; left: 8px; bottom: 8px; width: auto; max-width: none; height: calc(100vh - 16px); height: calc(100dvh - 16px); max-height: none; border-radius: 20px; }
  .pg-bot-form input { font-size: 16px; } /* évite le zoom automatique sur iPhone */
}
@media print { .pg-bot, .pg-bot-launch { display: none !important; } }

@media (max-width: 380px) { .pg-bot-launch { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }
