/* Felix — widget front-office Brico-Phone (namespace .bpf-*) */

#bpfelix-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.bpf-fab {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  background: #f0913b;
  color: #4a2c10;
  font-weight: 800;
  font-size: 15px;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .24);
}

.bpf-fab:hover {
  transform: scale(1.04);
}

.bpf-fab-ic {
  width: 24px;
  height: 24px;
  display: inline-block;
}

.bpf-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 380px;
  max-width: calc(100vw - 24px);
  height: 560px;
  max-height: calc(100vh - 40px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
  display: none;
  flex-direction: column;
  overflow: hidden;
  color: #1f2937;
}

.bpf-widget.open {
  display: flex;
}

.bpf-head {
  background: #f0913b;
  color: #4a2c10;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bpf-ava {
  width: 34px;
  height: 34px;
  flex: none;
}

.bpf-ava-s {
  width: 28px;
  height: 28px;
  flex: none;
}

/* Pièce jointe d'un conseiller : vignette cliquable (image) ou pastille
   explicite (PDF), plutôt qu'un lien portant le nom du fichier. */
.bpf-file {
  display: block;
  margin-top: 6px;
  text-decoration: none;
  color: inherit;
  border: 1px solid #e2e5ea;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  max-width: 240px;
}
.bpf-file:hover { border-color: #f0913b; }
.bpf-file-img img {
  display: block;
  width: 100%;
  height: 180px;
  max-height: 180px;
  object-fit: contain; /* pas `cover` : une capture verticale ou un bordereau A4
                          doit rester lisible, pas recadré en bande centrale */
  background: #f2f3f5;
}
/* .bpf-b a (spécificité 0,1,1) l'emporterait sur .bpf-file (0,1,0) : la
   pastille héritait de la couleur et du gras des liens, et se soulignait au
   survol face au a:hover des thèmes. */
.bpf-b a.bpf-file,
.bpf-b a.bpf-file:hover {
  color: inherit;
  font-weight: 400;
  text-decoration: none;
}
.bpf-file-nom {
  display: block;
  padding: 6px 9px;
  font-size: 12px;
  line-height: 1.35;
  color: #5a6067;
  word-break: break-word;
}
.bpf-file-doc { display: flex; align-items: center; gap: 8px; padding: 9px 11px; max-width: 260px; }
.bpf-file-doc .bpf-file-ic { font-size: 20px; flex: none; }
.bpf-file-doc .bpf-file-nom { padding: 0; flex: 1; font-size: 12.5px; color: #1f2430; }
.bpf-file-act {
  flex: none; font-size: 11.5px; font-weight: 700; color: #f0913b;
  border: 1px solid #f0913b; border-radius: 6px; padding: 2px 8px;
}

/* Photo de conseiller : elle doit remplir exactement la place du chat-robot
   (les trois tailles d'avatar), sans déformer ni déborder. */
.bpf-ava-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #eef1f3;
}

.bpf-ava-lg {
  width: 54px;
  height: 54px;
}

.bpf-title {
  font-weight: 800;
  font-size: 14px;
  flex: 1;
}

.bpf-x {
  border: none;
  background: none;
  color: #4a2c10;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.bpf-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  background: #fafafa;
}

.bpf-msg {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: flex-end;
}

.bpf-msg.me {
  flex-direction: row-reverse;
}

.bpf-b {
  max-width: 78%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  background: #f1f2f4;
  color: #1f2937;
  border-bottom-left-radius: 4px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.bpf-b a {
  color: #b45309;
  font-weight: 600;
}

.bpf-msg.me .bpf-b {
  background: #f0913b;
  color: #4a2c10;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 4px;
}

.bpf-typing {
  display: inline-flex;
  gap: 4px;
}

.bpf-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
  animation: bpfb 1.2s infinite;
}

.bpf-typing i:nth-child(2) {
  animation-delay: .15s;
}

.bpf-typing i:nth-child(3) {
  animation-delay: .3s;
}

@keyframes bpfb {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-5px);
  }
}

.bpf-quick {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px 12px 8px;
  background: #fafafa;
}

.bpf-quick button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid #f0913b;
  color: #b45309;
  background: #fff;
  border-radius: 999px;
  padding: 8px 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bpf-imgprev {
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: #6b7280;
}

.bpf-imgprev img {
  height: 32px;
  border-radius: 6px;
}

.bpf-imgprev button {
  border: none;
  background: none;
  color: #6b7280;
  text-decoration: underline;
  cursor: pointer;
  font-size: 12px;
}

.bpf-input {
  border-top: 1px solid #eef0f2;
  background: #fff;
  padding: 10px 12px;
}

.bpf-input textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  resize: none;
  height: 54px;
  padding: 9px 11px;
  font: inherit;
  font-size: 13.5px;
  outline: none;
}

.bpf-input textarea:focus {
  border-color: #f0913b;
}

.bpf-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.bpf-brand {
  font-size: 11px;
  color: #9ca3af;
}

.bpf-act {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bpf-clip {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
}

.bpf-end {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 12px;
  color: #6b7280;
  text-decoration: underline;
}

.bpf-send {
  border: none;
  cursor: pointer;
  background: #f0913b;
  color: #4a2c10;
  font-weight: 800;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
}

.bpf-send:disabled,
.bpf-input textarea:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.bpf-restart {
  border: none;
  cursor: pointer;
  background: #1c2430;
  color: #fff;
  font-weight: 700;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
}

.bpf-rate {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .98);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.bpf-rate.open {
  display: flex;
}

.bpf-rate h3 {
  margin: 12px 0 10px;
  font-size: 15px;
}

.bpf-stars {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.bpf-stars button {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 28px;
  color: #d1d5db;
}

.bpf-stars button.on {
  color: #f59e0b;
}

.bpf-comment {
  width: 100%;
  max-width: 300px;
  height: 64px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 9px;
  font: inherit;
  font-size: 13px;
  resize: none;
  box-sizing: border-box;
}

.bpf-rate-send {
  margin-top: 12px;
  border: none;
  cursor: pointer;
  background: #f0913b;
  color: #4a2c10;
  font-weight: 800;
  border-radius: 8px;
  padding: 8px 16px;
}

/* Chat humain : notes système + formulaire hors-ligne */

.bpf-sys {
  align-self: center;
  text-align: center;
  color: #6b7280;
  font-size: 12px;
  font-style: italic;
  margin: 4px 8px;
}

.bpf-offline {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bpf-offline input,
.bpf-offline textarea {
  border: 1px solid #d5dade;
  border-radius: 8px;
  padding: 8px;
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
}

.bpf-offline textarea {
  height: 72px;
  resize: vertical;
}

.bpf-off-send {
  background: #20c9b7;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px;
  font-weight: 600;
  cursor: pointer;
}

.bpf-off-send:hover {
  background: #1bb3a3;
}
