/* ===== Asistente de IBP (widget flotante) ===== */

.asistente {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9998;
  font-family: 'Instrument Sans', 'DM Sans', system-ui, sans-serif;
}

.asistente-lanzador {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border: 0;
  border-radius: 999px;
  background: #0E7A5F;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 18px 34px -18px rgba(14,122,95,.9);
  transition: transform .3s ease, background-color .3s ease, box-shadow .3s ease;
}
.asistente-lanzador::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #8FE3A6;
  box-shadow: 0 0 0 3px rgba(143,227,166,.25);
}
.asistente-lanzador:hover { background: #0A5A46; transform: translateY(-2px); }
.asistente-lanzador:focus-visible { outline: 2px solid #8FE3A6; outline-offset: 3px; }

.asistente[data-abierto="true"] .asistente-lanzador { display: none; }

.asistente-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 40px);
  overflow: hidden;
  border: 1px solid #DDE6E1;
  border-radius: 18px;
  background: #FFFFFF;
  box-shadow: 0 34px 70px -28px rgba(15,40,31,.45);
}
.asistente-panel[hidden] { display: none; }

.asistente-cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: #0E7A5F;
  color: #FFFFFF;
}
.asistente-titulo { display: flex; flex-direction: column; gap: 2px; }
.asistente-titulo strong { font-size: 15px; font-weight: 600; }
.asistente-titulo span { font-size: 12px; opacity: .85; }

.asistente-cerrar {
  border: 0;
  background: rgba(255,255,255,.14);
  color: #FFFFFF;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.asistente-cerrar:hover { background: rgba(255,255,255,.26); }

.asistente-hilo {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  overflow-y: auto;
  background: #FAFCFB;
}

.asistente-burbuja {
  max-width: 84%;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-line;
}
.asistente-bot {
  align-self: flex-start;
  background: #FFFFFF;
  border: 1px solid #DDE6E1;
  color: #26313D;
  border-bottom-left-radius: 4px;
}
.asistente-yo {
  align-self: flex-end;
  background: #0E7A5F;
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}
.asistente-pensando { color: #6B7A86; font-style: italic; }

.asistente-acciones {
  align-self: flex-start;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 4px 0 2px;
}
.asistente-acciones .ibp-btn { padding: 10px 18px; font-size: 14px; }
.asistente-correo { font-size: 13px; color: #0E7A5F; }

.asistente-form {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #E6EBE9;
  background: #FFFFFF;
}
.asistente-campo {
  flex: 1 1 auto;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid #DDE6E1;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  color: #1B2530;
  background: #FAFCFB;
}
.asistente-campo:focus {
  outline: none;
  border-color: #0E7A5F;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(14,122,95,.14);
}
.asistente-enviar {
  padding: 11px 18px;
  border: 0;
  border-radius: 10px;
  background: #0E7A5F;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.asistente-enviar:hover { background: #0A5A46; }
.asistente-enviar:disabled { opacity: .6; cursor: progress; }

.asistente-pie {
  padding: 0 14px 12px;
  background: #FFFFFF;
  font-size: 12px;
}
.asistente-pie a { color: #6B7A86; text-decoration: underline; }

@media (max-width: 520px) {
  .asistente { right: 12px; bottom: 12px; left: 12px; }
  .asistente-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    height: calc(100vh - 24px);
    max-height: none;
  }
  .asistente-lanzador { width: 100%; justify-content: center; }
}
