/* =========================================================
   Intraneos Synergy — Page FAQ + assistant « Une question ? »
   (s'appuie sur les variables de styles.css)
   ========================================================= */

/* ---------- Page FAQ ---------- */
.faq-hero { padding-bottom: 44px; }
.faq-toc {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin-top: 30px;
}
.faq-toc a {
  font-size: 13px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--ink-700); background: var(--bg-card);
  transition: border-color .15s, color .15s;
}
.faq-toc a:hover { border-color: var(--purple-600); color: var(--purple-700); }

.faq-body { padding: 48px 0 88px; }
.faq-group { max-width: 820px; margin: 0 auto 56px; scroll-margin-top: 110px; }
.faq-group:last-child { margin-bottom: 0; }
.faq-group__title { font-size: 32px; margin-bottom: 18px; }

.faq-item { border-bottom: 1px solid var(--line); scroll-margin-top: 110px; }
.faq-item:first-of-type { border-top: 1px solid var(--line); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 20px 2px; cursor: pointer; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary h3 {
  font-family: var(--font-sans); font-size: 16px; font-weight: 500; line-height: 1.4;
  letter-spacing: 0; color: var(--ink-900);
}
.faq-item summary:hover h3 { color: var(--purple-700); }
.faq-item summary:focus-visible { outline: 2px solid var(--purple-600); outline-offset: 2px; border-radius: 4px; }
.faq-item__icon {
  position: relative; flex: 0 0 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--line-strong);
}
.faq-item__icon::before, .faq-item__icon::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 1.5px;
  background: var(--ink-700); transform: translate(-50%, -50%); transition: transform .2s;
}
.faq-item__icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq-item[open] .faq-item__icon { border-color: var(--purple-600); }
.faq-item[open] .faq-item__icon::after { transform: translate(-50%, -50%) rotate(0deg); }
.faq-item__answer { padding: 0 40px 22px 2px; color: var(--ink-700); line-height: 1.7; }
.faq-item__answer p:last-child, .faq-item__answer ul:last-child { margin-bottom: 0; }
.faq-item__answer ul { margin: 0 0 1em; padding-left: 20px; }
.faq-item__answer li { margin-bottom: 4px; }
.faq-item__answer a,
.faqbot-msg--bot a { color: var(--purple-700); text-decoration: underline; text-underline-offset: 2px; }
.faq-item__answer a:hover,
.faqbot-msg--bot a:hover { color: var(--purple-500); }
.faq-item__answer strong { font-weight: 600; color: var(--ink-900); }

@media (max-width: 720px) {
  .faq-group__title { font-size: 26px; }
  .faq-item summary h3 { font-size: 15px; }
  .faq-item__answer { padding-right: 2px; }
}

/* ---------- Assistant : bouton flottant ---------- */
.faqbot { position: fixed; right: 20px; bottom: 20px; z-index: 90; font-family: var(--font-sans); }
.faqbot-launcher {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 18px 12px 15px; border-radius: 999px; border: 0;
  background: var(--navy-900); color: #fff; font-size: 14px; font-weight: 500;
  box-shadow: 0 10px 28px rgba(44, 36, 54, 0.32);
  transition: transform .15s, background .15s;
}
.faqbot-launcher:hover { background: var(--navy-800); transform: translateY(-1px); }
.faqbot-launcher:focus-visible { outline: 2px solid var(--purple-500); outline-offset: 3px; }
.faqbot-launcher svg { color: var(--purple-200); }
.faqbot.is-open .faqbot-launcher { display: none; }

/* Laisse la place au bandeau cookies tant que le visiteur n'a pas choisi */
@media (max-width: 1240px) {
  body:has(.cookie-banner:not([hidden])) .faqbot { display: none; }
}

/* ---------- Assistant : panneau ---------- */
.faqbot-panel {
  display: flex; flex-direction: column;
  width: min(390px, calc(100vw - 32px));
  height: min(580px, calc(100vh - 40px));
  background: var(--bg-card); color: var(--ink-900);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(20, 22, 43, 0.25);
  overflow: hidden;
}
.faqbot-panel[hidden] { display: none; }

.faqbot-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 16px 16px 20px; background: var(--navy-900); color: #fff;
}
.faqbot-head__title { font-family: var(--font-serif); font-size: 22px; line-height: 1.1; }
.faqbot-head__sub { font-size: 12px; color: var(--purple-200); margin-top: 3px; }
.faqbot-close {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2); background: transparent; color: #fff;
}
.faqbot-close:hover { border-color: #fff; }

.faqbot-log {
  position: relative; flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
  background: var(--bg);
}
.faqbot-msg { max-width: 92%; font-size: 14px; line-height: 1.55; }
.faqbot-msg p { margin: 0 0 .6em; }
.faqbot-msg p:last-child, .faqbot-msg ul:last-child { margin-bottom: 0; }
.faqbot-msg ul { margin: 0 0 .6em; padding-left: 18px; }
.faqbot-msg li { margin-bottom: 3px; }
.faqbot-msg strong { font-weight: 600; }
.faqbot-msg--bot {
  align-self: flex-start; background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 4px 14px 14px 14px; padding: 12px 14px; color: var(--ink-700);
}
.faqbot-msg--user {
  align-self: flex-end; background: var(--purple-700); color: #fff;
  border-radius: 14px 4px 14px 14px; padding: 9px 13px; white-space: pre-wrap; overflow-wrap: anywhere;
}
.faqbot-msg__q { font-weight: 600; color: var(--ink-900); margin-bottom: 6px; }
.faqbot-msg__more { margin-top: .8em !important; font-size: 12px; color: var(--ink-500); text-transform: uppercase; letter-spacing: .08em; }

.faqbot-chips { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 8px; }
.faqbot-chip {
  text-align: left; font-size: 13px; line-height: 1.35;
  padding: 7px 12px; border-radius: 10px;
  border: 1px solid var(--purple-200); background: var(--purple-100); color: var(--purple-700);
  transition: border-color .15s, background .15s;
}
.faqbot-chip:hover { border-color: var(--purple-600); background: #ece0f7; }

.faqbot-form {
  display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--bg-card);
}
.faqbot-form input {
  flex: 1; min-width: 0; font: inherit; font-size: 16px; /* 16px : évite le zoom auto sur iOS */
  padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: #fff; color: var(--ink-900);
}
.faqbot-form input:focus { outline: none; border-color: var(--purple-600); box-shadow: 0 0 0 3px var(--purple-100); }
.faqbot-send {
  display: grid; place-items: center; width: 44px; border-radius: 10px; border: 0;
  background: var(--navy-900); color: #fff;
}
.faqbot-send:hover { background: var(--navy-800); }

.faqbot-foot {
  display: flex; justify-content: center; gap: 8px; padding: 0 12px 10px;
  background: var(--bg-card); font-size: 11.5px; color: var(--ink-500);
}
.faqbot-foot a { color: var(--purple-700); text-decoration: underline; text-underline-offset: 2px; }

.faqbot-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Mobile : bouton rond, panneau quasi plein écran */
@media (max-width: 720px) {
  .faqbot { right: 14px; bottom: 14px; }
  .faqbot-launcher { padding: 14px; }
  .faqbot-launcher__label { display: none; }
  .faqbot.is-open { left: 8px; right: 8px; bottom: 8px; top: 8px; }
  .faqbot-panel { width: 100%; height: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .faqbot-launcher, .faq-item__icon::before, .faq-item__icon::after { transition: none; }
}
