@charset "UTF-8";
/* ===== THEME / TOKENS ===== */
#chat-widget {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 10000;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Helvetica Neue", sans-serif;
  /* ---------- Botón flotante ---------- */
  /* Responsive: botón un pelín más pequeño en móviles */
  /* Reduced motion */
  /* ---------- Panel del chat ---------- */
}
#chat-widget #chat-button {
  inline-size: 56px;
  block-size: 56px;
  padding: 0;
  border: 0;
  border-radius: 16px; /* cuadrado con bordes redondeados */
  background: #0a66c2;
  color: #fff; /* el SVG usa currentColor */
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative; /* para .badge opcional */
  box-shadow: 0 18px 44px rgba(10, 102, 194, 0.28);
  transition: transform 0.16s ease, box-shadow 0.22s ease, background-color 0.2s ease;
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
  /* Estado abierto (tu JS debe setear aria-expanded="true") */
  /* Badge opcional (no leídos) */
}
#chat-widget #chat-button .icon {
  inline-size: 24px;
  block-size: 24px;
  display: block;
}
#chat-widget #chat-button .icon .bubble {
  fill: currentColor;
}
#chat-widget #chat-button .icon .dot {
  animation: dotPulse 1.6s ease-in-out infinite;
}
#chat-widget #chat-button .icon .dot:nth-of-type(2) {
  animation-delay: 0.15s;
}
#chat-widget #chat-button .icon .dot:nth-of-type(3) {
  animation-delay: 0.3s;
}
#chat-widget #chat-button:hover {
  background: #0a5bb0;
  box-shadow: 0 22px 52px rgba(10, 102, 194, 0.36);
}
#chat-widget #chat-button:active {
  transform: translateY(1px) scale(0.98);
}
#chat-widget #chat-button:focus-visible {
  outline: 3px solid rgba(10, 102, 194, 0.35);
  outline-offset: 3px;
}
#chat-widget #chat-button[aria-expanded=true] {
  background: linear-gradient(180deg, #0a66c2, #0a5bb0);
  transform: scale(1.02);
}
#chat-widget #chat-button .badge {
  position: absolute;
  top: -2px;
  right: -2px;
  inline-size: 10px;
  block-size: 10px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px #fff;
}
@media (max-width: 480px) {
  #chat-widget #chat-button {
    inline-size: 52px;
    block-size: 52px;
    border-radius: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #chat-widget #chat-button {
    transition: none;
  }
  #chat-widget #chat-button .icon .dot {
    animation: none;
  }
}
#chat-widget #chat-container {
  margin-block-start: 12px;
  inline-size: 380px;
  max-inline-size: min(92vw, 420px);
  block-size: 520px;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  /* Glass + borde sutil */
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.22);
  /* Aplica blur si el navegador lo soporta */
  /* Oculto por defecto (tu JS alterna .hidden) */
  /* ---------- Header ---------- */
  /* ---------- Mensajes ---------- */
  /* ---------- Input ---------- */
  /* tarjeta del formulario dentro de mensajes */
}
@supports (backdrop-filter: blur(10px)) {
  #chat-widget #chat-container {
    backdrop-filter: saturate(140%) blur(14px);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    background: rgba(255, 255, 255, 0.72);
  }
}
#chat-widget #chat-container.hidden {
  display: none;
}
#chat-widget #chat-container.is-open {
  animation: chat-in 0.18s ease-out both;
}
#chat-widget #chat-container .chat-header {
  position: sticky;
  inset-block-start: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)) border-box, linear-gradient(90deg, #0a66c2 0%, #0a5bb0 100%) border-box;
  color: #fff;
}
#chat-widget #chat-container .chat-header .title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}
#chat-widget #chat-container .chat-header .title .dot {
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: #22c55e; /* online */
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}
#chat-widget #chat-container .chat-header #chat-close {
  inline-size: 34px;
  block-size: 34px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  border: 0;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}
#chat-widget #chat-container .chat-header #chat-close:hover {
  background: rgba(255, 255, 255, 0.22);
}
#chat-widget #chat-container .chat-header #chat-close:active {
  transform: scale(0.96);
}
#chat-widget #chat-container .chat-header #chat-close:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.5);
  outline-offset: 3px;
}
#chat-widget #chat-container #chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: radial-gradient(1200px 500px at 80% -20%, rgba(10, 102, 194, 0.06), transparent 50%), linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.35));
  /* scrollbar discreto */
}
#chat-widget #chat-container #chat-messages::-webkit-scrollbar {
  inline-size: 10px;
}
#chat-widget #chat-container #chat-messages::-webkit-scrollbar-thumb {
  background: rgba(2, 6, 23, 0.18);
  border-radius: 8px;
}
#chat-widget #chat-container #chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
#chat-widget #chat-container #chat-messages .message {
  max-inline-size: 85%;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  background: #f8fafc;
  color: #0f172a;
  line-height: 1.38;
  box-shadow: 0 1px 0 rgba(2, 6, 23, 0.06);
}
#chat-widget #chat-container #chat-messages .message.agent {
  background: #f8fafc;
  align-self: flex-start;
}
#chat-widget #chat-container #chat-messages .message.me {
  background: #e7f2ff;
  align-self: flex-end;
  box-shadow: 0 1px 0 rgba(10, 102, 194, 0.18);
}
#chat-widget #chat-container #chat-messages .message.system, #chat-widget #chat-container #chat-messages .message.welcome {
  align-self: center;
  background: #f1f7ff;
  color: #0a66c2;
  border: 1px dashed rgba(10, 102, 194, 0.28);
  font-weight: 500;
  animation: welcome-in 0.28s ease-out both;
}
#chat-widget #chat-container #chat-messages .message .meta {
  display: block;
  margin-block-start: 0.28rem;
  font-size: 0.75rem;
  color: #475569;
}
#chat-widget #chat-container .chat-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.72);
  border-top: 1px solid rgba(15, 23, 42, 0.12);
}
#chat-widget #chat-container .chat-input #message {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #fff;
  color: #0f172a;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#chat-widget #chat-container .chat-input #message::placeholder {
  color: #475569;
}
#chat-widget #chat-container .chat-input #message:focus {
  outline: none;
  border-color: rgba(10, 102, 194, 0.55);
  box-shadow: 0 0 0 4px rgba(10, 102, 194, 0.14);
}
#chat-widget #chat-container .chat-input #send-btn {
  inline-size: 44px;
  block-size: 44px;
  border-radius: 12px;
  border: 0;
  background: #0a66c2;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(10, 102, 194, 0.28);
  transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}
#chat-widget #chat-container .chat-input #send-btn:hover {
  background: #0a5bb0;
}
#chat-widget #chat-container .chat-input #send-btn:active {
  transform: translateY(1px);
}
#chat-widget #chat-container .chat-input #send-btn:focus-visible {
  outline: 3px solid rgba(10, 102, 194, 0.35);
  outline-offset: 3px;
}
#chat-widget #chat-container .chat-actions {
  padding: 0.6rem 0.8rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.64);
  display: flex;
  justify-content: center;
}
#chat-widget #chat-container .chat-actions .cta-btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  background: #0a66c2;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(10, 102, 194, 0.25);
  transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}
#chat-widget #chat-container .chat-actions .cta-btn:hover {
  background: #0a5bb0;
}
#chat-widget #chat-container .chat-actions .cta-btn:active {
  transform: translateY(1px);
}
#chat-widget #chat-container .chat-actions .cta-btn:focus-visible {
  outline: 3px solid rgba(10, 102, 194, 0.35);
  outline-offset: 3px;
}
#chat-widget #chat-container .lead-form {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  padding: 0.8rem;
  box-shadow: 0 1px 0 rgba(2, 6, 23, 0.06);
  max-inline-size: 100%;
}
#chat-widget #chat-container .lead-form .lead-form__title {
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #0f172a;
}
#chat-widget #chat-container .lead-form .lead-form__field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}
#chat-widget #chat-container .lead-form .lead-form__field span {
  font-size: 0.85rem;
  color: #475569;
}
#chat-widget #chat-container .lead-form .lead-form__field input, #chat-widget #chat-container .lead-form .lead-form__field textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #fff;
  color: #0f172a;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#chat-widget #chat-container .lead-form .lead-form__field input::placeholder, #chat-widget #chat-container .lead-form .lead-form__field textarea::placeholder {
  color: #475569;
}
#chat-widget #chat-container .lead-form .lead-form__field input:focus, #chat-widget #chat-container .lead-form .lead-form__field textarea:focus {
  outline: none;
  border-color: rgba(10, 102, 194, 0.55);
  box-shadow: 0 0 0 4px rgba(10, 102, 194, 0.12);
}
#chat-widget #chat-container .lead-form .lead-form__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.4rem;
}
#chat-widget #chat-container .lead-form .lead-form__actions .btn-primary {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  background: #0a66c2;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(10, 102, 194, 0.22);
  transition: background-color 0.2s ease, transform 0.1s ease;
}
#chat-widget #chat-container .lead-form .lead-form__actions .btn-primary:hover {
  background: #0a5bb0;
}
#chat-widget #chat-container .lead-form .lead-form__actions .btn-primary:active {
  transform: translateY(1px);
}
#chat-widget #chat-container .lead-form .lead-form__actions .btn-primary:focus-visible {
  outline: 3px solid rgba(10, 102, 194, 0.35);
  outline-offset: 3px;
}
#chat-widget #chat-container .lead-form .lead-form__actions .btn-ghost {
  appearance: none;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  background: transparent;
  color: #0f172a;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
#chat-widget #chat-container .lead-form .lead-form__actions .btn-ghost:hover {
  background: rgba(15, 23, 42, 0.04);
}
#chat-widget #chat-container .lead-form .lead-form__actions .btn-ghost:focus-visible {
  outline: 3px solid rgba(10, 102, 194, 0.25);
  outline-offset: 3px;
}

/* Dark mode opcional */
@media (prefers-color-scheme: dark) {
  #chat-widget #chat-container .chat-actions {
    background: rgba(12, 18, 32, 0.7);
    border-top-color: rgba(255, 255, 255, 0.08);
  }
  #chat-widget #chat-container .lead-form {
    background: #0f172a;
    border-color: rgba(255, 255, 255, 0.12);
  }
  #chat-widget #chat-container .lead-form .lead-form__title {
    color: #e2e8f0;
  }
  #chat-widget #chat-container .lead-form .lead-form__field span {
    color: #94a3b8;
  }
  #chat-widget #chat-container .lead-form .lead-form__field input, #chat-widget #chat-container .lead-form .lead-form__field textarea {
    background: #0b1220;
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.12);
  }
  #chat-widget #chat-container .lead-form .lead-form__field input::placeholder, #chat-widget #chat-container .lead-form .lead-form__field textarea::placeholder {
    color: #9aa7bd;
  }
  #chat-widget #chat-container .lead-form .btn-ghost {
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.18);
  }
  /* ---------- Responsive ---------- */
  /* ---------- Reduced Motion ---------- */
}
@media (prefers-color-scheme: dark) and (max-width: 480px) {
  #chat-container {
    inline-size: 100vw;
    max-inline-size: 100vw;
    block-size: min(72vh, 560px);
    border-radius: 18px;
    margin: 0;
  }
}
@media (prefers-color-scheme: dark) and (prefers-reduced-motion: reduce) {
  #chat-button, #chat-container {
    transition: none;
    animation: none;
  }
}
/* ---------- Dark Mode ---------- */
@media (prefers-color-scheme: dark) {
  #chat-widget #chat-container {
    background: rgba(10, 15, 25, 0.72);
    border-color: rgba(255, 255, 255, 0.08);
  }
  @supports (backdrop-filter: blur(10px)) {
    #chat-widget #chat-container {
      backdrop-filter: saturate(140%) blur(14px);
      background: rgba(12, 18, 32, 0.68);
    }
  }
  #chat-widget #chat-container .chat-header {
    /* mismo gradiente que el modo claro, ligero ajuste si quieres */
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0)) border-box, linear-gradient(90deg, #0a66c2 0%, #0a5bb0 100%) border-box;
  }
  #chat-widget #chat-container #chat-messages {
    background: radial-gradient(1200px 500px at 80% -20%, rgba(10, 102, 194, 0.12), transparent 50%), linear-gradient(180deg, rgba(12, 18, 32, 0.7), rgba(12, 18, 32, 0.45));
  }
  #chat-widget #chat-container #chat-messages .message {
    background: #0f172a;
    color: #e2e8f0;
  }
  #chat-widget #chat-container #chat-messages .message.me {
    background: rgba(10, 102, 194, 0.22);
  }
  #chat-widget #chat-container #chat-messages .message.system, #chat-widget #chat-container #chat-messages .message.welcome {
    background: rgba(10, 102, 194, 0.12);
    color: #b9d9ff;
    border-color: rgba(10, 102, 194, 0.32);
  }
  #chat-widget #chat-container #chat-messages .message .meta {
    color: #94a3b8;
  }
  #chat-widget #chat-container .chat-input {
    background: rgba(12, 18, 32, 0.7);
    border-top-color: rgba(255, 255, 255, 0.08);
  }
  #chat-widget #chat-container .chat-input #message {
    background: #0b1220;
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.12);
  }
  #chat-widget #chat-container .chat-input #message::placeholder {
    color: #9aa7bd;
  }
}
/* ---------- Animaciones ---------- */
@keyframes chat-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes welcome-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes dotPulse {
  0%, 80%, 100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-1px);
  }
}/*# sourceMappingURL=chat.css.map */