/* /chatbot/css/chatbot.css — Asistente virtual HPM */
.hpmbot{--bot-azul:#3445DB;--bot-navy:#232B60;--bot-cyan:#6CF0F7;--bot-bg:#f4f6fb;--bot-texto:#141a38;--bot-gris:#64748b;
  position:fixed;right:20px;bottom:20px;z-index:1040;font-family:inherit;color:var(--bot-texto)}
.hpmbot *{box-sizing:border-box}
.hpmbot-launcher{position:relative;width:64px;height:64px;border-radius:50%;border:0;padding:0;background:#fff;cursor:pointer;
  box-shadow:0 8px 24px rgba(35,43,96,.30);transition:transform .2s ease,box-shadow .2s ease;display:grid;place-items:center;animation:hpmbotEntrada .5s ease .3s both}
.hpmbot-launcher img{width:64px;height:64px;border-radius:50%;display:block}
.hpmbot-launcher:hover{transform:translateY(-2px) scale(1.05);box-shadow:0 12px 30px rgba(52,69,219,.38)}
.hpmbot-launcher:focus-visible{outline:3px solid var(--bot-cyan);outline-offset:3px}
.hpmbot-launcher.saluda img{animation:hpmbotSaluda 1.2s ease 2}
@keyframes hpmbotEntrada{from{opacity:0;transform:scale(.6)}to{opacity:1;transform:none}}
@keyframes hpmbotSaluda{0%,100%{transform:rotate(0)}20%{transform:rotate(-10deg)}40%{transform:rotate(9deg)}60%{transform:rotate(-6deg)}80%{transform:rotate(4deg)}}
/* Globo de saludo: aparece solo, no tapa nada y se va solo */
.hpmbot-hint{position:absolute;right:76px;bottom:8px;display:flex;align-items:flex-start;gap:4px;width:232px;background:#fff;color:var(--bot-texto);
  border-radius:16px 16px 4px 16px;box-shadow:0 10px 26px rgba(35,43,96,.22);border:1px solid #e1e6f0;padding:10px 8px 10px 14px;animation:hpmbotHint .35s ease both}
.hpmbot-hint[hidden]{display:none}
.hpmbot-hint-txt{flex:1;border:0;background:none;padding:0;text-align:left;font-size:.88rem;line-height:1.35;color:inherit;cursor:pointer;font-weight:600}
.hpmbot-hint-x{border:0;background:none;color:#94a3b8;font-size:.8rem;line-height:1;padding:2px 4px;cursor:pointer;border-radius:50%}
.hpmbot-hint-x:hover{color:var(--bot-navy);background:#f1f3f8}
.hpmbot.abierto .hpmbot-hint{display:none}
@keyframes hpmbotHint{from{opacity:0;transform:translateX(8px)}to{opacity:1;transform:none}}

.hpmbot-panel{position:absolute;right:0;bottom:78px;width:380px;max-width:calc(100vw - 32px);height:600px;max-height:calc(100vh - 120px);
  background:#fff;border-radius:22px;box-shadow:0 24px 60px rgba(20,26,56,.30);display:flex;flex-direction:column;overflow:hidden;
  animation:hpmbotIn .22s ease both;border:1px solid #e1e6f0}
.hpmbot-panel[hidden]{display:none}
@keyframes hpmbotIn{from{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:none}}
.hpmbot-head{display:flex;align-items:center;gap:10px;padding:12px 12px 12px 14px;background:linear-gradient(135deg,var(--bot-azul),var(--bot-navy));color:#fff}
.hpmbot-avatar{width:44px;height:44px;border-radius:50%;background:#fff;flex:0 0 44px}
.hpmbot-title{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.2}
.hpmbot-title strong{font-size:1rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hpmbot-status{font-size:.78rem;opacity:.92;display:flex;align-items:center;gap:6px}
.hpmbot-status i{width:8px;height:8px;border-radius:50%;background:#3ddc97;display:inline-block;box-shadow:0 0 0 3px rgba(61,220,151,.25)}
.hpmbot.mant .hpmbot-status i{background:#f9a51b;box-shadow:0 0 0 3px rgba(249,165,27,.25)}
.hpmbot-icon{border:0;background:rgba(255,255,255,.14);color:#fff;width:34px;height:34px;border-radius:50%;cursor:pointer;font-size:1rem;line-height:1}
.hpmbot-icon:hover{background:rgba(255,255,255,.26)}

.hpmbot-body{flex:1;overflow-y:auto;padding:16px 14px 8px;background:var(--bot-bg);display:flex;flex-direction:column;gap:8px;scroll-behavior:smooth}
.hpmbot-msg{max-width:86%;padding:10px 13px;border-radius:16px;font-size:.93rem;line-height:1.45;word-wrap:break-word;animation:hpmbotMsg .18s ease both}
@keyframes hpmbotMsg{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
.hpmbot-msg.bot{align-self:flex-start;background:#fff;border:1px solid #e3e8f4;border-bottom-left-radius:5px;box-shadow:0 2px 6px rgba(35,43,96,.05)}
.hpmbot-msg.yo{align-self:flex-end;background:var(--bot-azul);color:#fff;border-bottom-right-radius:5px}
.hpmbot-msg ul,.hpmbot-msg ol{margin:6px 0 2px;padding-left:20px}
.hpmbot-msg li{margin:2px 0}
.hpmbot-msg b{color:var(--bot-navy)}
.hpmbot-msg.yo b{color:#fff}
.hpmbot-msg.err{border-color:#f2a7a0;background:#fff5f4}
.hpmbot-typing{align-self:flex-start;background:#fff;border:1px solid #e3e8f4;border-radius:16px;padding:10px 14px;display:flex;gap:4px}
.hpmbot-typing span{width:7px;height:7px;border-radius:50%;background:#9aa5c4;animation:hpmbotDot 1s infinite}
.hpmbot-typing span:nth-child(2){animation-delay:.15s}.hpmbot-typing span:nth-child(3){animation-delay:.3s}
@keyframes hpmbotDot{0%,80%,100%{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}

.hpmbot-opts{display:none}
/* Opciones dentro de la conversación: grilla ordenada, nunca tapan los mensajes */
.hpmbot-opciones{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:2px 0 6px;animation:hpmbotMsg .18s ease both}
.hpmbot-opciones.una{grid-template-columns:1fr}
.hpmbot-opciones.una .hpmbot-opt{min-height:40px}
.hpmbot-opciones .hpmbot-opt:last-child:nth-child(odd){grid-column:1/-1}
.hpmbot-opt{-webkit-tap-highlight-color:transparent;touch-action:manipulation;width:100%;min-height:42px;border:1.5px solid var(--bot-azul);background:#fff;color:var(--bot-azul);
  border-radius:12px;padding:8px 11px;font-size:.84rem;font-weight:700;cursor:pointer;display:flex;align-items:center;gap:8px;text-align:left;
  text-decoration:none;line-height:1.25;transition:background .15s,color .15s,border-color .15s,transform .08s;font-family:inherit}
.hpmbot-opt i{font-size:1rem;flex:0 0 auto}
.hpmbot-opt span{flex:1;min-width:0;overflow-wrap:normal;word-break:normal;hyphens:manual}
/* Cambia de color al pasar el mouse o al tocar con el dedo */
.hpmbot-opt:hover,.hpmbot-opt:focus-visible,.hpmbot-opt:active,.hpmbot-opt.tocando{background:var(--bot-azul);color:#fff;outline:none}
.hpmbot-opt:active,.hpmbot-opt.tocando{transform:scale(.97)}
.hpmbot-opt.link{border-color:var(--bot-navy);color:var(--bot-navy);background:#eef0fa}
.hpmbot-opt.link:hover,.hpmbot-opt.link:focus-visible,.hpmbot-opt.link:active,.hpmbot-opt.link.tocando{background:var(--bot-navy);color:#fff}
.hpmbot-opt.ok{border-color:#1f8a5b;color:#1f8a5b}
.hpmbot-opt.ok:hover,.hpmbot-opt.ok:focus-visible,.hpmbot-opt.ok:active,.hpmbot-opt.ok.tocando{background:#1f8a5b;color:#fff}
.hpmbot-opt.sec{border-color:#cbd3e6;color:#475569}
.hpmbot-opt.sec:hover,.hpmbot-opt.sec:focus-visible,.hpmbot-opt.sec:active,.hpmbot-opt.sec.tocando{background:#475569;border-color:#475569;color:#fff}
/* Opciones ya respondidas: quedan como historial, atenuadas */
.hpmbot-opciones.usada .hpmbot-opt:not(.link){opacity:.45;cursor:default;pointer-events:none}
.hpmbot-opciones.usada .hpmbot-opt.elegida{opacity:1;background:#e8ebff;border-color:var(--bot-azul);color:var(--bot-azul)}
@media (max-width:340px){.hpmbot-opciones{grid-template-columns:1fr}}

.hpmbot-input{display:flex;gap:8px;padding:10px 12px;border-top:1px solid #e9edf6;background:#fff}
.hpmbot-input input{flex:1;min-width:0;border:1.5px solid #d5dcec;border-radius:999px;padding:10px 14px;font-size:.95rem;outline:none;color:var(--bot-texto);background:#fff}
.hpmbot-input input:focus{border-color:var(--bot-azul);box-shadow:0 0 0 3px rgba(52,69,219,.15)}
.hpmbot-input input:disabled{background:#f1f3f8}
.hpmbot-send{width:44px;height:44px;flex:0 0 44px;border-radius:50%;border:0;background:var(--bot-azul);color:#fff;font-size:1.05rem;cursor:pointer}
.hpmbot-send:hover{background:var(--bot-navy)}
.hpmbot-send:disabled{opacity:.5;cursor:default}
.hpmbot-foot{display:flex;align-items:center;justify-content:center;gap:8px;padding:7px 12px 9px;background:#fff;border-top:1px solid #eef1f7;
  font-size:.78rem;color:#475569;letter-spacing:.01em;line-height:1}
.hpmbot-foot img{width:34px;height:34px;flex:0 0 34px;object-fit:contain;display:block}
.hpmbot-foot b{color:var(--bot-navy);font-weight:800}

@media (max-width:520px){
  .hpmbot{right:14px;bottom:14px}
  .hpmbot-launcher,.hpmbot-launcher img{width:56px;height:56px}
  .hpmbot-hint{right:66px;width:205px}
  .hpmbot.abierto{left:0;right:0;top:0;bottom:0}
  .hpmbot.abierto .hpmbot-launcher{display:none}
  .hpmbot-panel{position:fixed;inset:0;width:100%;max-width:100%;height:100vh;height:100dvh;max-height:none;border-radius:0;bottom:0}
  .hpmbot-input{padding-bottom:calc(10px + env(safe-area-inset-bottom))}
  .hpmbot-input input{font-size:16px}
}
@media print{.hpmbot{display:none}}
.hpmbot-msg p{margin:0 0 5px}.hpmbot-msg p:last-child{margin-bottom:0}.hpmbot-msg a{font-weight:700;word-break:break-word}
