/* ============================================================
   FondixPay — Bot Widget
   Loaded by bot-widget.js — do not import directly in pages
   that don't load the widget script.
============================================================ */

.bot-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 200;
  width: 68px; height: 68px; border-radius: 50%; border: none; cursor: pointer; padding: 0;
  background: linear-gradient(135deg,#5CB8FF,#1565E8);
  box-shadow: 0 12px 32px rgba(21,101,232,.45), inset 0 1px 0 rgba(255,255,255,.3);
  display: flex; align-items: center; justify-content: center;
  transition: transform .35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .25s;
}
.bot-fab:hover { transform: scale(1.07); box-shadow: 0 18px 40px rgba(21,101,232,.55); }
.bot-fab:active { transform: scale(0.96); }
.bot-fab .bot-svg { width: 44px; height: 44px; will-change: transform; }
.bot-fab .bot-svg .bot-body { transition: transform .25s ease; }
.bot-fab .bot-svg .eye { transform-origin: center; transition: transform .12s ease-out; }
.bot-fab .bot-svg .antenna-dot { animation: bot-blink 2.4s ease-in-out infinite; }

@keyframes bot-blink {
  0%, 80%, 100% { opacity: 1; }
  85%, 92%      { opacity: .3; }
}

.bot-fab .badge {
  position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px;
  padding: 0 4px; border-radius: 99px; background: #EF4444; color: #fff;
  font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: 0 4px 10px rgba(239,68,68,.4);
}

.bot-tooltip {
  position: fixed; right: 100px; bottom: 36px; z-index: 199;
  background: #0A1628; color: #fff; padding: 9px 14px; border-radius: 12px;
  font-size: 13px; font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  box-shadow: 0 8px 22px rgba(10,22,40,.25);
  white-space: nowrap; opacity: 0; transform: translateX(8px); pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.bot-tooltip::after {
  content: ''; position: absolute; right: -6px; top: 50%; transform: translateY(-50%);
  border: 6px solid transparent; border-left-color: #0A1628;
}
.bot-tooltip.show { opacity: 1; transform: translateX(0); }

.bot-panel {
  position: fixed; right: 22px; bottom: 102px; z-index: 201;
  width: 360px; max-width: calc(100vw - 44px); height: 540px; max-height: calc(100vh - 130px);
  background: #fff; border-radius: 20px; border: 1px solid #E2EAF4;
  box-shadow: 0 24px 60px rgba(21,101,232,.25), 0 0 0 1px rgba(10,22,40,.04);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; transform: translateY(20px) scale(.96); pointer-events: none;
  transition: opacity .3s ease, transform .3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.bot-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.bot-header {
  background: linear-gradient(135deg,#1565E8,#0D4FBF); color: #fff;
  padding: 16px 18px; display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.bot-header .av {
  width: 42px; height: 42px; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.bot-header .av svg { width: 30px; height: 30px; }
.bot-header .meta { min-width: 0; }
.bot-header .meta h4 { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bot-header .meta small { font-size: 11px; opacity: .85; display: flex; align-items: center; gap: 6px; }
.bot-header .meta small::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #22C55E; box-shadow: 0 0 6px #22C55E; flex-shrink: 0;
}
.bot-header .close {
  margin-left: auto; background: rgba(255,255,255,.16); border: none; color: #fff;
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background .15s;
}
.bot-header .close:hover { background: rgba(255,255,255,.28); }

.bot-msgs {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px;
  background: #F4F8FF;
}
.bot-msgs::-webkit-scrollbar { width: 6px; }
.bot-msgs::-webkit-scrollbar-thumb { background: #C9DEFF; border-radius: 6px; }

.msg {
  max-width: 80%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.45;
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  word-wrap: break-word;
}
.msg.bot {
  background: #fff; color: #0A1628; border-bottom-left-radius: 4px; align-self: flex-start;
  border: 1px solid #E2EAF4;
}
.msg.user {
  background: linear-gradient(135deg,#3B9BFF,#1565E8); color: #fff;
  border-bottom-right-radius: 4px; align-self: flex-end;
}
.msg.error {
  background: #FEF2F2; color: #991B1B; border: 1px solid #FCA5A5;
  border-bottom-left-radius: 4px; align-self: flex-start;
}
.msg.error button {
  margin-top: 6px; display: block; background: none; border: 1px solid #FCA5A5;
  color: #B91C1C; font-size: 12px; padding: 4px 10px; border-radius: 99px; cursor: pointer;
  font-family: inherit;
}
.msg.error button:hover { background: #FCA5A5; }

.typing {
  display: inline-flex; gap: 4px; padding: 12px 14px; background: #fff; border: 1px solid #E2EAF4;
  border-radius: 14px; border-bottom-left-radius: 4px; align-self: flex-start;
}
.typing span {
  width: 6px; height: 6px; border-radius: 50%; background: #7A95B8;
  animation: bot-typing 1.2s ease-in-out infinite;
}
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .30s; }

@keyframes bot-typing {
  0%,100% { opacity: .3; transform: translateY(0); }
  50%     { opacity: 1; transform: translateY(-3px); }
}

.bot-pills {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 8px; background: #F4F8FF;
  flex-shrink: 0;
}
.sugg-pill {
  background: #fff; border: 1px solid #C9DEFF; color: #1565E8;
  padding: 7px 11px; border-radius: 99px; font-size: 11.5px; cursor: pointer;
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  transition: background .2s, border-color .2s;
}
.sugg-pill:hover { background: #1565E8; color: #fff; border-color: #1565E8; }

.bot-input {
  display: flex; gap: 8px; padding: 12px 14px; background: #fff;
  border-top: 1px solid #E2EAF4; flex-shrink: 0;
}
.bot-input input {
  flex: 1; border: 1px solid #E2EAF4; border-radius: 99px; padding: 10px 16px;
  font-family: 'Bricolage Grotesque', system-ui, sans-serif; font-size: 13.5px;
  outline: none; color: #0A1628; background: #F4F8FF;
}
.bot-input input:focus { border-color: #1565E8; background: #fff; box-shadow: 0 0 0 3px rgba(21,101,232,.12); }
.bot-input button {
  background: linear-gradient(135deg,#3B9BFF,#1565E8); border: none; color: #fff;
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(21,101,232,.35);
  transition: opacity .15s;
}
.bot-input button:disabled { opacity: .5; cursor: not-allowed; }

/* ── Mobile ── */
@media (max-width: 640px) {
  .bot-panel {
    width: calc(100vw - 16px);
    right: 8px;
    bottom: 96px;
    height: 65vh;
    max-height: calc(100vh - 110px);
  }
  .bot-tooltip { right: 90px; bottom: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .bot-fab .bot-svg .antenna-dot { animation: none !important; }
  .typing span { animation: none !important; opacity: 1 !important; }
}
