/* ALDIA — Asistente */
#ac-trigger {
  position: fixed; right: 20px; bottom: 20px; z-index: 1000;
  display: inline-flex; align-items: center; gap: .55rem; height: 52px; padding: 0 1.2rem 0 1rem;
  border: 0; border-radius: 999px; background: #0E0E0E; color: #fff; cursor: pointer;
  font: 500 .95rem 'Geist', 'Inter', system-ui, sans-serif;
  box-shadow: 0 10px 30px rgba(14,14,14,.22);
  transition: transform .4s cubic-bezier(.16,1,.3,1), opacity .3s;
}
#ac-trigger svg { width: 20px; height: 20px; }
#ac-trigger:hover { transform: translateY(-2px); }
#ac-trigger.is-hidden { opacity: 0; pointer-events: none; transform: scale(.9); }

#ac-win {
  position: fixed; right: 20px; bottom: 20px; z-index: 1001;
  width: 380px; height: min(620px, calc(100vh - 40px));
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid #E8E9EC; border-radius: 24px;
  box-shadow: 0 2px 4px rgba(14,14,14,.04), 0 30px 80px rgba(14,14,14,.16);
  font-family: 'Geist', 'Inter', system-ui, sans-serif; color: #0E0E0E;
  opacity: 0; transform: translateY(16px) scale(.98); transform-origin: bottom right; pointer-events: none;
  transition: opacity .3s, transform .45s cubic-bezier(.16,1,.3,1);
}
#ac-win.is-open { opacity: 1; transform: none; pointer-events: auto; }

.ac-head { display: flex; align-items: center; gap: .7rem; padding: 14px 14px 14px 16px; border-bottom: 1px solid #E8E9EC; }
.ac-head img { width: 36px; height: 36px; }
.ac-head div { flex: 1; display: grid; line-height: 1.25; }
.ac-head b { font-size: .95rem; font-weight: 600; }
.ac-head small { font-size: .78rem; color: #6B6F76; display: flex; align-items: center; gap: 6px; }
.ac-head small i { width: 7px; height: 7px; border-radius: 50%; background: #19A974; }
.ac-icon { width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; color: #6B6F76; display: grid; place-items: center; cursor: pointer; }
.ac-icon:hover { background: #F7F8FA; color: #0E0E0E; }
.ac-icon svg { width: 17px; height: 17px; }

.ac-msgs { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth; }
.ac-msg { max-width: 86%; padding: .7rem .95rem; border-radius: 18px; font-size: .93rem; line-height: 1.5; animation: acIn .35s cubic-bezier(.16,1,.3,1); word-wrap: break-word; white-space: pre-line; }
.ac-bot { align-self: flex-start; background: #F7F8FA; border-bottom-left-radius: 6px; }
.ac-user { align-self: flex-end; background: #0E0E0E; color: #fff; border-bottom-right-radius: 6px; }
.ac-msg b { font-weight: 600; }
@keyframes acIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ac-typing { display: inline-flex; gap: 4px; padding: .9rem 1rem; }
.ac-typing span { width: 6px; height: 6px; border-radius: 50%; background: #9A9EA6; animation: acDot 1.2s infinite; }
.ac-typing span:nth-child(2) { animation-delay: .15s; } .ac-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes acDot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

.ac-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 16px 10px; justify-content: flex-end; }
.ac-quick:empty { display: none; }
.ac-chip {
  display: inline-flex; align-items: center; height: 34px; padding: 0 .9rem; border-radius: 999px;
  border: 1px solid #D5E2FF; background: #fff; color: #2F62E0; font: 500 .85rem inherit; font-family: inherit;
  cursor: pointer; text-decoration: none; transition: background .2s, border-color .2s;
}
.ac-chip:hover { background: #EEF3FF; }
.ac-chip.is-primary { background: #5B8CFF; border-color: #5B8CFF; color: #fff; }
.ac-chip.is-primary:hover { background: #2F62E0; }

.ac-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #E8E9EC; }
.ac-input input { flex: 1; height: 44px; padding: 0 1rem; border: 1px solid #D6D8DD; border-radius: 999px; font: inherit; font-size: .93rem; outline: none; transition: border-color .2s, box-shadow .2s; }
.ac-input input:focus { border-color: #5B8CFF; box-shadow: 0 0 0 4px #EEF3FF; }
.ac-input button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: #0E0E0E; color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.ac-input button svg { width: 18px; height: 18px; }

@media (max-width: 520px) {
  #ac-trigger span { display: none; }
  #ac-trigger { width: 52px; padding: 0; justify-content: center; right: 16px; bottom: 16px; }
  #ac-win { right: 0; bottom: 0; width: 100%; height: 100dvh; border-radius: 0; border: 0; }
}


/* ---------- botón del asistente: versión viva ---------- */
@property --acta { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
#ac-trigger { height: 60px; padding: 0 .55rem 0 .45rem; gap: .7rem; background: #0B0F1E; isolation: isolate; overflow: visible;
  box-shadow: 0 18px 40px -12px rgba(47, 98, 224, .55), 0 6px 16px rgba(14, 14, 14, .25); animation: actIn .9s cubic-bezier(.16,1,.3,1) both .6s; }
#ac-trigger::before { content: ""; position: absolute; inset: -1.5px; border-radius: inherit; z-index: -1;
  background: conic-gradient(from var(--acta), #2F62E0, #8B7CFF, #5B8CFF, #2F62E0 40%, #0B0F1E 55%, #0B0F1E 85%, #2F62E0); animation: actSpin 4s linear infinite; }
#ac-trigger::after { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; background: #0B0F1E; }
#ac-trigger svg { width: 18px; height: 18px; }
.act__orb { position: relative; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none;
  background: radial-gradient(circle at 30% 25%, #9DB8FF, #2F62E0 55%, #1A2C7A); box-shadow: inset 0 -6px 12px rgba(0,0,0,.25), 0 0 22px rgba(91,140,255,.55); }
.act__orb::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1.5px solid rgba(91,140,255,.6); animation: actRing 2.4s ease-out infinite; }
.act__orb svg { animation: actBob 3s ease-in-out infinite; }
.act__txt { display: grid; text-align: left; line-height: 1.1; }
.act__txt b { font-weight: 600; font-size: .98rem; letter-spacing: -.01em;
  background: linear-gradient(90deg, #fff 0%, #fff 40%, #B9CCFF 50%, #fff 60%, #fff 100%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: actShine 3.5s ease-in-out infinite; }
.act__txt small { font-size: .72rem; color: rgba(255,255,255,.55); margin-top: .2rem; }
.act__go { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); color: #fff; margin-left: .2rem;
  transition: background .4s, transform .4s cubic-bezier(.16,1,.3,1); }
#ac-trigger:hover { transform: translateY(-3px) scale(1.02); }
#ac-trigger:hover .act__go { background: #fff; color: #0B0F1E; transform: translateX(3px); }
@keyframes actSpin { to { --acta: 360deg; } }
@keyframes actRing { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes actBob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-2px) rotate(-6deg); } }
@keyframes actShine { 0%, 30% { background-position: 100% 0; } 70%, 100% { background-position: 0 0; } }
@keyframes actIn { from { opacity: 0; transform: translateY(20px) scale(.9); } to { opacity: 1; transform: none; } }
#ac-trigger.is-hidden { animation: none; }
@media (max-width: 640px) { #ac-trigger { width: 60px; height: 60px; padding: 0; justify-content: center; } #ac-trigger .act__txt, #ac-trigger .act__go { display: none; } .act__orb { width: 50px; height: 50px; } }
@media (prefers-reduced-motion: reduce) { #ac-trigger, #ac-trigger::before, .act__orb::after, .act__orb svg, .act__txt b { animation: none !important; } }
