/* B.EASE Chat Widget v1.1 */
:root {
  --bc-red: #E8001D;
  --bc-dark: #111111;
  --bc-white: #ffffff;
  --bc-grey: #f4f4f4;
  --bc-border: #e0e0e0;
  --bc-radius: 16px;
  --bc-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

/* ── Bouton flottant ── */
#bease-chat-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 99998;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bc-red);
  border: none;
  cursor: pointer;
  box-shadow: var(--bc-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
#bease-chat-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 36px rgba(232,0,29,0.35);
}
#bease-chat-btn svg { width: 28px; height: 28px; fill: white; }
#bc-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--bc-dark);
  color: white;
  font-size: 11px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
}

/* ── Fenêtre ── */
#bease-chat-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  z-index: 99999;
  width: 370px;
  max-width: calc(100vw - 40px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: var(--bc-white);
  border-radius: var(--bc-radius);
  box-shadow: var(--bc-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s;
}
#bease-chat-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* ── Header ── */
#bc-header {
  background: var(--bc-dark);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}
#bc-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bc-red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: white;
  flex-shrink: 0;
}
#bc-header-info { flex: 1; }
#bc-header-name { color: white; font-weight: 700; font-size: 14px; line-height: 1.2; }
#bc-header-status {
  color: #aaa;
  font-size: 11px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 5px;
}
#bc-header-status::before {
  content: '';
  width: 6px; height: 6px;
  background: #4caf50;
  border-radius: 50%;
  display: inline-block;
}
#bc-close {
  background: none; border: none; cursor: pointer;
  padding: 4px; color: #888; transition: color 0.2s;
}
#bc-close:hover { color: white; }
#bc-close svg { width: 18px; height: 18px; }

/* ── Messages ── */
#bc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  scroll-behavior: smooth;
}
#bc-messages::-webkit-scrollbar { width: 4px; }
#bc-messages::-webkit-scrollbar-thumb { background: var(--bc-border); border-radius: 2px; }

.bc-msg {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
  animation: bc-pop 0.2s ease;
}
@keyframes bc-pop {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.bc-msg.bot {
  background: var(--bc-grey);
  color: var(--bc-dark);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.bc-msg.user {
  background: var(--bc-red);
  color: white;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.bc-msg a { color: inherit; text-decoration: underline; }

/* Typing */
.bc-typing {
  display: flex; gap: 5px; align-items: center;
  padding: 11px 14px;
  background: var(--bc-grey);
  border-radius: 14px; border-bottom-left-radius: 4px;
  align-self: flex-start; width: fit-content;
}
.bc-typing span {
  width: 7px; height: 7px;
  background: #bbb; border-radius: 50%;
  animation: bc-bounce 1.2s infinite;
}
.bc-typing span:nth-child(2) { animation-delay: 0.2s; }
.bc-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bc-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%           { transform: translateY(-6px); }
}

/* ── Qualification ── */
.bc-qual-block {
  align-self: flex-start;
  max-width: 90%;
  animation: bc-pop 0.2s ease;
}
.bc-qual-label {
  font-size: 12px;
  color: #888;
  margin-bottom: 6px;
  padding-left: 2px;
}
.bc-qual-btns {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.bc-qual-btn {
  padding: 6px 13px;
  border: 1.5px solid var(--bc-dark);
  border-radius: 20px;
  background: white;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.bc-qual-btn:hover, .bc-qual-btn.selected {
  background: var(--bc-dark);
  color: white;
}

/* ── Zone escalade ── */
#bc-escalade {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--bc-border);
  background: #fafafa;
  flex-shrink: 0;
}
#bc-escalade.visible { display: flex; }
#bc-escalade-title {
  font-size: 12px;
  color: #888;
  font-weight: 600;
  text-align: center;
  margin-bottom: 2px;
}
#bc-escalade-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.bc-esc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 10px;
  border-radius: 10px;
  border: none;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s, transform 0.12s;
  font-family: inherit;
}
.bc-esc-btn:hover { filter: brightness(0.9); transform: scale(1.02); }
.bc-esc-btn.wa        { background: #25D366; color: white; }
.bc-esc-btn.messenger { background: #006AFF; color: white; }
.bc-esc-btn.instagram { background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); color: white; }
.bc-esc-btn.calendly  { background: #006BFF; color: white; }
.bc-esc-btn.email-toggle { background: var(--bc-dark); color: white; }

/* ── Mini-form email ── */
#bc-email-form {
  display: none;
  flex-direction: column;
  gap: 7px;
  padding-top: 4px;
  animation: bc-pop 0.2s ease;
}
#bc-email-form.visible { display: flex; }
#bc-email-form input {
  border: 1px solid var(--bc-border);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
#bc-email-form input:focus { border-color: var(--bc-red); }
#bc-email-submit {
  background: var(--bc-red);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 9px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
#bc-email-submit:hover { background: #c5001a; }
#bc-email-submit:disabled { background: #ccc; cursor: not-allowed; }
#bc-form-success {
  font-size: 13px;
  color: #2e7d32;
  text-align: center;
  font-weight: 600;
  display: none;
  padding: 6px 0;
}

/* ── Input ── */
#bc-input-area {
  border-top: 1px solid var(--bc-border);
  padding: 11px 13px;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  background: white;
}
#bc-input {
  flex: 1;
  border: 1px solid var(--bc-border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13.5px;
  outline: none;
  resize: none;
  font-family: inherit;
  min-height: 38px;
  max-height: 90px;
  line-height: 1.4;
  transition: border-color 0.2s;
}
#bc-input:focus { border-color: var(--bc-red); }
#bc-input:disabled { background: #f8f8f8; }
#bc-send {
  background: var(--bc-red);
  border: none;
  border-radius: 10px;
  width: 38px; height: 38px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
}
#bc-send:hover { background: #c5001a; transform: scale(1.05); }
#bc-send:disabled { background: #ccc; cursor: not-allowed; transform: none; }
#bc-send svg { width: 17px; height: 17px; fill: white; }

/* ── Mobile ── */
@media (max-width: 480px) {
  #bease-chat-window {
    bottom: 0; right: 0; left: 0;
    width: 100%; max-width: 100%;
    border-radius: var(--bc-radius) var(--bc-radius) 0 0;
    height: 78vh;
  }
  #bease-chat-btn { bottom: 20px; right: 20px; }
  #bc-escalade-btns { grid-template-columns: 1fr 1fr; }
}
