/* Frases da Alma • chatbot em visual inspirado em apps de mensagem */
.fa-chat, .fa-chat * { box-sizing: border-box; }
.fa-chat {
  --wa-green: #25d366;
  --wa-green-dark: #075e54;
  --wa-green-mid: #128c7e;
  --wa-bg: #efeae2;
  --wa-panel: #f7f5f0;
  --wa-shadow: 0 20px 55px rgba(0,0,0,.26);
  --wa-border: rgba(11, 20, 26, .08);
  --wa-ink: #111b21;
  --wa-muted: #667781;
  --wa-bot: #ffffff;
  --wa-user: #d9fdd3;
  position: fixed;
  z-index: 55;
  right: clamp(12px, 2.5vw, 32px);
  bottom: 22px;
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--wa-ink);
}
.fa-chat [hidden] { display:none !important; }
.fa-chat button { font: inherit; cursor: pointer; }
.fa-chat button:focus-visible, .fa-chat a:focus-visible { outline: 3px solid #7fd7aa; outline-offset: 3px; }

.fa-chat-launcher {
  border: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 16px 10px 10px;
  background: linear-gradient(180deg, #28db6b, #1fb95a);
  color: #fff;
  box-shadow: 0 12px 34px rgba(18, 140, 126, .35);
  transition: transform .2s ease, box-shadow .2s ease;
  font-size: 13px;
  font-weight: 700;
}
.fa-chat-launcher:hover { transform: translateY(-2px); box-shadow: 0 16px 42px rgba(18, 140, 126, .42); }
.fa-launcher-mark {
  width: 36px; height: 36px; border-radius: 50%; background: center/cover no-repeat url('assets/chatbot-whatsapp-icon.png');
  display:block; flex-shrink:0;
}
.fa-chat-launcher-label { white-space: nowrap; }

.fa-chat-panel {
  position: absolute; right: 0; bottom: 73px;
  width: min(392px, calc(100vw - 24px));
  height: min(690px, calc(100dvh - 115px));
  max-height: calc(100vh - 115px);
  display:flex; flex-direction:column; overflow:hidden;
  border-radius: 16px;
  background: var(--wa-panel);
  box-shadow: var(--wa-shadow);
  border: 1px solid rgba(255,255,255,.45);
  animation: fa-chat-appear .18s ease-out;
}

.fa-chat-header {
  position: relative;
  display:flex; align-items:center; gap:10px;
  padding: 12px 14px;
  flex-shrink:0;
  color:#fff;
  background: linear-gradient(180deg, var(--wa-green-mid), var(--wa-green-dark));
}
.fa-chat-emblem {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display:grid; place-items:center; color:#fff;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.2);
  font-size: 20px;
}
.fa-chat-header-copy { flex:1; min-width:0; }
.fa-chat-title { display:block; font-size: 15px; line-height: 1.2; font-weight: 700; }
.fa-chat-subtitle { display:block; margin-top:4px; font-size:11px; color: rgba(255,255,255,.88); min-height: 1.2em; }
.fa-chat-subtitle.is-typing { color: #d8ffe2; }
.fa-chat-close {
  width: 34px; height: 34px; border-radius: 50%; border:0; background: rgba(255,255,255,.14);
  display:grid; place-items:center; color:#fff; font-size:24px; line-height:1;
}
.fa-chat-close:hover { background: rgba(255,255,255,.22); }

.fa-chat-messages {
  position:relative;
  flex:1;
  overflow-y:auto;
  overscroll-behavior: contain;
  padding: 16px 10px 18px;
  background:
    linear-gradient(rgba(239,234,226,.92), rgba(239,234,226,.92)),
    center/cover repeat url('assets/chatbot-whatsapp-bg.jpg');
  scrollbar-color: #a6b8b1 transparent;
  scrollbar-width: thin;
}
.fa-msg { margin-bottom: 10px; animation: fa-message-in .17s ease-out both; max-width: 92%; }
.fa-msg.fa-msg-user { margin-left: auto; }
.fa-msg-author {
  display:block; font-size:11px; font-weight:700; color:#4c9176; margin:0 0 4px 6px;
}
.fa-msg-user .fa-msg-author { display:none; }
.fa-msg-bubble {
  position:relative; display:block; padding: 8px 10px 18px;
  border-radius: 0 10px 10px 10px;
  background: var(--wa-bot); color: var(--wa-ink);
  font-size: 13px; line-height:1.55; white-space: pre-line;
  box-shadow: 0 1px 1px rgba(11,20,26,.08);
}
.fa-msg-bubble::before {
  content:''; position:absolute; top:0; left:-8px; width:0; height:0;
  border-top: 10px solid var(--wa-bot);
  border-right: 8px solid transparent;
}
.fa-msg-user .fa-msg-bubble {
  background: var(--wa-user);
  border-radius: 10px 0 10px 10px;
}
.fa-msg-user .fa-msg-bubble::before {
  left:auto; right:-8px;
  border-top-color: var(--wa-user);
  border-right:0;
  border-left: 8px solid transparent;
}
.fa-msg-title {
  display:block; font-weight: 700; color:#0d6b61; margin-bottom:6px; font-size: 14px; line-height:1.35;
}
.fa-msg-copy { display:block; padding-right: 52px; }
.fa-msg-meta {
  position:absolute; right:10px; bottom:6px; font-size:10px; color: var(--wa-muted); display:flex; align-items:center; gap:4px;
}
.fa-msg-user .fa-msg-meta { color:#6c8570; }
.fa-msg-check { font-size: 11px; line-height:1; letter-spacing: -1px; }

.fa-chat-options {
  margin: 8px 0 2px; display:flex; flex-direction:column; gap:8px;
}
.fa-chat-opt {
  width:100%; text-align:left; min-height: 42px; padding: 10px 12px; border-radius: 18px;
  border:1px solid rgba(17,27,33,.10); background:#fff; color:#111b21; font-size:12px; font-weight:600; line-height:1.4;
  box-shadow: 0 1px 1px rgba(11,20,26,.06);
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.fa-chat-opt:hover { transform: translateY(-1px); border-color: rgba(37,211,102,.65); background:#f7fff9; }
.fa-chat-opt[aria-current='true'] { border-color: rgba(37,211,102,.8); }
.fa-chat-opt::after { content: none; }
.fa-chat-opt.fa-chat-opt-buy {
  background: linear-gradient(180deg, #28db6b, #21c35f); border-color:#1fb157; color:#fff;
}
.fa-chat-opt.fa-chat-opt-muted { background:#f4f5f5; color:#53626a; }

.fa-chat-footer {
  display:flex; align-items:center; gap:8px; padding: 10px 12px; flex-shrink:0;
  background:#f0f2f5; border-top:1px solid rgba(11,20,26,.08); color:#667781; font-size: 12px;
}
.fa-chat-compose-icon, .fa-chat-send-icon {
  width:34px; height:34px; border-radius:50%; display:grid; place-items:center;
  background:#fff; box-shadow: 0 1px 1px rgba(11,20,26,.08); color:#54656f; flex-shrink:0;
}
.fa-chat-compose-placeholder {
  flex:1; min-height: 38px; border-radius: 999px; background:#fff; display:flex; align-items:center;
  padding: 0 14px; box-shadow: 0 1px 1px rgba(11,20,26,.08); color:#7f8b91;
}
.fa-chat-send-icon { background: var(--wa-green); color:#fff; }

@keyframes fa-chat-appear { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fa-message-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 580px) {
  .fa-chat { right: 12px; bottom: 12px; }
  .fa-chat-launcher { width: 58px; height: 58px; padding: 0; justify-content: center; border-radius: 50%; }
  .fa-chat-launcher-label { display:none; }
  .fa-chat-panel { width: calc(100vw - 24px); height: min(710px, calc(100dvh - 85px)); border-radius: 16px; right:0; bottom:68px; }
}
@media (max-height: 540px) {
  .fa-chat-panel { height: calc(100dvh - 90px); bottom: 67px; }
}
@media (prefers-reduced-motion: reduce) {
  .fa-chat-panel, .fa-msg, .fa-chat-launcher { animation:none !important; transition:none !important; }
}

/* Indicador de digitação com três pontos, inspirado em mensageiros. */
.fa-msg-typing .fa-msg-bubble { display:inline-flex; align-items:center; gap:10px; min-width:58px; min-height:40px; padding:11px 13px; }
.fa-typing-dots { display:inline-flex; gap:4px; align-items:center; height:14px; }
.fa-typing-dots i { display:block; width:7px; height:7px; border-radius:50%; background:#8b999f; animation: fa-dot-bounce 1.05s ease-in-out infinite; }
.fa-typing-dots i:nth-child(2) { animation-delay:.15s; }
.fa-typing-dots i:nth-child(3) { animation-delay:.30s; }
.fa-typing-label { display:none; }
.fa-chat-opt:disabled { opacity:.52; cursor:default; transform:none; }
@keyframes fa-dot-bounce { 0%, 65%, 100% { transform:translateY(0); opacity:.52; } 35% { transform:translateY(-4px); opacity:1; } }
@media (prefers-reduced-motion: reduce) { .fa-typing-dots i { animation:none; opacity:.85; } }
