/* ── BOT BEN — SOS FONTE ─────────────────────────────────── */

/* ── TRIGGER BUTTON ── */
#ben-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #FF5A00;
  border: none;
  cursor: pointer;
  z-index: 9998;
  box-shadow: 0 4px 20px rgba(255,90,0,0.45);
  padding: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.35s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
#ben-trigger:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(255,90,0,0.55);
}
#ben-trigger img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
/* .ben-notif retiré du trigger : voyant vert uniquement dans le header du chat */

/* ── POPUP INVITATION ── */
#ben-popup {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 290px;
  background: #111214;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  z-index: 9997;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 40px 14px 14px;
  cursor: pointer;
  transform: translateY(16px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s ease;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#ben-popup.ben-popup-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}
#ben-popup img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #FF5A00;
  flex-shrink: 0;
}
#ben-popup p {
  flex: 1;
  font-size: 13px;
  color: #E5E7EB;
  line-height: 1.45;
  margin: 0;
}
#ben-popup p strong { color: #FF5A00; }
#ben-popup-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: #6B7280;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s;
}
#ben-popup-close:hover { color: #F2F2F2; }

/* ── WIDGET WINDOW ── */
#ben-widget {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  height: 520px;
  background: #0D0D0F;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  border: 1px solid rgba(255,255,255,0.07);
  transform: scale(0.92) translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s ease;
}
#ben-widget.ben-open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* ── HEADER ── */
.ben-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px 14px;
  background: #111214;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.ben-header-img-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}
.ben-header-img-wrap img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #FF5A00;
  position: absolute;
  top: 0; left: 0;
  transition: opacity 0.3s ease;
}
.ben-header-img-wrap img.ben-img-hidden {
  opacity: 0;
}
.ben-header-info { flex: 1; }
.ben-header-info strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #F2F2F2;
  line-height: 1.3;
}
.ben-header-info span {
  font-size: 12px;
  color: #6B7280;
  font-weight: 400;
}
.ben-status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  margin-right: 5px;
  vertical-align: middle;
}
.ben-status-dot.offline { background: #6B7280; }
.ben-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #6B7280;
  font-size: 20px;
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.ben-close-btn:hover { color: #F2F2F2; background: rgba(255,255,255,0.06); }

/* ── MESSAGES BODY ── */
.ben-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  scroll-behavior: smooth;
  min-height: 80px;
}
.ben-body::-webkit-scrollbar { width: 4px; }
.ben-body::-webkit-scrollbar-track { background: transparent; }
.ben-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* Bubbles */
.ben-bubble {
  max-width: 84%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.5;
  font-weight: 400;
  word-break: break-word;
  animation: benFadeUp 0.22s ease;
}
@keyframes benFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ben-bubble.bot {
  background: #1A1D20;
  color: #E5E7EB;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.ben-bubble.user {
  background: #FF5A00;
  color: white;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

/* Typing indicator */
.ben-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 10px 14px;
  background: #1A1D20;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  animation: benFadeUp 0.22s ease;
}
.ben-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #6B7280;
  animation: benDot 1.2s infinite;
}
.ben-typing span:nth-child(2) { animation-delay: 0.2s; }
.ben-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes benDot {
  0%, 60%, 100% { transform: translateY(0); background: #6B7280; }
  30% { transform: translateY(-5px); background: #FF5A00; }
}

/* CTA blocks inside bubbles */
.ben-cta-block {
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 290px;
  animation: benFadeUp 0.22s ease;
}
.ben-cta-phone {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FF5A00;
  color: white;
  border-radius: 10px;
  padding: 12px 16px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  transition: opacity 0.2s;
}
.ben-cta-phone:hover { opacity: 0.88; }
.ben-cta-wa {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #25D366;
  color: white;
  border-radius: 10px;
  padding: 12px 16px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  transition: opacity 0.2s;
}
.ben-cta-wa:hover { opacity: 0.88; }

/* ── FOOTER ── */
.ben-footer {
  padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: #111214;
  overflow-y: auto;
  overscroll-behavior: contain;
  max-height: 210px;
}

/* Choice buttons */
.ben-choices {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ben-choice-btn {
  background: #1A1D20;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 9px;
  color: #E5E7EB;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 12px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: inherit;
}
.ben-choice-btn:hover {
  background: #FF5A00;
  border-color: #FF5A00;
  color: white;
}

/* Text input area */
.ben-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.ben-input-row textarea {
  flex: 1;
  background: #1A1D20;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #E5E7EB;
  font-size: 13px;
  font-family: inherit;
  padding: 10px 12px;
  resize: none;
  height: 42px;
  max-height: 100px;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.2s;
}
.ben-input-row textarea:focus { border-color: #FF5A00; }
.ben-input-row textarea::placeholder { color: #4B5563; }
.ben-send-btn {
  background: #FF5A00;
  border: none;
  border-radius: 10px;
  color: white;
  width: 42px;
  height: 42px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.ben-send-btn:hover { opacity: 0.85; }
.ben-send-btn svg { width: 18px; height: 18px; }

/* Form fields */
.ben-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ben-form input {
  background: #1A1D20;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #E5E7EB;
  font-size: 13px;
  font-family: inherit;
  padding: 10px 12px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.ben-form input:focus { border-color: #FF5A00; }
.ben-form input::placeholder { color: #4B5563; }
.ben-submit-btn {
  background: #FF5A00;
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  padding: 11px 16px;
  cursor: pointer;
  transition: opacity 0.2s;
  width: 100%;
  margin-top: 2px;
}
.ben-submit-btn:hover { opacity: 0.88; }

/* Link in bubble */
.ben-bubble a.ben-page-link {
  color: #FF5A00;
  font-weight: 600;
  text-decoration: underline;
}

/* ── STICKERS ── */
/* PNGs exportés avec canal alpha (rembg) — fond 100% transparent */
.ben-sticker-wrap {
  align-self: flex-start;
  line-height: 0;
  animation: benFadeUp 0.28s ease;
}
.ben-sticker {
  width: 160px;
  height: auto;
  display: block;
  object-fit: contain;
  /* drop-shadow pour l'effet floating sans fond visible */
  filter: drop-shadow(0 3px 10px rgba(0,0,0,0.35));
}

/* ── FIELD ERRORS ── */
.ben-field-error {
  font-size: 11px;
  color: #ef4444;
  display: none;
  padding-left: 4px;
  font-family: inherit;
}
.ben-form input[style*="border-color: rgb(239, 68, 68)"],
.ben-form input[style*="border-color:#ef4444"] {
  background: rgba(239,68,68,0.05);
}

/* ── COUNTDOWN ── */
.ben-countdown {
  align-self: center;
  font-size: 11px;
  color: #6B7280;
  background: transparent !important;
  padding: 2px 6px !important;
  border-radius: 20px;
  animation: none !important;
}

/* ── MOBILE ── */
@media (max-width: 480px) {
  #ben-widget {
    width: 100vw;
    height: 85vh;
    bottom: 0;
    right: 0;
    border-radius: 20px 20px 0 0;
  }
  #ben-trigger {
    bottom: 16px;
    right: 16px;
  }
  #ben-popup {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 90px;
  }
}
