/* ==========================================================================
   FCARBot — widget de chat (31/08/2026)

   Paleta de la web: fondo #0B0B0D, paneles #141417/#1A1A1E, líneas #33333A,
   rojo de marca #E4000E. Tipografía Sora, ya autoalojada.

   Va en su propio archivo (no en styles.css) porque solo se carga cuando el
   chatbot está encendido: si algún día se apaga, no se descarga ni un byte.
   ========================================================================== */

.fcb,
.fcb * { box-sizing: border-box; }

.fcb {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9000;
  font-family: var(--font-body, "Sora", system-ui, sans-serif);
}

/* ---------- Burbuja ---------- */
.fcb__abrir {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 22px 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--accent, #e4000e);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 34px -10px rgba(228, 0, 14, .6);
  transition: transform .16s ease, background-color .16s ease;
}
.fcb__abrir:hover { transform: translateY(-2px); background: #ff2a38; }
.fcb__abrir svg { flex: 0 0 auto; }

/* Las ondas de radar, el motivo de firma de la marca */
.fcb__abrir::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 2px solid rgba(228, 0, 14, .5);
  animation: fcb-radar 2.8s ease-out infinite;
  pointer-events: none;
}
@keyframes fcb-radar {
  0%   { transform: scale(1);    opacity: .7; }
  70%  { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1.25); opacity: 0; }
}
.fcb__abrir { position: relative; }
.fcb.is-abierto .fcb__abrir { display: none; }

/* ---------- Panel ---------- */
.fcb__panel {
  display: none;
  width: min(92vw, 400px);
  height: min(78vh, 620px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #33333a;
  border-radius: 16px;
  background: #141417;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .8);
}
.fcb.is-abierto .fcb__panel { display: flex; }

.fcb__cab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #242429;
  background: #0b0b0d;
}
.fcb__avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent, #e4000e);
  color: #fff;
}
.fcb__cab strong { display: block; color: #fff; font-size: 15px; font-weight: 700; }
.fcb__cab small  { display: block; color: #8f9199; font-size: 12px; }
.fcb__cab-acc { display: flex; gap: 4px; margin-left: auto; }
.fcb__ico {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8f9199;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.fcb__ico:hover { background: #1f1f24; color: #fff; }

/* ---------- Mensajes ---------- */
.fcb__msgs {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: #33333a transparent;
}
.fcb__msgs::-webkit-scrollbar { width: 8px; }
.fcb__msgs::-webkit-scrollbar-thumb { border-radius: 8px; background: #33333a; }

.fcb__msg {
  max-width: 86%;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.fcb__msg--bot {
  align-self: flex-start;
  border: 1px solid #2a2a30;
  border-bottom-left-radius: 4px;
  background: #1a1a1e;
  color: #cbcdd3;
}
.fcb__msg--yo {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: var(--accent, #e4000e);
  color: #fff;
}
.fcb__msg--err {
  align-self: stretch;
  max-width: 100%;
  border: 1px solid rgba(228, 0, 14, .35);
  background: rgba(228, 0, 14, .08);
  color: #ffb3b8;
  font-size: 13.5px;
}
.fcb__msg a { color: inherit; text-decoration: underline; }

/* Puntitos de "escribiendo" */
.fcb__pensando { display: flex; gap: 5px; align-self: flex-start; padding: 14px 16px; }
.fcb__pensando i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #55565e;
  animation: fcb-latir 1.3s ease-in-out infinite;
}
.fcb__pensando i:nth-child(2) { animation-delay: .18s; }
.fcb__pensando i:nth-child(3) { animation-delay: .36s; }
@keyframes fcb-latir {
  0%, 60%, 100% { transform: translateY(0);    opacity: .45; }
  30%           { transform: translateY(-5px); opacity: 1; }
}

/* ---------- Sugerencias de arranque ---------- */
.fcb__sug { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 4px; }
.fcb__sug button {
  padding: 8px 14px;
  border: 1px solid #33333a;
  border-radius: 999px;
  background: #1a1a1e;
  color: #cbcdd3;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.fcb__sug button:hover { border-color: var(--accent, #e4000e); color: #fff; }

/* ---------- Barra de escritura ---------- */
.fcb__pie { border-top: 1px solid #242429; background: #0b0b0d; padding: 12px 14px 10px; }
.fcb__fila { display: flex; align-items: flex-end; gap: 8px; }
.fcb__campo {
  flex: 1;
  max-height: 110px;
  padding: 11px 14px;
  border: 1px solid #33333a;
  border-radius: 12px;
  background: #141417;
  color: #fff;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.45;
  resize: none;
}
.fcb__campo::placeholder { color: #6b6d75; }
.fcb__campo:focus { outline: none; border-color: var(--accent, #e4000e); }
.fcb__enviar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 12px;
  background: var(--accent, #e4000e);
  color: #fff;
  cursor: pointer;
  transition: background-color .15s ease;
}
.fcb__enviar:hover:not(:disabled) { background: #ff2a38; }
.fcb__enviar:disabled { opacity: .4; cursor: default; }

.fcb__aviso { margin: 9px 2px 0; color: #6b6d75; font-size: 11px; line-height: 1.4; }
.fcb__aviso a { color: #8f9199; }

/* ---------- Móvil: a pantalla casi completa ---------- */
@media (max-width: 560px) {
  .fcb { right: 14px; bottom: 14px; left: 14px; }
  .fcb__abrir { width: 100%; justify-content: center; }
  .fcb__panel { width: 100%; height: min(84vh, 640px); }
}

@media (prefers-reduced-motion: reduce) {
  .fcb__abrir::before,
  .fcb__pensando i { animation: none; }
  .fcb__abrir:hover { transform: none; }
}
