/* Chat do site — recepção virtual (Aquino Barbearia)
   Mesma linguagem visual da landing: tinta, ouro e creme. Sem framework. */

#chat-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border: 1px solid rgba(201, 162, 39, .45);
  border-radius: 999px;
  background: #1d1a16;
  color: #f4ede0;
  font: 500 14px/1 'Inter', system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
#chat-fab:hover { transform: translateY(-2px); border-color: #c9a227; background: #24201a; }
#chat-fab svg { width: 18px; height: 18px; fill: #c9a227; }
#chat-fab .ponto {
  width: 7px; height: 7px; border-radius: 50%; background: #7bd88f;
  box-shadow: 0 0 0 3px rgba(123, 216, 143, .18);
}

#chat-painel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 61;
  width: min(370px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 96px));
  display: none;
  flex-direction: column;
  background: #151310;
  border: 1px solid rgba(201, 162, 39, .35);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
}
#chat-painel.aberto { display: flex; }

#chat-topo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #1d1a16;
  border-bottom: 1px solid rgba(201, 162, 39, .22);
}
#chat-topo .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(201, 162, 39, .14);
  color: #e3c766;
  font: 600 14px/1 'Inter', sans-serif;
}
#chat-topo .quem { flex: 1; min-width: 0; }
#chat-topo .quem b {
  display: block;
  font: 600 14px/1.2 'Cormorant Garamond', Georgia, serif;
  letter-spacing: .04em;
  color: #f4ede0;
}
#chat-topo .quem span {
  display: block;
  font: 400 11.5px/1.4 'Inter', sans-serif;
  color: #9c9587;
}
#chat-fechar {
  background: none; border: 0; color: #9c9587; cursor: pointer;
  font-size: 22px; line-height: 1; padding: 2px 6px; border-radius: 6px;
}
#chat-fechar:hover { color: #e3c766; }

#chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.msg {
  max-width: 84%;
  padding: 10px 13px;
  border-radius: 13px;
  font: 400 13.5px/1.5 'Inter', system-ui, sans-serif;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg.bot {
  align-self: flex-start;
  background: #24201a;
  color: #f4ede0;
  border: 1px solid rgba(201, 162, 39, .18);
  border-bottom-left-radius: 5px;
}
.msg.eu {
  align-self: flex-end;
  background: #c9a227;
  color: #171410;
  border-bottom-right-radius: 5px;
}
.msg.erro {
  align-self: center;
  background: rgba(180, 60, 50, .16);
  color: #e6a89f;
  font-size: 12.5px;
  text-align: center;
}
.digitando { display: flex; gap: 4px; padding: 12px 14px; }
.digitando i {
  width: 6px; height: 6px; border-radius: 50%; background: #c9a227;
  opacity: .45; animation: pulo 1.1s infinite;
}
.digitando i:nth-child(2) { animation-delay: .15s; }
.digitando i:nth-child(3) { animation-delay: .3s; }
@keyframes pulo { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-4px); opacity: 1; } }

#chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(201, 162, 39, .2);
  background: #151310;
}
#chat-input {
  flex: 1;
  min-width: 0;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid rgba(244, 237, 224, .16);
  background: #1d1a16;
  color: #f4ede0;
  font: 400 13.5px/1.3 'Inter', system-ui, sans-serif;
  outline: none;
}
#chat-input::placeholder { color: #7d7769; }
#chat-input:focus { border-color: rgba(201, 162, 39, .6); }
#chat-enviar {
  width: 42px; height: 42px;
  border: 0; border-radius: 10px;
  background: #c9a227; color: #171410;
  display: grid; place-items: center; cursor: pointer;
}
#chat-enviar:hover { background: #e3c766; }
#chat-enviar:disabled { opacity: .45; cursor: not-allowed; }
#chat-enviar svg { width: 18px; height: 18px; fill: currentColor; }

#chat-rodape {
  padding: 0 12px 10px;
  font: 400 10.5px/1.4 'Inter', sans-serif;
  color: #6f6a5e;
  text-align: center;
}
#chat-rodape a { color: #9c9587; text-decoration: underline; }

@media (max-width: 480px) {
  #chat-fab { right: 12px; bottom: 12px; padding: 11px 16px; font-size: 13px; }
  #chat-painel { right: 8px; bottom: 8px; width: calc(100vw - 16px); height: calc(100vh - 72px); }
}
