/* Atendente guiada do site (js/atendente.js): painel de conversa com respostas prontas, sem IA e sem guardar histórico. */
.at-painel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 75;
  /* acima do aviso de cookies (70): a conversa foi aberta de propósito e o aviso volta ao fechar */
  width: 372px;
  max-width: calc(100vw - 16px);
  height: 540px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 20px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .35);
  overflow: hidden;
  font-family: inherit;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(.97);
  transform-origin: bottom right;
  transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
}

.at-painel.aberto {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.at-topo {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
}

.at-topo img {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  object-fit: cover;
  border: 2px solid #fff;
  background: #fff;
}

.at-topo-texto {
  flex: 1;
  min-width: 0;
  line-height: 1.2;
}

.at-topo-texto strong {
  display: block;
  font-size: 15px;
}

.at-topo-texto span {
  font-size: 12px;
  opacity: .9;
}

.at-fechar {
  flex: none;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.at-fechar:hover {
  background: rgba(255, 255, 255, .32);
}

.at-conversa {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px 6px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overscroll-behavior: contain;
}

.at-msg {
  max-width: 86%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-line;
  overflow-wrap: anywhere;
  animation: at-entra .22s ease both;
}

.at-msg.bot {
  align-self: flex-start;
  background: #fff;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}

.at-msg.eu {
  align-self: flex-end;
  background: #2563eb;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.at-digitando {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}

.at-digitando i {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: #94a3b8;
  animation: at-ponto 1s ease-in-out infinite;
}

.at-digitando i:nth-child(2) {
  animation-delay: .15s;
}

.at-digitando i:nth-child(3) {
  animation-delay: .3s;
}

.at-opcoes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-self: stretch;
}

.at-opcoes button,
.at-opcoes a {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  padding: 8px 12px;
  border-radius: 9999px;
  border: 1px solid #93c5fd;
  background: #fff;
  color: #1d4ed8;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}

.at-opcoes button:hover,
.at-opcoes a:hover {
  background: #eff6ff;
}

.at-opcoes .at-link {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #fff;
}

.at-opcoes .at-link:hover {
  background: #1e40af;
}

.at-opcoes .at-wa {
  border-color: #16a34a;
  background: #16a34a;
  color: #fff;
}

.at-opcoes .at-wa:hover {
  background: #15803d;
}

.at-rodape {
  flex: none;
  padding: 8px 12px 10px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
}

.at-form {
  display: flex;
  gap: 8px;
}

.at-form input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 16px;
  /* 16 px evita o zoom automático do iPhone ao focar o campo */
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  color: #111827;
  background: #fff;
}

.at-form input:focus {
  outline: 2px solid #93c5fd;
  border-color: #2563eb;
}

.at-form button {
  flex: none;
  width: 40px;
  border: 0;
  border-radius: 9999px;
  background: #2563eb;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.at-form button:hover {
  background: #1d4ed8;
}

.at-pessoa {
  display: block;
  margin-top: 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #15803d;
  text-decoration: none;
}

.at-pessoa:hover {
  text-decoration: underline;
}

.at-aviso {
  margin-top: 4px;
  text-align: center;
  font-size: 11px;
  color: #6b7280;
}

body.at-aberto .wa-assistente {
  display: none;
}

@media (max-width: 639px) {
  .at-painel {
    right: 8px;
    left: 8px;
    bottom: 8px;
    width: auto;
    max-width: none;
    height: min(78vh, 560px);
  }
}

@keyframes at-entra {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes at-ponto {

  0%,
  100% {
    opacity: .3;
  }

  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {

  .at-painel,
  .at-msg,
  .at-digitando i {
    animation: none;
    transition: none;
  }
}
