/* Kairos Asistente - Chat Widget */
:root{
  --k-bg:#0b1220;
  --k-card:#111a2e;
  --k-card2:#0f1830;
  --k-border:rgba(255,255,255,.10);
  --k-text:#e8eefc;
  --k-muted:rgba(232,238,252,.75);
  --k-blue:#2f7cff;
  --k-green:#25d366;
}

#kairos-chat-launcher{
  position:fixed;
  right:22px;
  bottom:22px;
  z-index:9999;
  width:56px;
  height:56px;
  border-radius:18px;
  border:1px solid var(--k-border);
  background:linear-gradient(135deg, rgba(47,124,255,.95), rgba(47,124,255,.75));
  box-shadow:0 18px 45px rgba(0,0,0,.35);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  user-select:none;
}

#kairos-chat-launcher svg{ width:26px; height:26px; fill:#fff; }

#kairos-chat-window{
  position:fixed;
  right:22px;
  bottom:92px;
  z-index:9999;
  width:360px;
  max-width:calc(100vw - 44px);
  height:520px;
  max-height:calc(100vh - 140px);
  border-radius:18px;
  border:1px solid var(--k-border);
  background:var(--k-card);
  box-shadow:0 18px 60px rgba(0,0,0,.45);
  overflow:hidden;
  display:none;
}

#kairos-chat-window.k-open{ display:flex; flex-direction:column; }

.k-header{
  padding:14px 14px 12px;
  display:flex;
  gap:10px;
  align-items:center;
  border-bottom:1px solid var(--k-border);
  background:linear-gradient(180deg, rgba(15,24,48,.95), rgba(17,26,46,.95));
}

.k-avatar{
  width:34px; height:34px; border-radius:12px;
  background:rgba(47,124,255,.18);
  display:flex; align-items:center; justify-content:center;
  border:1px solid rgba(47,124,255,.35);
}
.k-avatar span{ font-weight:800; color:#9cc2ff; }

.k-title{ line-height:1.2; }
.k-title b{ display:block; font-size:14px; }
.k-title small{ color:var(--k-muted); font-size:12px; }

.k-actions{ margin-left:auto; display:flex; gap:8px; }
.k-btn-icon{
  width:34px; height:34px;
  border-radius:12px;
  border:1px solid var(--k-border);
  background:rgba(255,255,255,.04);
  cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.k-btn-icon:hover{ background:rgba(255,255,255,.08); }

.k-body{
  padding:14px;
  overflow:auto;
  flex:1;
  background:radial-gradient(900px 400px at 20% 10%, rgba(47,124,255,.10), transparent 60%),
             radial-gradient(900px 400px at 80% 50%, rgba(37,211,102,.05), transparent 60%),
             var(--k-bg);
}

.k-msg{
  display:flex;
  margin:10px 0;
  gap:10px;
}

.k-bubble{
  max-width:80%;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--k-border);
  color:var(--k-text);
  font-size:14px;
  line-height:1.45;
  white-space:pre-wrap;
}

.k-bot .k-bubble{
  background:rgba(255,255,255,.05);
  border-top-left-radius:6px;
}

.k-user{ justify-content:flex-end; }
.k-user .k-bubble{
  background:rgba(47,124,255,.22);
  border:1px solid rgba(47,124,255,.45);
  border-top-right-radius:6px;
}

.k-typing{
  display:inline-flex;
  align-items:center;
  gap:6px;
  color:var(--k-muted);
  font-size:12px;
  margin-top:6px;
}
.k-dots{
  display:inline-flex;
  gap:3px;
}
.k-dots span{
  width:5px;height:5px;border-radius:50%;
  background:rgba(232,238,252,.45);
  animation:kairosDot 1.2s infinite;
}
.k-dots span:nth-child(2){ animation-delay:.15s; }
.k-dots span:nth-child(3){ animation-delay:.3s; }
@keyframes kairosDot{
  0%,100%{ transform:translateY(0); opacity:.35; }
  50%{ transform:translateY(-3px); opacity:1; }
}

.k-footer{
  border-top:1px solid var(--k-border);
  padding:10px;
  background:rgba(17,26,46,.95);
}
.k-row{
  display:flex;
  gap:8px;
}
#kairos-input{
  flex:1;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(11,18,32,.9);
  color:var(--k-text);
  border-radius:14px;
  padding:12px 12px;
  outline:none;
  font-size:14px;
}
#kairos-input::placeholder{ color:rgba(232,238,252,.45); }

#kairos-send{
  width:44px;height:44px;
  border-radius:14px;
  border:1px solid rgba(47,124,255,.55);
  background:rgba(47,124,255,.95);
  cursor:pointer;
}
#kairos-send:hover{ filter:brightness(1.05); }
#kairos-send svg{ width:18px;height:18px; fill:#fff; }

.k-footer small{
  display:block;
  margin-top:8px;
  color:rgba(232,238,252,.55);
  font-size:11px;
}
.k-link{
  color:#9cc2ff;
  text-decoration:none;
}
.k-link:hover{ text-decoration:underline; }
