/* G2C Assistant : couleurs modifiables ici pour coller à la charte du site. */
.g2ca {
  --g2ca-ink: #1d1d1b;        /* noir du logo : en-tête, bulles du visiteur */
  --g2ca-accent: #3e777f;     /* bleu-vert foncé du logo : boutons d'action */
  --g2ca-accent-light: #8fbec3; /* bleu-vert clair du logo (dégradé du « 2 ») */
  --g2ca-bg: #ffffff;
  --g2ca-soft: #eef5f6;       /* bulles de l'assistant, teinte claire du logo */
  --g2ca-line: #d3e3e5;
  --g2ca-text: #1c2530;
  --g2ca-muted: #5b6878;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99999;
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: var(--g2ca-text);
}
.g2ca *, .g2ca *::before, .g2ca *::after { box-sizing: border-box; }

.g2ca-launcher {
  display: block;
  margin-left: auto;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--g2ca-accent-light) -40%, var(--g2ca-accent) 60%);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(29, 29, 27, .25);
}
.g2ca-open .g2ca-launcher { display: none; }

.g2ca-panel {
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 24px));
  height: min(620px, calc(100vh - 40px));
  background: var(--g2ca-bg);
  border: 1px solid var(--g2ca-line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(29, 29, 27, .2);
}
.g2ca-panel[hidden] { display: none; }

.g2ca-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--g2ca-ink);
  color: #fff;
  border-bottom: 4px solid var(--g2ca-accent);
  border-image: linear-gradient(90deg, var(--g2ca-accent-light), var(--g2ca-accent)) 1;
}
.g2ca-title { margin: 0; font-weight: 700; font-size: 16px; }
.g2ca-sub { margin: 2px 0 0; font-size: 13px; opacity: .85; }
.g2ca-close {
  border: 0; background: transparent; color: #fff;
  font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px;
}

.g2ca-log { flex: 1; overflow-y: auto; padding: 16px; }
.g2ca-notice {
  font-size: 13px; color: var(--g2ca-muted);
  border-left: 3px solid var(--g2ca-line);
  padding-left: 10px; margin-bottom: 14px;
}
.g2ca-notice p { margin: 0 0 6px; }
.g2ca-notice a { color: var(--g2ca-accent); }

.g2ca-chips { display: flex; flex-direction: column; gap: 8px; }
.g2ca-chip {
  text-align: left; font: inherit; font-size: 14px;
  padding: 9px 12px; border-radius: 10px; cursor: pointer;
  background: var(--g2ca-bg); color: var(--g2ca-ink);
  border: 1px solid var(--g2ca-line);
}
.g2ca-chip:hover { border-color: var(--g2ca-accent); }

.g2ca-msg { margin: 0 0 12px; padding: 10px 13px; border-radius: 12px; max-width: 92%; overflow-wrap: anywhere; }
.g2ca-msg p { margin: 0 0 8px; }
.g2ca-msg p:last-child { margin-bottom: 0; }
.g2ca-msg ul { margin: 0 0 8px; padding-left: 18px; }
.g2ca-user { margin-left: auto; background: var(--g2ca-ink); color: #fff; }
.g2ca-bot { background: var(--g2ca-soft); }
.g2ca-err { border: 1px solid #e3b4ad; }
.g2ca-wait { color: var(--g2ca-muted); font-style: italic; }

.g2ca-sources { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--g2ca-line); font-size: 13px; }
.g2ca-sources-title { margin: 0 0 4px; font-weight: 600; color: var(--g2ca-muted); }
.g2ca-sources ul { margin: 0; padding-left: 18px; }
.g2ca-sources a { color: var(--g2ca-accent); }

.g2ca-cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.g2ca-cta a { text-decoration: none; font-weight: 600; font-size: 14px; border-radius: 8px; padding: 7px 12px; }
.g2ca-cta-main { background: var(--g2ca-accent); color: #fff; }
.g2ca-cta-alt { border: 1px solid var(--g2ca-accent); color: var(--g2ca-accent); }

.g2ca-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--g2ca-line); }
.g2ca-input {
  flex: 1; resize: none; font: inherit; font-size: 15px;
  padding: 9px 11px; border: 1px solid var(--g2ca-line); border-radius: 10px;
  color: var(--g2ca-text); background: var(--g2ca-bg);
}
.g2ca-send {
  border: 0; border-radius: 10px; padding: 0 16px; cursor: pointer;
  background: var(--g2ca-accent); color: #fff; font: inherit; font-weight: 600;
}
.g2ca-send:disabled { opacity: .5; cursor: wait; }
.g2ca-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.g2ca button:focus-visible, .g2ca a:focus-visible, .g2ca-input:focus-visible {
  outline: 3px solid var(--g2ca-accent-light); outline-offset: 2px;
}

@media (max-width: 480px) {
  .g2ca { right: 12px; bottom: 12px; }
  .g2ca-open { right: 0; bottom: 0; left: 0; top: 0; }
  .g2ca-open .g2ca-panel { width: 100vw; height: 100%; border-radius: 0; border: 0; }
}

/* Protection contre les styles du thème WordPress */
.g2ca .g2ca-head p, .g2ca .g2ca-log p { padding: 0; }
.g2ca .g2ca-title { margin: 0 !important; line-height: 1.3; }
.g2ca .g2ca-sub { margin: 2px 0 0 !important; line-height: 1.35; }
.g2ca .g2ca-head { padding: 14px 16px !important; }
.g2ca button.g2ca-send {
  border-radius: 10px !important; padding: 0 16px !important; min-height: 0 !important;
  height: auto !important; line-height: 1.2 !important; box-shadow: none !important;
}
.g2ca button.g2ca-close { background: transparent !important; box-shadow: none !important; padding: 0 4px !important; min-height: 0 !important; }
.g2ca textarea.g2ca-input { border: 1px solid var(--g2ca-line) !important; box-shadow: none !important; margin: 0 !important; min-height: 0 !important; }
.g2ca textarea.g2ca-input:focus { border-color: var(--g2ca-accent) !important; outline: none; }
