/* Chatbot de la academia — paleta: dorado #C47A88, dorado claro #E3A9B3, champaña #F2CDD3, marfil #FBF0F1 */
.cb { position: fixed; right: 20px; bottom: 20px; z-index: 70; font-family: "Montserrat", system-ui, sans-serif; }
.cb .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cb-launch {
  width: 60px; height: 60px; border: 0; border-radius: 50%; background: #C47A88; color: #fff; cursor: pointer;
  display: grid; place-items: center; box-shadow: 0 14px 30px -10px rgba(120,80,40,.55);
  transition: transform 160ms cubic-bezier(.23,1,.32,1), background-color 200ms ease;
}
.cb-launch svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.cb-launch:hover { background: #AE6876; }
.cb-launch:active { transform: scale(.95); }
.cb.is-open .cb-launch { display: none; }

.cb-panel {
  position: absolute; right: 0; bottom: 0; width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100svh - 40px));
  display: flex; flex-direction: column; background: #fff; border-radius: 20px; overflow: hidden;
  box-shadow: 0 30px 70px -20px rgba(80,55,30,.45), 0 0 0 1px rgba(196,122,136,.2);
  transform-origin: 100% 100%; animation: cbIn 260ms cubic-bezier(.23,1,.32,1);
}
.cb-panel[hidden] { display: none; }
@keyframes cbIn { from { opacity: 0; transform: translateY(12px) scale(.96); } }
.cb-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #FBF0F1; color: #3A2A2E; }
.cb-head img { border-radius: 10px; }
.cb-head div { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.cb-head strong { font: 500 16px/1.2 "Playfair Display", Georgia, serif; }
.cb-head span { font-size: 12px; color: #8E4656; }
.cb-close { border: 0; background: none; font-size: 26px; line-height: 1; color: #8E4656; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; }
.cb-close:hover { background: #F2CDD3; }

.cb-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.cb-msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; animation: cbMsg 220ms ease-out; }
@keyframes cbMsg { from { opacity: 0; transform: translateY(6px); } }
.cb-msg.bot { align-self: flex-start; background: #FBF0F1; color: #3A2A2E; border-bottom-left-radius: 4px; }
.cb-msg.user { align-self: flex-end; background: #C47A88; color: #fff; border-bottom-right-radius: 4px; }
.cb-msg.err { background: #fbeae6; color: #8a3b2b; }
.cb-msg a { color: #8E4656; font-weight: 600; }
.cb-typing { display: inline-flex; gap: 4px; }
.cb-typing i { width: 6px; height: 6px; border-radius: 50%; background: #C47A88; animation: cbDot 1s infinite ease-in-out; }
.cb-typing i:nth-child(2) { animation-delay: .15s; } .cb-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes cbDot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.cb-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.cb-suggest button { border: 0; border-radius: 999px; padding: 8px 12px; font: 500 12.5px/1.2 inherit; font-family: inherit; background: #FBF0F1; color: #8E4656; cursor: pointer; }
.cb-suggest button:hover { background: #F2CDD3; }

.cb-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #FBF0F1; }
.cb-form input { flex: 1; min-width: 0; border: 0; border-radius: 999px; padding: 12px 16px; background: #FBF0F1; font: 14px/1.2 inherit; font-family: inherit; color: #3A2A2E; }
.cb-form input:focus { outline: 2px solid #E3A9B3; outline-offset: 0; }
.cb-form button { width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: #C47A88; color: #fff; cursor: pointer; display: grid; place-items: center; }
.cb-form button:disabled { opacity: .5; cursor: default; }
.cb-form button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* En móvil la CTA fija vive abajo: subimos la burbuja */
@media (max-width: 960px) { .cb { bottom: 84px; right: 14px; } .cb.is-open { bottom: 14px; } }
@media (prefers-reduced-motion: reduce) { .cb-panel, .cb-msg, .cb-typing i { animation: none; } }

/* Burbuja más discreta en móvil para no tapar contenido */
@media (max-width: 700px) {
  .cb-launch { width: 52px; height: 52px; }
  .cb-launch svg { width: 22px; height: 22px; }
  .cb-panel { width: calc(100vw - 28px); height: min(560px, calc(100svh - 28px)); }
}
