/* ── BioFeet Assistente — Widget Styles ─────────────────────────────── */

/* CSS vars injected by frontend.js: --bfav-color, --bfav-right, --bfav-left */

#bfav-root {
  position: fixed;
  right:  var(--bfav-right, 28px);
  left:   var(--bfav-left,  auto);
  bottom: 28px;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  box-sizing: border-box;
}
#bfav-root *, #bfav-root *::before, #bfav-root *::after { box-sizing: border-box; }

#bfav-root img,
.bfav-widget img,
.bfav-launcher img,
.bfav-avatar img,
.bfav-chat-avatar img {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

.bfav-launcher,
.bfav-avatar,
.bfav-chat-avatar {
    overflow: hidden;
}

/* ── Floating button ─────────────────────────────────────────────────── */

.bfav-btn {
  position: relative;
  width: 80px; height: 80px;
  border-radius: 50%!important;
  background: var(--bfav-color, #6c4de6);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,.22);
  transition: transform .2s, box-shadow .2s;
  animation: bfav-pulse 3.2s ease-in-out infinite;
  overflow: visible;
padding:0;
}
.bfav-btn:hover  { transform: scale(1.09); box-shadow: 0 6px 28px rgba(0,0,0,.3); }
.bfav-btn:active { transform: scale(.96); }

@keyframes bfav-pulse {
  0%,100% { box-shadow: 0 4px 20px rgba(0,0,0,.22), 0 0 0 0 rgba(108,77,230,.3); }
  50%      { box-shadow: 0 4px 20px rgba(0,0,0,.22), 0 0 0 10px rgba(108,77,230,.0); }
}

.bfav-btn-inner {
  width: 100px; height: 100px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.bfav-btn-inner svg { fill: #fff; }
.bfav-btn-inner img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.bfav-btn-badge {
  position: absolute; top: 5px; right: 5px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #22c55e; border: 2.5px solid #fff;
}

.bfav-btn-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  background: #1e1743; color: #fff;
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
  padding: 7px 13px;
  border-radius: 9px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s, transform .2s;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
}
.bfav-btn-tooltip::after {
  content: '';
  position: absolute; top: 100%; right: 20px;
  border: 6px solid transparent;
  border-top-color: #1e1743;
}
.bfav-btn:hover .bfav-btn-tooltip { opacity: 1; transform: translateY(0); }

/* ── Panel ───────────────────────────────────────────────────────────── */

.bfav-panel {
  position: absolute;
  bottom: 0; right: 0;
  width: 372px;
  height: 550px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 16px 56px rgba(0,0,0,.18);
  display: flex; flex-direction: column;
  overflow: hidden;
  transform: scale(.86) translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: transform .32s cubic-bezier(.34,1.56,.64,1), opacity .24s ease;
}
.bfav-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* ── Panel header ────────────────────────────────────────────────────── */

.bfav-panel-header {
  background: var(--bfav-color, #6c4de6);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.bfav-panel-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.bfav-panel-avatar svg { fill: #fff; }
.bfav-panel-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.bfav-panel-info  { flex: 1; }
.bfav-panel-name  { display: block; color: #fff; font-weight: 700; font-size: 14px; }
.bfav-panel-status{ color: rgba(255,255,255,.78); font-size: 11.5px; }
.bfav-close-btn {
  background: rgba(255,255,255,.15); border: none; color: #fff;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  font-size: 20px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.bfav-close-btn:hover { background: rgba(255,255,255,.28); }

/* ── Messages area ───────────────────────────────────────────────────── */

.bfav-messages {
  flex: 1; overflow-y: auto;
  padding: 14px 12px;
  display: flex; flex-direction: column; gap: 9px;
  scroll-behavior: smooth;
}
.bfav-messages::-webkit-scrollbar       { width: 4px; }
.bfav-messages::-webkit-scrollbar-track { background: transparent; }
.bfav-messages::-webkit-scrollbar-thumb { background: #e2dff7; border-radius: 4px; }

/* ── Message rows ────────────────────────────────────────────────────── */

.bfav-row { display: flex; align-items: flex-end; gap: 7px; animation: bfav-up .28s ease; }
.bfav-row-user { flex-direction: row-reverse; }

@keyframes bfav-up {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: translateY(0); }
}

.bfav-mini-av {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bfav-color, #6c4de6);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.bfav-mini-av svg { fill: #fff; }
.bfav-mini-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* ── Bubbles ─────────────────────────────────────────────────────────── */

.bfav-bubble {
  max-width: 80%; padding: 10px 14px;
  border-radius: 16px; font-size: 13.5px; line-height: 1.55;
}
.bfav-bubble-bot {
  background: #f0ecff; color: #1e1743;
  border-bottom-left-radius: 4px;
}
.bfav-bubble-bot em { color: var(--bfav-color, #6c4de6); font-style: normal; font-weight: 600; }
.bfav-bubble-user {
  background: var(--bfav-color, #6c4de6); color: #fff;
  border-bottom-right-radius: 4px;
  font-size: 13px;
}

/* ── Typing indicator ────────────────────────────────────────────────── */

.bfav-typing {
  background: #f0ecff; border-radius: 16px; border-bottom-left-radius: 4px;
  padding: 11px 16px; display: flex; gap: 5px; align-items: center;
}
.bfav-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--bfav-color, #6c4de6); opacity: .55;
  animation: bfav-bounce 1.3s ease-in-out infinite;
}
.bfav-typing span:nth-child(2) { animation-delay: .22s; }
.bfav-typing span:nth-child(3) { animation-delay: .44s; }

@keyframes bfav-bounce {
  0%,80%,100% { transform: translateY(0); opacity: .55; }
  40%          { transform: translateY(-6px); opacity: 1; }
}

/* ── Chips ───────────────────────────────────────────────────────────── */

.bfav-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding-left: 33px;
  animation: bfav-up .28s ease;
}
.bfav-chip {
  background: #fff;
  border: 1.5px solid rgba(108,77,230,.2);
  color: var(--bfav-color, #6c4de6);
  border-radius: 20px; padding: 6px 14px;
  font-size: 12.5px; cursor: pointer;
  transition: all .15s; white-space: nowrap;
}
.bfav-chip:hover { background: #f0ecff; border-color: var(--bfav-color, #6c4de6); transform: translateY(-1px); }
.bfav-chip.sel   { background: var(--bfav-color, #6c4de6); color: #fff; border-color: var(--bfav-color, #6c4de6); }

/* ── Results ─────────────────────────────────────────────────────────── */

.bfav-results {
  display: flex; flex-direction: column; gap: 7px;
  padding-left: 33px; animation: bfav-up .28s ease;
}
.bfav-doc-card {
  background: #fff;
  border: 1.5px solid rgba(108,77,230,.15);
  border-radius: 13px; padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; cursor: pointer;
  transition: all .15s;
}
.bfav-doc-card:hover {
  border-color: var(--bfav-color, #6c4de6);
  background: #f9f7ff; transform: translateX(2px);
}
.bfav-doc-av {
  width: 42px; height: 42px; border-radius: 50%;
  background: #f0ecff; border: 2px solid rgba(108,77,230,.15);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
  font-size: 13px; font-weight: 700;
  color: var(--bfav-color, #6c4de6);
}
.bfav-doc-av img { width: 100%; height: 100%; object-fit: cover; }
.bfav-doc-nfo  { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bfav-doc-name { font-size: 13px; font-weight: 700; color: #1e1743; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bfav-doc-loc  { font-size: 11px; color: #6b6b8a; }
.bfav-doc-esp  { font-size: 11px; color: var(--bfav-color, #6c4de6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bfav-doc-arr  { color: #b0a4e8; font-size: 20px; flex-shrink: 0; }

.bfav-view-all {
  display: inline-block;
  margin: 4px 0 0 33px;
  background: var(--bfav-color, #6c4de6); color: #fff;
  text-decoration: none; border-radius: 10px;
  padding: 9px 16px; font-size: 13px; font-weight: 600;
  animation: bfav-up .28s ease; transition: opacity .15s;
}
.bfav-view-all:hover { opacity: .88; color: #fff; }

/* ── Footer ──────────────────────────────────────────────────────────── */

.bfav-panel-footer {
  padding: 10px 12px;
  border-top: 1px solid rgba(108,77,230,.1);
  flex-shrink: 0;
}
.bfav-restart-btn {
  width: 100%; background: none;
  border: 1px solid rgba(108,77,230,.15);
  border-radius: 9px; padding: 8px;
  font-size: 12px; color: #6b6b8a;
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.bfav-restart-btn:hover { border-color: var(--bfav-color, #6c4de6); color: var(--bfav-color, #6c4de6); }

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  #bfav-root { bottom: 16px; right: 16px; left: auto; }
  .bfav-panel { width: calc(100vw - 24px); right: 0; height: 480px; }
}

/* District is typed, followed by locality choices. */
.bfav-district-form { display:flex; flex-wrap:wrap; gap:8px; margin:10px 0 14px 32px; }
.bfav-district-form input { min-width:0; flex:1 1 160px; border:1px solid #d9d2ef; border-radius:12px; padding:12px; font:inherit; background:#fff; color:#282044; }
.bfav-district-form button { border:0; border-radius:12px; padding:10px 14px; background:var(--bfav-color); color:#fff; cursor:pointer; font:inherit; }
.bfav-district-form span { flex-basis:100%; font-size:13px; }
.bfav-district-form :disabled { opacity:.65; cursor:default; }
