/* WhatsApp-style chatbot widget — GRUPO ATU · Plan Migrantes
   Compose on top of colors_and_type.css. */

.atu-chat-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  width: 60px; height: 60px; border-radius: 50%;
  background: #25D366; color: #fff; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.28);
  transition: transform 160ms var(--ease-standard, ease), box-shadow 160ms;
}
.atu-chat-launcher:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 8px 26px rgba(0,0,0,.34); }
.atu-chat-launcher:focus-visible { outline: 3px solid var(--atu-blue); outline-offset: 3px; }
.atu-chat-launcher svg { width: 32px; height: 32px; }

.atu-chat-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 95;
  width: min(390px, calc(100vw - 32px));
  height: min(640px, calc(100dvh - 40px));
  display: flex; flex-direction: column;
  background: #ECE5DD; border-radius: 18px; overflow: hidden;
  box-shadow: 0 16px 48px rgba(7,39,103,.35);
  font-family: var(--font-sans, 'Plus Jakarta Sans', system-ui, sans-serif);
}

.atu-chat-header {
  display: flex; align-items: center; gap: 10px;
  background: #075E54; color: #fff; padding: 10px 14px;
}
.atu-chat-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: #fff; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.atu-chat-avatar img { width: 30px; height: auto; }
.atu-chat-title { font-weight: 700; font-size: 15px; line-height: 1.2; }
.atu-chat-sub { font-size: 12px; opacity: .85; display: flex; align-items: center; gap: 5px; }
.atu-chat-sub::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #25D366; }
.atu-chat-header-actions { margin-left: auto; display: flex; gap: 4px; }
.atu-chat-iconbtn {
  background: transparent; border: 0; color: #fff; cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.atu-chat-iconbtn:hover { background: rgba(255,255,255,.14); }
.atu-chat-iconbtn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.atu-chat-messages {
  flex: 1; overflow-y: auto; padding: 14px 12px;
  display: flex; flex-direction: column; gap: 6px;
  background-color: #ECE5DD;
  background-image: radial-gradient(rgba(7,39,103,.04) 1px, transparent 1px);
  background-size: 18px 18px;
}

.atu-msg {
  max-width: 82%; padding: 8px 10px 6px; border-radius: 10px;
  font-size: 14.5px; line-height: 1.42; white-space: pre-line;
  box-shadow: 0 1px 1px rgba(0,0,0,.12);
  animation: atu-msg-in 200ms var(--ease-out, ease-out) both;
}
.atu-msg-bot { align-self: flex-start; background: #fff; color: #111; border-top-left-radius: 2px; }
.atu-msg-user { align-self: flex-end; background: #D9FDD3; color: #111; border-top-right-radius: 2px; }
.atu-msg-time { display: block; text-align: right; font-size: 10.5px; color: rgba(0,0,0,.45); margin-top: 2px; }

@keyframes atu-msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .atu-msg { animation: none; } }

.atu-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.atu-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: #9BA1A6;
  animation: atu-typing-blink 1.2s infinite;
}
.atu-typing span:nth-child(2) { animation-delay: .15s; }
.atu-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes atu-typing-blink { 0%, 60%, 100% { opacity: .35; } 30% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .atu-typing span { animation: none; opacity: .8; } }

.atu-chat-chips {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 12px 10px;
  justify-content: flex-end;
}
.atu-chat-chip {
  border: 1.5px solid #0F4EC0; color: #0F4EC0; background: #fff;
  border-radius: 999px; padding: 8px 14px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; font-family: inherit; min-height: 36px;
  transition: background 120ms;
}
.atu-chat-chip:hover { background: #E8F0FC; }
.atu-chat-chip:focus-visible { outline: 2px solid var(--atu-blue); outline-offset: 2px; }

.atu-chat-inputbar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: #F0F2F5;
}
.atu-chat-input {
  flex: 1; border: 0; border-radius: 999px; padding: 11px 16px;
  font-size: 14.5px; font-family: inherit; background: #fff; min-height: 42px;
}
.atu-chat-input:focus { outline: 2px solid var(--atu-blue); outline-offset: 0; }
.atu-chat-send {
  width: 42px; height: 42px; border-radius: 50%; border: 0;
  background: #25D366; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.atu-chat-send:disabled { background: #B9BDC2; cursor: default; }
.atu-chat-send:focus-visible { outline: 2px solid var(--atu-blue); outline-offset: 2px; }

.atu-chat-footer {
  text-align: center; font-size: 10.5px; color: #667781;
  background: #F0F2F5; padding: 0 10px 8px;
}

/* Modo incrustado (página demo): el panel ocupa su contenedor */
.atu-chat-inline {
  position: relative; right: auto; bottom: auto;
  width: 100%; height: 100%;
  border-radius: 0; box-shadow: none;
}

@media (max-width: 480px) {
  .atu-chat-panel:not(.atu-chat-inline) { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; }
}
