/* BENULIX WEB · estilos del asistente (integrados con la propuesta premium).
   Colores de BENULIX (identidad oficial): turquesa luminoso #38D8EE, turquesa #00AFBA, azul #033F6E. */
.bx { --bx-luz: #38D8EE; --bx-turq: #00AFBA; --bx-azul: #033F6E; --bx-noche: #030A1C; --bx-level: 0;
  position: fixed; right: 20px; bottom: 20px; z-index: 140; font-family: var(--font, system-ui, sans-serif); }

/* ---------- Botón flotante con la cara oficial ---------- */
.bx-launcher { display: flex; align-items: center; gap: 12px; padding: 6px 18px 6px 6px; border: 1px solid rgba(56, 216, 238, .35); border-radius: 999px;
  background: rgba(3, 10, 28, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: #fff; font: 600 .95rem/1 var(--font, system-ui);
  cursor: pointer; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .8), 0 0 30px -8px rgba(56, 216, 238, .45); transition: transform .25s, box-shadow .25s; }
.bx-launcher:hover { transform: translateY(-2px); box-shadow: 0 22px 44px -16px rgba(0, 0, 0, .8), 0 0 40px -6px rgba(56, 216, 238, .7); }
.bx-face { position: relative; display: block; flex: none; width: 58px; height: 58px; border-radius: 50%; background: #fff; }
.bx-face img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.bx-face::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--bx-luz); opacity: .55; }
.bx-launcher .bx-face::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; box-shadow: 0 0 0 0 rgba(56, 216, 238, .55); animation: bx-latido 3s ease-out infinite; }
@keyframes bx-latido { 0% { box-shadow: 0 0 0 0 rgba(56, 216, 238, .5); } 70%, 100% { box-shadow: 0 0 0 14px rgba(56, 216, 238, 0); } }

/* Estados visibles en el botón y en la cara */
.bx[data-state="listening"] .bx-face::after, .bx[data-state="mic"] .bx-face::after { opacity: 1; border-color: var(--bx-luz); animation: bx-escucha 1.4s ease-in-out infinite; }
@keyframes bx-escucha { 50% { transform: scale(1.06); opacity: .6; } }
.bx[data-state="mic"] .bx-face::after { border-color: #6BE3A0; }
.bx[data-state="speaking"] .bx-face::after { opacity: 1; border-width: 3px; transform: scale(calc(1 + var(--bx-level) * .14)); box-shadow: 0 0 calc(10px + var(--bx-level) * 30px) rgba(56, 216, 238, .8); transition: transform .06s linear; }
.bx[data-state="connecting"] .bx-face::after { border-style: dashed; animation: bx-gira 1.2s linear infinite; opacity: 1; }
@keyframes bx-gira { to { transform: rotate(360deg); } }
.bx[data-state="error"] .bx-face::after, .bx[data-state="offline"] .bx-face::after, .bx[data-state="mic-denied"] .bx-face::after { border-color: #FF8A7A; opacity: 1; animation: none; }
.bx-launcher[data-minimized="true"] .bx-launcher-text::after { content: " · activa"; color: var(--bx-luz); }
html[lang="en"] .bx-launcher[data-minimized="true"] .bx-launcher-text::after { content: " · active"; }
.bx-launcher[aria-expanded="true"] { opacity: 0; pointer-events: none; transform: scale(.9); }

/* ---------- Panel ---------- */
.bx-panel { position: absolute; right: 0; bottom: 0; width: min(400px, calc(100vw - 32px)); max-height: min(680px, calc(100vh - 110px)); display: flex; flex-direction: column;
  border-radius: 24px; border: 1px solid rgba(56, 216, 238, .3); background: linear-gradient(180deg, rgba(10, 28, 62, .96), rgba(3, 10, 28, .97));
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); color: #EAF2FB; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .9), 0 0 60px -20px rgba(56, 216, 238, .45);
  overflow: hidden; animation: bx-abre .35s cubic-bezier(.2, .7, .1, 1); }
@keyframes bx-abre { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.bx-panel[hidden] { display: none; }
.bx-head { display: flex; align-items: center; gap: 12px; padding: 16px 14px 12px 16px; border-bottom: 1px solid rgba(148, 186, 230, .14); }
.bx-face-sm { width: 46px; height: 46px; }
.bx-id { flex: 1; min-width: 0; }
.bx-title { margin: 0; font-size: 1.15rem; font-weight: 650; letter-spacing: -.02em; color: #fff; }
.bx-title::after { content: ""; }
.bx-sub { margin: 2px 0 0; font-size: .78rem; color: #93A6C2; line-height: 1.35; }
.bx-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid rgba(148, 186, 230, .2); background: rgba(255, 255, 255, .04); color: #EAF2FB; cursor: pointer; }
.bx-icon:hover { border-color: var(--bx-luz); }
.i-min, .i-close, .i-voice, .i-mic, .i-send { display: block; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.i-min { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='3' y='7.2' width='10' height='1.6' rx='.8'/%3E%3C/svg%3E"); }
.i-close { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M4 4l8 8M12 4l-8 8'/%3E%3C/svg%3E"); }
.i-voice { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6v4h2.5l3.5 3V3L5 6z' fill='black'/%3E%3Cpath d='M11 5.5a3.5 3.5 0 0 1 0 5M12.8 3.6a6 6 0 0 1 0 8.8'/%3E%3C/svg%3E"); }
.bx-voice[aria-pressed="false"] .i-voice { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M2.5 6v4h2.5l3.5 3V3L5 6z' fill='black'/%3E%3Cpath d='M11 6l4 4M15 6l-4 4'/%3E%3C/svg%3E"); }
.i-mic { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Crect x='5.5' y='1.5' width='5' height='8.5' rx='2.5' fill='black'/%3E%3Cpath d='M3 8a5 5 0 0 0 10 0M8 13v2'/%3E%3C/svg%3E"); }
.i-send { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M1.5 8l13-6-4.5 13-2.2-5.2z'/%3E%3C/svg%3E"); }

.bx-status { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; padding: 10px 16px 0; font-size: .85rem; color: #93A6C2; }
.bx-status strong { color: #fff; font-weight: 600; }
.bx-dot { width: 8px; height: 8px; border-radius: 50%; background: #93A6C2; align-self: center; }
.bx[data-state="listening"] .bx-dot, .bx[data-state="speaking"] .bx-dot { background: var(--bx-luz); box-shadow: 0 0 10px var(--bx-luz); }
.bx[data-state="mic"] .bx-dot { background: #6BE3A0; box-shadow: 0 0 10px #6BE3A0; }
.bx[data-state="connecting"] .bx-dot { background: #F2B33D; }
.bx[data-state="error"] .bx-dot, .bx[data-state="offline"] .bx-dot, .bx[data-state="mic-denied"] .bx-dot { background: #FF8A7A; }
.bx-mode { margin: 8px 16px 0; padding: 8px 10px; border-radius: 10px; background: rgba(242, 179, 61, .1); color: #FFD48A; font-size: .75rem; line-height: 1.4; }

.bx-log { flex: 1; min-height: 120px; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth; }
.bx-msg { margin: 0; max-width: 88%; padding: 9px 13px; border-radius: 14px; font-size: .93rem; line-height: 1.45; animation: bx-msg .3s ease both; }
@keyframes bx-msg { from { opacity: 0; transform: translateY(6px); } }
.bx-agent { align-self: flex-start; background: rgba(255, 255, 255, .07); border: 1px solid rgba(148, 186, 230, .14); border-bottom-left-radius: 4px; }
.bx-user { align-self: flex-end; background: var(--bx-turq); color: var(--bx-noche); font-weight: 500; border-bottom-right-radius: 4px; }
.bx-note { margin: 2px 0; align-self: center; font-size: .75rem; color: #93A6C2; text-align: center; }

.bx-sugg { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.bx-sugg[hidden] { display: none; }
.bx-chip { padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(56, 216, 238, .35); background: transparent; color: #EAF2FB; font: 500 .8rem/1.1 var(--font, system-ui); cursor: pointer; }
.bx-chip:hover { background: rgba(56, 216, 238, .1); }

.bx-consent { margin: 0 16px 10px; padding: 12px; border-radius: 12px; border: 1px solid rgba(107, 227, 160, .35); background: rgba(107, 227, 160, .08); font-size: .82rem; line-height: 1.45; }
.bx-consent p { margin: 0 0 8px; }
.bx-consent[hidden] { display: none; }
.bx-row { display: flex; gap: 8px; flex-wrap: wrap; }

.bx-controls { display: flex; align-items: center; gap: 8px; padding: 0 16px 10px; }
.bx-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(148, 186, 230, .25); background: rgba(255, 255, 255, .04);
  color: #fff; font: 600 .9rem/1 var(--font, system-ui); cursor: pointer; }
.bx-btn:hover { border-color: var(--bx-luz); }
.bx-btn[hidden] { display: none; }
.bx-btn-main { flex: 1; justify-content: center; border: 0; color: var(--bx-noche); background: linear-gradient(180deg, #8AF0F6, var(--bx-luz)); box-shadow: 0 8px 24px -10px rgba(56, 216, 238, .8); }
.bx-mic[aria-pressed="true"] { border-color: #6BE3A0; color: #6BE3A0; }
.bx-controls .bx-voice { margin-left: auto; width: 42px; height: 42px; border-radius: 50%; }

.bx-form { display: flex; gap: 8px; padding: 0 16px 10px; }
.bx-form input { flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(148, 186, 230, .25); background: rgba(3, 10, 28, .7); color: #fff; font: inherit; font-size: 16px; }
.bx-form input:focus { outline: none; border-color: var(--bx-luz); box-shadow: 0 0 0 3px rgba(56, 216, 238, .2); }
.bx-form input:disabled { opacity: .5; }
.bx-send { flex: none; width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--bx-luz); color: var(--bx-noche); display: grid; place-items: center; cursor: pointer; }
.bx-send:disabled { opacity: .35; cursor: default; }
.bx-privacy { margin: 0; padding: 0 16px 14px; font-size: .72rem; line-height: 1.4; color: #93A6C2; }
.bx-privacy a { color: var(--bx-luz); }
.bx :focus-visible { outline: 2px solid var(--bx-luz); outline-offset: 2px; }

/* Resaltado de la parte de la web que Benulix muestra */
.bx-highlight { outline: 2px solid rgba(56, 216, 238, .8); outline-offset: 6px; border-radius: 28px; transition: outline-color .6s; box-shadow: 0 0 60px -10px rgba(56, 216, 238, .45); }
section.bx-highlight { outline-offset: -6px; border-radius: 0; box-shadow: none; }

/* Botón de la sección «Asistente» que abre a Benulix */
.bx-open-face { display: inline-block; width: 30px; height: 30px; border-radius: 50%; overflow: hidden; background: #fff; margin: -6px 0 -6px -10px; }
.bx-open-face img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 680px) {
  .bx { right: 12px; bottom: 64px; }
  .bx-launcher { padding: 4px; }
  .bx-launcher-text { display: none; }
  .bx-face { width: 56px; height: 56px; }
  .bx-panel { position: fixed; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: calc(100dvh - 80px); border-radius: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .bx *, .bx *::before, .bx *::after { animation: none !important; transition: none !important; }
}
