/* ══════════════════════════════════════════
   CHATBOT WIDGET — sinistre-incendie.com
   À placer dans /public/chatbot.css
══════════════════════════════════════════ */

#cb-bubble {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 58px; height: 58px;
  background: #B91C1C;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(185,28,28,0.45);
  z-index: 9998;
  animation: cb-pulse 2.5s ease-in-out infinite;
  transition: transform .2s;
}
#cb-bubble:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(185,28,28,0.6); }
#cb-bubble svg { width: 26px; height: 26px; fill: #fff; }

#cb-badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 18px; height: 18px;
  background: #D97706;
  border-radius: 50%;
  border: 2px solid #FAF8F5;
  animation: cb-badge-pulse 1.8s ease-in-out infinite;
}

#cb-tooltip {
  position: fixed;
  bottom: 96px; right: 28px;
  background: #0C0A09;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  white-space: nowrap;
  z-index: 9997;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .3s, transform .3s;
  pointer-events: none;
}
#cb-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px; right: 20px;
  border: 6px solid transparent;
  border-bottom: none;
  border-top-color: #0C0A09;
}
#cb-tooltip.cb-visible { opacity: 1; transform: translateY(0); }

@keyframes cb-pulse {
  0%,100% { box-shadow: 0 4px 20px rgba(185,28,28,0.45); }
  50%      { box-shadow: 0 4px 32px rgba(185,28,28,0.72); }
}
@keyframes cb-badge-pulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.2); }
}

#cb-window {
  position: fixed;
  bottom: 96px; right: 28px;
  width: 364px;
  max-height: 560px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 48px rgba(12,10,9,0.18), 0 2px 12px rgba(12,10,9,0.08);
  z-index: 9999;
  overflow: hidden;
  display: none;
  flex-direction: column;
  border: 1px solid rgba(185,28,28,0.12);
}
#cb-window.cb-open {
  display: flex;
  animation: cb-slide-in .25s ease-out;
}
@keyframes cb-slide-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

#cb-header {
  background: linear-gradient(135deg, #7F1D1D 0%, #B91C1C 100%);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
#cb-avatar {
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
#cb-header-text { flex: 1; }
#cb-header-text strong {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem; font-weight: 700;
  color: #fff; line-height: 1.2;
}
#cb-header-text span { font-size: 0.7rem; color: rgba(255,255,255,0.72); }
.cb-dot-green {
  width: 7px; height: 7px;
  background: #4ADE80; border-radius: 50%;
  box-shadow: 0 0 6px rgba(74,222,128,0.7);
  display: inline-block; margin-right: 4px;
}
#cb-close {
  background: none; border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer; font-size: 1.1rem;
  padding: 4px; flex-shrink: 0;
  transition: color .15s;
}
#cb-close:hover { color: #fff; }

#cb-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #FAFAF9;
  scroll-behavior: smooth;
}

.cb-msg { max-width: 86%; animation: cb-msg-in .2s ease-out; }
.cb-msg.cb-bot { align-self: flex-start; }
.cb-msg.cb-user { align-self: flex-end; }

@keyframes cb-msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cb-bubble-text {
  padding: 10px 13px;
  border-radius: 14px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.865rem;
  line-height: 1.55;
}
.cb-msg.cb-bot .cb-bubble-text {
  background: #fff; color: #0C0A09;
  border: 1px solid #E7E5E4;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.cb-msg.cb-user .cb-bubble-text {
  background: #B91C1C; color: #fff;
  border-bottom-right-radius: 4px;
}

.cb-choices {
  display: flex; flex-direction: column; gap: 7px;
  animation: cb-msg-in .25s ease-out;
}
.cb-choice {
  background: #fff;
  border: 1.5px solid #E7E5E4;
  border-radius: 10px;
  padding: 10px 13px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.83rem; font-weight: 500;
  color: #0C0A09;
  cursor: pointer; text-align: left;
  transition: border-color .15s, background .15s, color .15s;
  display: flex; align-items: flex-start; gap: 8px;
  line-height: 1.38;
}
.cb-choice:hover { border-color: #B91C1C; background: #FEF2F2; color: #B91C1C; }
.cb-choice:disabled { opacity: 0.6; cursor: default; }
.cb-choice.cb-urgence { border-color: #FCD34D; color: #92400E; background: #FFFBEB; }
.cb-choice.cb-urgence:hover { border-color: #B45309; background: #FEF3C7; }
.cb-icon { font-size: 0.95rem; flex-shrink: 0; margin-top: 1px; }

#cb-tel-area {
  display: flex; flex-direction: column; gap: 7px;
  animation: cb-msg-in .25s ease-out;
}
#cb-tel-input {
  border: 1.5px solid #E7E5E4;
  border-radius: 10px;
  padding: 12px 13px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem; color: #0C0A09;
  outline: none; transition: border-color .2s;
  background: #fff; width: 100%;
}
#cb-tel-input:focus { border-color: #B91C1C; box-shadow: 0 0 0 3px rgba(185,28,28,0.08); }
#cb-tel-input.cb-shake { animation: cb-shake .3s ease-out; border-color: #B91C1C; }
@keyframes cb-shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

#cb-tel-send {
  background: #B91C1C; color: #fff;
  border: none; border-radius: 10px;
  padding: 12px 13px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.865rem; font-weight: 600;
  cursor: pointer; transition: background .2s;
  width: 100%;
}
#cb-tel-send:hover { background: #991B1B; }
#cb-tel-send:disabled { background: #E7E5E4; color: #78716C; cursor: default; }

#cb-typing {
  display: none;
  align-self: flex-start;
  padding: 10px 13px;
  background: #fff;
  border: 1px solid #E7E5E4;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  gap: 4px;
  animation: cb-msg-in .2s ease-out;
}
#cb-typing.cb-on { display: flex; }
.cb-typing-dot {
  width: 7px; height: 7px;
  background: #D1CFC9; border-radius: 50%;
  animation: cb-bounce .9s ease-in-out infinite;
}
.cb-typing-dot:nth-child(2) { animation-delay: .15s; }
.cb-typing-dot:nth-child(3) { animation-delay: .3s; }
@keyframes cb-bounce {
  0%,60%,100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

.cb-confirm-wrap {
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  padding: 32px 16px; gap: 14px;
  animation: cb-msg-in .3s ease-out;
}
.cb-confirm-icon { font-size: 2.8rem; }
.cb-confirm-wrap h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem; font-weight: 700; color: #0C0A09;
}
.cb-confirm-wrap p {
  font-size: 0.82rem; color: #78716C;
  line-height: 1.65; max-width: 270px;
}
.cb-confirm-badge {
  border-radius: 6px; padding: 8px 14px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.76rem; font-weight: 500;
}
.cb-confirm-badge.cb-standard { background: #FEF2F2; border: 1px solid #FECACA; color: #B91C1C; }
.cb-confirm-badge.cb-urgent   { background: #FFFBEB; border: 1px solid #FCD34D; color: #92400E; }

#cb-footer {
  padding: 7px 14px 9px;
  text-align: center;
  font-family: 'Outfit', sans-serif;
  font-size: 0.67rem; color: #A8A29E;
  background: #fff;
  border-top: 1px solid #F5F5F4;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  #cb-window {
    right: 0; left: 0; bottom: 0;
    width: 100%; max-height: 90vh;
    border-radius: 20px 20px 0 0;
  }
  #cb-bubble  { bottom: 20px; right: 20px; }
  #cb-tooltip { right: 16px; bottom: 88px; }
}
