/* ReconoSERte — Asistente conversacional (bot de cuestionario) */

.asst-launcher {
  position: fixed; bottom: 100px; right: 24px; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; cursor: pointer; padding: 0;
}
.asst-launcher .asst-label {
  background: var(--card); color: var(--ink); font-family: var(--font-body);
  font-size: 0.85rem; font-weight: 700; padding: 10px 16px; border-radius: 999px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  opacity: 0; transform: translateX(8px); transition: all 0.25s; pointer-events: none;
}
.asst-launcher:hover .asst-label { opacity: 1; transform: translateX(0); }
.asst-launcher .asst-circle {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--lav-deep); color: #fff;
  display: grid; place-items: center; font-size: 1.5rem;
  box-shadow: 0 8px 24px color-mix(in oklab, var(--lav-deep) 50%, transparent);
  transition: transform 0.2s; position: relative;
}
.asst-launcher:hover .asst-circle { transform: scale(1.08); }
.asst-launcher .asst-badge {
  position: absolute; top: -2px; right: -2px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--terra-deep); border: 2.5px solid var(--bg);
  animation: asstPulse 2s infinite;
}
@keyframes asstPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
body.asst-open .asst-launcher { display: none; }

.asst-panel {
  position: fixed; bottom: 24px; right: 24px; z-index: 70;
  width: 372px; max-height: min(620px, calc(100vh - 48px));
  background: var(--bg); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: 0 24px 60px rgba(62, 56, 51, 0.25);
  display: none; flex-direction: column; overflow: hidden;
}
body.asst-open .asst-panel { display: flex; animation: asstIn 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes asstIn { from { opacity: 0; transform: translateY(24px) scale(0.97); } to { opacity: 1; transform: none; } }

.asst-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; background: var(--lav-deep); color: #fff; flex-shrink: 0;
}
.asst-head .asst-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.92);
  display: grid; place-items: center; overflow: hidden; flex-shrink: 0;
}
.asst-head .asst-avatar img { width: 80%; height: 80%; object-fit: contain; }
.asst-head strong { font-family: var(--font-body); font-size: 0.95rem; display: block; }
.asst-head small { font-size: 0.74rem; opacity: 0.85; display: flex; align-items: center; gap: 6px; }
.asst-head small::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #A8E6B0; }
.asst-close {
  margin-left: auto; background: rgba(255,255,255,0.15); border: none; color: #fff;
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 1rem;
  display: grid; place-items: center; transition: background 0.2s;
}
.asst-close:hover { background: rgba(255,255,255,0.3); }

.asst-body {
  flex: 1; overflow-y: auto; padding: 18px 16px;
  display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth;
}
.asst-msg {
  max-width: 85%; padding: 11px 15px; border-radius: 16px;
  font-size: 0.92rem; line-height: 1.5; animation: asstMsgIn 0.3s ease;
}
@keyframes asstMsgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.asst-msg.bot { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; align-self: flex-start; }
.asst-msg.user { background: var(--sage-deep); color: #fff; border-bottom-right-radius: 6px; align-self: flex-end; }
.asst-msg.typing { display: flex; gap: 5px; padding: 14px 16px; }
.asst-msg.typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ink-soft); opacity: 0.4;
  animation: asstDot 1.2s infinite;
}
.asst-msg.typing span:nth-child(2) { animation-delay: 0.18s; }
.asst-msg.typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes asstDot { 0%, 60%, 100% { transform: none; opacity: 0.4; } 30% { transform: translateY(-5px); opacity: 1; } }

.asst-options { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; max-width: 95%; animation: asstMsgIn 0.3s ease; }
.asst-opt {
  font-family: var(--font-body); font-size: 0.86rem; font-weight: 600;
  padding: 9px 16px; border-radius: 999px; cursor: pointer;
  background: var(--bg); color: var(--sage-deep); border: 1.5px solid var(--sage-deep);
  transition: all 0.18s;
}
.asst-opt:hover { background: var(--sage-deep); color: #fff; transform: translateY(-1px); }

.asst-summary {
  background: color-mix(in oklab, var(--lav) 28%, white); border: 1px solid var(--lav);
  border-radius: 16px; padding: 14px 16px; font-size: 0.88rem; align-self: stretch;
  animation: asstMsgIn 0.3s ease;
}
.asst-summary h4 { font-family: var(--font-body); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--lav-deep); margin-bottom: 8px; }
.asst-summary ul { list-style: none; padding: 0; margin: 0 0 4px; display: grid; gap: 5px; }
.asst-summary li { display: flex; gap: 8px; color: var(--ink-soft); }
.asst-summary li strong { color: var(--ink); font-weight: 700; }
.asst-pagelink { align-self: flex-start; margin: 2px 0; font-family: var(--font-body); font-weight: 700; font-size: 0.9rem; color: var(--lav-deep); text-decoration: none; border-bottom: 2px solid var(--lav); padding-bottom: 2px; animation: asstMsgIn 0.3s ease; }
.asst-pagelink:hover { border-bottom-color: var(--lav-deep); }

.asst-ctas { display: grid; gap: 8px; align-self: stretch; animation: asstMsgIn 0.3s ease; }
.asst-cta {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-body); font-weight: 700; font-size: 0.92rem;
  padding: 13px 18px; border-radius: 999px; text-decoration: none; cursor: pointer;
  border: none; transition: transform 0.15s, background 0.2s;
}
.asst-cta:hover { transform: translateY(-2px); }
.asst-cta.wa { background: var(--wa); color: #fff; box-shadow: 0 6px 16px color-mix(in oklab, var(--wa) 35%, transparent); }
.asst-cta.agenda { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.asst-cta.agenda:hover { background: var(--ink); color: var(--bg); }
.asst-restart {
  background: none; border: none; color: var(--ink-soft); font-family: var(--font-body);
  font-size: 0.8rem; text-decoration: underline; cursor: pointer; align-self: center; padding: 4px;
}

.asst-ai-bar {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 10px 12px; border-top: 1px solid var(--line); background: var(--card);
}
.asst-ai-input {
  flex: 1; border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 16px; font-family: var(--font-body); font-size: 0.92rem;
  color: var(--ink); background: var(--bg); outline: none; transition: border-color 0.2s;
}
.asst-ai-input:focus { border-color: var(--lav-deep); }
.asst-ai-send {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--lav-deep); color: #fff; display: grid; place-items: center; transition: transform 0.15s, background 0.2s;
}
.asst-ai-send:hover { transform: scale(1.06); }
.asst-ai-send svg { width: 18px; height: 18px; }

.asst-foot {
  padding: 10px 16px; border-top: 1px solid var(--line); flex-shrink: 0;
  font-size: 0.72rem; color: var(--ink-soft); text-align: center; background: var(--card);
}

@media (max-width: 480px) {
  .asst-panel { right: 10px; left: 10px; bottom: 10px; width: auto; max-height: calc(100dvh - 20px); }
  .asst-launcher { bottom: 96px; }
}

.asst-circle svg { width: 26px; height: 26px; }
.asst-cta svg { width: 16px; height: 16px; flex-shrink: 0; }
