/* ============================================================
   FormaPro — Widget Chat IA (FormaBot) — Palette VODJO
   ============================================================ */

#formabot-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: 'DM Sans', sans-serif;
  pointer-events: none; /* la zone invisible ne bloque plus les clics sous le widget */
}

#formabot-btn,
#formabot-window:not(.hidden) {
  pointer-events: auto;
}

/* ── Bouton flottant ── */
#formabot-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--kente-gold, #008B15);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,139,21,0.45);
  transition: transform .2s, box-shadow .2s;
  position: relative;
}
#formabot-btn:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(0,139,21,0.5); }
#formabot-btn svg   { width: 26px; height: 26px; fill: #fff; }

#formabot-notif {
  position: absolute;
  top: -2px; right: -2px;
  width: 14px; height: 14px;
  background: #001A72;
  border-radius: 50%;
  border: 2px solid #fff;
  display: none;
}
#formabot-notif.show { display: block; }

/* ── Fenêtre de chat ── */
#formabot-window {
  width: 340px;
  max-height: 480px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 40px rgba(0,26,114,0.20);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  transition: transform .2s ease, opacity .2s ease;
}
#formabot-window.hidden {
  transform: scale(0.85);
  opacity: 0;
  pointer-events: none;
}

/* Header */
#formabot-header {
  background: linear-gradient(135deg, #001A72, #001A72);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
#formabot-avatar {
  width: 36px; height: 36px;
  background: var(--kente-gold, #008B15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
#formabot-header .bot-name  { color: #fff; font-weight: 700; font-size: .9rem; line-height: 1.1; }
#formabot-header .bot-status{ color: rgba(255,255,255,.55); font-size: .73rem; }
#formabot-close {
  margin-left: auto;
  background: none; border: none;
  color: rgba(255,255,255,.5);
  cursor: pointer; font-size: 1.2rem; line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color .15s;
}
#formabot-close:hover { color: #fff; }

/* Messages */
#formabot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #FFFFFF;
}

.fb-msg {
  max-width: 82%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: .84rem;
  line-height: 1.55;
  animation: fb-in .18s ease;
}
@keyframes fb-in { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

.fb-msg.bot {
  background: #fff;
  color: #001A72;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,26,114,.10);
}
.fb-msg.user {
  background: var(--kente-gold, #008B15);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.fb-typing {
  display: flex; gap: 4px; align-items: center;
  padding: 10px 14px;
}
.fb-typing span {
  width: 7px; height: 7px;
  background: #008B15;
  border-radius: 50%;
  animation: fb-bounce 1.2s infinite;
}
.fb-typing span:nth-child(2) { animation-delay: .2s; }
.fb-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes fb-bounce { 0%,80%,100% { transform:scale(0.6); } 40% { transform:scale(1); } }

/* Input */
#formabot-footer {
  padding: 10px 10px 12px;
  border-top: 1px solid rgba(0,26,114,.12);
  display: flex;
  gap: 6px;
  background: #fff;
}
#formabot-input {
  flex: 1;
  border: 1.5px solid rgba(0,26,114,.18);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: .84rem;
  font-family: inherit;
  color: #001A72;
  outline: none;
  resize: none;
  transition: border-color .2s;
  max-height: 80px;
  overflow-y: auto;
}
#formabot-input:focus { border-color: var(--kente-gold, #008B15); }
#formabot-send {
  width: 36px; height: 36px;
  background: var(--kente-gold, #008B15);
  border: none; border-radius: 50%;
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .2s, transform .15s;
}
#formabot-send:hover { background: #006B0F; transform: scale(1.05); }
#formabot-send svg  { width: 16px; height: 16px; fill: #fff; }

/* Suggestions rapides */
#formabot-suggestions {
  display: flex; flex-wrap: wrap; gap: 5px;
  padding: 0 12px 8px;
  background: #FFFFFF;
}
.fb-suggestion {
  background: #fff;
  border: 1px solid rgba(0,26,114,.18);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: .75rem;
  color: #001A72;
  cursor: pointer;
  transition: background .15s;
}
.fb-suggestion:hover { background: rgba(0,139,21,.10); }

/* Mobile */
@media (max-width: 500px) {
  #formabot-bubble { bottom: 16px; right: 16px; }
  #formabot-window { width: calc(100vw - 32px); max-height: 420px; }
}
