/* Burbuja de chat del landing.
   Estilo alineado con la burbuja de SYSTEM94J (convención BEM chat-bubble__*)
   pero con los colores de la marca, que vienen de scheme-01.css. */

.chat-bubble {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9000;
  font-family: var(--body-font, 'Manrope', sans-serif);
}

.chat-bubble__toggle {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: none;
  background: var(--primary-color);
  color: #0c1017;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .25s ease, box-shadow .25s ease;
}

.chat-bubble__toggle:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 30px rgba(var(--primary-color-rgb), .45);
}

.chat-bubble__panel {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: 370px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 140px);
  background: var(--bg-dark-2, #161c26);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: chatIn .22s ease;
}

@keyframes chatIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .chat-bubble__panel { animation: none; }
  .chat-bubble__toggle { transition: none; }
}

.chat-bubble__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--bg-dark-1, #0c1017) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.chat-bubble__header img { width: 38px; height: 38px; border-radius: 50%; }
.chat-bubble__title { font-size: 15px; font-weight: 700; color: #fff; line-height: 1.2; }
.chat-bubble__status { font-size: 12px; color: var(--primary-color); }

.chat-bubble__close {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255, 255, 255, .6);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.chat-bubble__close:hover { color: #fff; }

.chat-bubble__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-bubble__msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.chat-bubble__msg--bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .92);
  border-bottom-left-radius: 4px;
}

.chat-bubble__msg--user {
  align-self: flex-end;
  background: var(--primary-color);
  color: #0c1017;
  font-weight: 500;
  border-bottom-right-radius: 4px;
}

.chat-bubble__msg--error {
  align-self: center;
  background: rgba(255, 180, 80, .14);
  color: #ffd79a;
  font-size: 13px;
  text-align: center;
}

.chat-bubble__typing { display: flex; gap: 4px; padding: 12px 14px; align-self: flex-start; }
.chat-bubble__typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary-color);
  animation: chatDot 1.2s infinite ease-in-out;
}
.chat-bubble__typing span:nth-child(2) { animation-delay: .2s; }
.chat-bubble__typing span:nth-child(3) { animation-delay: .4s; }

@keyframes chatDot {
  0%, 60%, 100% { opacity: .25; transform: translateY(0); }
  30%           { opacity: 1;   transform: translateY(-4px); }
}

.chat-bubble__footer {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  background: rgba(0, 0, 0, .25);
}

.chat-bubble__input {
  flex: 1;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  padding: 10px 12px;
  color: #fff;
  font-size: 14px;
  resize: none;
  max-height: 90px;
  font-family: inherit;
}
.chat-bubble__input:focus { outline: none; border-color: var(--primary-color); }
.chat-bubble__input::placeholder { color: rgba(255, 255, 255, .4); }

.chat-bubble__send {
  background: var(--primary-color);
  border: none;
  border-radius: 10px;
  width: 44px;
  color: #0c1017;
  font-size: 17px;
  cursor: pointer;
}
.chat-bubble__send:disabled { opacity: .45; cursor: not-allowed; }

.chat-bubble__canales {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 8px 12px 4px;
  font-size: 12px;
  background: rgba(0, 0, 0, .25);
}

.chat-bubble__canales a { color: var(--primary-color); text-decoration: none; }
.chat-bubble__canales a:hover { text-decoration: underline; }
.chat-bubble__canales i { margin-right: 4px; }

.chat-bubble__legal {
  padding: 0 12px 10px;
  font-size: 11px;
  color: rgba(255, 255, 255, .35);
  text-align: center;
  background: rgba(0, 0, 0, .25);
}

@media (max-width: 480px) {
  .chat-bubble { right: 16px; bottom: 16px; }
  .chat-bubble__panel { width: calc(100vw - 32px); height: 70vh; }
}
