/* ChatBot vitrine — chapitre 3.3 du CDC.
   Reprend les variables de charte définies dans main.css (:root) pour rester
   aligné sur l'identité DigiCom : bleu nuit #070534, jaune #ffb900. */

.chatbot {
  position: fixed;
  right: 20px;
  bottom: 90px; /* au-dessus du bouton « retour en haut » du gabarit Scout */
  z-index: 1040;
  font-size: 0.9rem;
}

.chatbot-toggle {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background-color: var(--heading-color, #070534);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  box-shadow: 0 6px 20px rgba(7, 5, 52, 0.28);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.chatbot-toggle:hover,
.chatbot-toggle:focus-visible {
  background-color: var(--accent-color, #ffb900);
  color: var(--heading-color, #070534);
  transform: translateY(-2px);
}

.chatbot.est-ouvert .chatbot-toggle {
  display: none;
}

.chatbot-panneau {
  display: flex;
  flex-direction: column;
  width: 340px;
  max-width: calc(100vw - 40px);
  height: 460px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(7, 5, 52, 0.25);
}

.chatbot-entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background-color: var(--heading-color, #070534);
  color: #fff;
  font-weight: 600;
}

.chatbot-fermer {
  border: 0;
  background: transparent;
  color: #fff;
  line-height: 1;
  padding: 4px;
}

.chatbot-fil {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #f7f8fc;
}

.chatbot-message {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.chatbot-message.est-visiteur {
  align-items: flex-end;
}

.chatbot-bulle {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 12px;
  background: #fff;
  color: var(--default-color, #2d3150);
  box-shadow: 0 1px 3px rgba(7, 5, 52, 0.1);
  white-space: pre-line; /* le catalogue de services répond sur plusieurs lignes */
}

.chatbot-message.est-visiteur .chatbot-bulle {
  background-color: var(--heading-color, #070534);
  color: #fff;
}

.chatbot-message.est-attente .chatbot-bulle {
  opacity: 0.55;
  letter-spacing: 2px;
}

.chatbot-heure {
  margin-top: 3px;
  font-size: 0.72rem;
  color: #8a8fa8;
}

.chatbot-actions {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chatbot-action {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  background-color: var(--accent-color, #ffb900);
  color: var(--heading-color, #070534);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.chatbot-action:hover {
  filter: brightness(0.94);
  color: var(--heading-color, #070534);
}

.chatbot-saisie {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #e6e8f0;
  background: #fff;
}

.chatbot-saisie input {
  flex: 1;
  border: 1px solid #d9dcea;
  border-radius: 999px;
  padding: 8px 14px;
  outline: none;
}

.chatbot-saisie input:focus {
  border-color: var(--accent-color, #ffb900);
}

.chatbot-saisie button {
  border: 0;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  background-color: var(--heading-color, #070534);
  color: #fff;
}

@media (max-width: 480px) {
  .chatbot {
    right: 12px;
    bottom: 76px;
  }

  .chatbot-panneau {
    width: calc(100vw - 24px);
    height: 60vh;
  }
}
