/* ICT Asistente. Todo bajo .ictbot para no chocar con el tema.
 * Para adaptarlo a la marca basta con cambiar las variables, p. ej. en
 * Apariencia → Personalizar → CSS adicional:
 *   .ictbot { --ictbot-color: #005a9c; }
 */
.ictbot {
  --ictbot-color: #0b5394;
  --ictbot-texto-sobre-color: #fff;
  --ictbot-fondo: #fff;
  --ictbot-fondo-bot: #f1f3f5;
  --ictbot-texto: #1f2328;
  --ictbot-suave: #6a737d;
  --ictbot-borde: #d0d7de;
  --ictbot-error: #b42318;
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ictbot-texto);
  box-sizing: border-box;
}
.ictbot *, .ictbot *::before, .ictbot *::after { box-sizing: inherit; }

/* ---- burbuja flotante ---- */
.ictbot--flotante { position: fixed; right: 20px; bottom: 20px; z-index: 99999; }
.ictbot__lanzador {
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--ictbot-color); color: var(--ictbot-texto-sobre-color);
  font-size: 24px; box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}
.ictbot__lanzador:focus-visible, .ictbot button:focus-visible,
.ictbot textarea:focus-visible, .ictbot input:focus-visible {
  outline: 2px solid var(--ictbot-color); outline-offset: 2px;
}
.ictbot--flotante .ictbot__panel {
  position: absolute; right: 0; bottom: 70px;
  width: 370px; height: min(560px, calc(100vh - 110px));
  box-shadow: 0 8px 30px rgba(0, 0, 0, .2);
}

/* ---- panel ---- */
.ictbot__panel {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--ictbot-fondo); border: 1px solid var(--ictbot-borde); border-radius: 12px;
}
.ictbot__panel[hidden] { display: none; }
.ictbot--incrustado .ictbot__panel { height: 520px; max-width: 640px; }

.ictbot__cabecera {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--ictbot-color); color: var(--ictbot-texto-sobre-color);
}
.ictbot__titulo { font-weight: 600; }
.ictbot__cerrar {
  border: 0; background: transparent; color: inherit; font-size: 24px; line-height: 1;
  cursor: pointer; padding: 0 4px;
}

.ictbot__mensajes {
  flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px;
}
.ictbot__msg {
  max-width: 85%; padding: 9px 12px; border-radius: 12px;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.ictbot__msg--bot { align-self: flex-start; background: var(--ictbot-fondo-bot); border-bottom-left-radius: 4px; }
.ictbot__msg--cliente {
  align-self: flex-end; background: var(--ictbot-color); color: var(--ictbot-texto-sobre-color);
  border-bottom-right-radius: 4px;
}
.ictbot__msg--escribiendo { color: var(--ictbot-suave); letter-spacing: 2px; }
.ictbot__msg--error { color: var(--ictbot-error); }

/* ---- entrada ---- */
.ictbot__entrada { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--ictbot-borde); }
.ictbot__campo {
  flex: 1; resize: none; min-height: 40px; max-height: 120px; padding: 9px 10px;
  border: 1px solid var(--ictbot-borde); border-radius: 8px; font: inherit; color: inherit; background: #fff;
}
.ictbot__enviar {
  border: 0; border-radius: 8px; padding: 0 14px; min-height: 40px; cursor: pointer;
  background: var(--ictbot-color); color: var(--ictbot-texto-sobre-color); font: inherit; font-weight: 600;
}
.ictbot__enviar:disabled { opacity: .55; cursor: default; }
.ictbot__aviso { margin: 0; padding: 0 12px 10px; font-size: 12px; color: var(--ictbot-suave); }
.ictbot__aviso a, .ictbot__acepta a { color: inherit; text-decoration: underline; }

/* ---- formulario de presupuesto ---- */
.ictbot__solicitud {
  display: flex; flex-direction: column; gap: 8px; padding: 12px;
  border: 1px solid var(--ictbot-borde); border-radius: 10px; background: #fafbfc;
}
.ictbot__fila { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.ictbot__fila input, .ictbot__fila textarea {
  padding: 7px 9px; border: 1px solid var(--ictbot-borde); border-radius: 6px;
  font: inherit; font-size: 14px; color: inherit; background: #fff;
}
.ictbot__fila textarea { min-height: 70px; resize: vertical; }
.ictbot__acepta { font-size: 12px; color: var(--ictbot-suave); }
.ictbot__solicitud .ictbot__enviar { align-self: flex-start; padding: 0 16px; }
.ictbot__trampa { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* ---- móvil: el panel ocupa la pantalla ---- */
@media (max-width: 480px) {
  .ictbot--flotante { right: 16px; bottom: 16px; }
  .ictbot--flotante .ictbot__panel {
    position: fixed; inset: 0; width: auto; height: auto; border-radius: 0; border: 0;
  }
  .ictbot__msg { max-width: 92%; }
}
