/* =============================================================
   Atendimento Comercial — botão flutuante + modal de qualificação
   Exibido apenas para visitas vindas do Google Ads (ver atendimento.js)
   ============================================================= */

:root {
  --atd-verde: #25d366;
  --atd-verde-escuro: #1da851;
  --atd-royal: #071285;
  --atd-navy: #0c2340;
}

/* ── Botão flutuante ───────────────────────────────────────── */
.atd-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9990;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--atd-verde);
  color: #fff;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.42), 0 2px 8px rgba(0, 0, 0, 0.14);
  transform: translateY(12px);
  opacity: 0;
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), opacity .45s ease, background-color .2s ease, bottom .35s ease;
}

.atd-fab.is-visivel {
  transform: translateY(0);
  opacity: 1;
}

.atd-fab:hover {
  background: var(--atd-verde-escuro);
}

.atd-fab:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

/* Sobe quando o aviso de cookies está na tela */
.atd-fab.is-elevado {
  bottom: 150px;
}

.atd-fab__icone {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

/* Anel pulsante — o "piscar" tradicional */
.atd-fab__anel {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--atd-verde);
  opacity: .55;
  z-index: -1;
  animation: atd-pulso 2s cubic-bezier(.4, 0, .6, 1) infinite;
}

@keyframes atd-pulso {
  0% { transform: scale(1); opacity: .5; }
  70% { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* Balão com o texto, à esquerda do botão */
.atd-fab__balao {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%);
  padding: 11px 16px;
  border-radius: 12px;
  background: #fff;
  color: var(--atd-navy);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .16);
}

/* Bico do balão apontando para o botão */
.atd-fab__balao::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  width: 0;
  height: 0;
  transform: translateY(-50%);
  border: 7px solid transparent;
  border-right: 0;
  border-left-color: #fff;
}

@media (max-width: 480px) {
  .atd-fab {
    right: 14px;
    bottom: 14px;
    width: 56px;
    height: 56px;
  }
  .atd-fab__icone {
    width: 32px;
    height: 32px;
  }
  .atd-fab__balao {
    right: calc(100% + 11px);
    padding: 9px 13px;
    font-size: 12.5px;
  }
  .atd-fab.is-elevado { bottom: 210px; }
}

@media (prefers-reduced-motion: reduce) {
  .atd-fab,
  .atd-fab__anel {
    animation: none;
    transition: opacity .2s ease;
  }
}

/* ── Folga no rodapé ───────────────────────────────────────────
   O botão é fixo e, com a página rolada até o fim, cobriria a última
   linha do rodapé ("Desenvolvido por Tog Agency"). A classe só entra
   no <body> quando o botão é criado, então quem não vem de anúncio
   continua com o rodapé original.
   Contas: botão 60px + 20px da base = 80px ocupados; o rodapé já tem
   24px de padding abaixo do texto, e os 72px extras levam a linha
   para 96px — sobra folga sobre o topo do botão.                     */
body.atd-ativo #footer-contato {
  padding-bottom: 72px;
}

/* ── Modal ─────────────────────────────────────────────────── */
.atd-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  visibility: hidden;
  opacity: 0;
  transition: opacity .3s ease, visibility .3s ease;
}

.atd-modal.is-aberto {
  visibility: visible;
  opacity: 1;
}

.atd-modal__fundo {
  position: absolute;
  inset: 0;
  background: rgba(7, 18, 133, .55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.atd-modal__caixa {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
  transform: translateY(24px);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}

.atd-modal.is-aberto .atd-modal__caixa {
  transform: translateY(0);
}

@media (min-width: 640px) {
  .atd-modal {
    align-items: center;
    padding: 24px;
  }
  .atd-modal__caixa {
    border-radius: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .atd-modal,
  .atd-modal__caixa {
    transition: none;
  }
}

/* Cabeçalho */
.atd-modal__topo {
  position: relative;
  padding: 28px 28px 24px;
  background: var(--atd-royal);
  border-radius: 24px 24px 0 0;
  color: #fff;
  overflow: hidden;
}

.atd-modal__topo::after {
  content: "";
  position: absolute;
  top: -70px;
  right: -60px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
}

.atd-modal__titulo {
  position: relative;
  margin: 0 0 8px;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
}

.atd-modal__sub {
  position: relative;
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, .78);
}

.atd-modal__fechar {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  transition: background-color .2s ease;
}

.atd-modal__fechar:hover {
  background: rgba(255, 255, 255, .28);
}

/* Formulário */
.atd-form {
  padding: 26px 28px 28px;
}

.atd-campo {
  margin-bottom: 16px;
}

.atd-campo__rotulo {
  display: block;
  margin-bottom: 7px;
  color: var(--atd-navy);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.atd-campo__rotulo span {
  color: #ef4444;
}

.atd-campo__input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f9fafb;
  color: #111827;
  font-family: inherit;
  font-size: 15px;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.atd-campo__input::placeholder {
  color: #9ca3af;
}

.atd-campo__input:focus {
  outline: 0;
  background: #fff;
  border-color: var(--atd-royal);
  box-shadow: 0 0 0 4px rgba(7, 18, 133, .08);
}

.atd-campo.tem-erro .atd-campo__input {
  border-color: #ef4444;
  background: #fef2f2;
}

.atd-campo__erro {
  display: none;
  margin: 6px 0 0;
  color: #dc2626;
  font-size: 12.5px;
  font-weight: 500;
}

.atd-campo.tem-erro .atd-campo__erro {
  display: block;
}

/* Honeypot */
.atd-armadilha {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Alerta geral */
.atd-alerta {
  display: none;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 500;
}

.atd-alerta.is-visivel {
  display: block;
}

/* Botão de envio */
.atd-enviar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 56px;
  margin-top: 4px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--atd-verde);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(37, 211, 102, .35);
  transition: background-color .2s ease, opacity .2s ease;
}

.atd-enviar:hover:not(:disabled) {
  background: var(--atd-verde-escuro);
}

.atd-enviar:disabled {
  opacity: .65;
  cursor: progress;
}

.atd-enviar__conteudo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.atd-enviar__icone {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.atd-aviso {
  margin: 14px 0 0;
  color: #9ca3af;
  font-size: 11.5px;
  line-height: 1.55;
  text-align: center;
}

.atd-aviso a {
  color: var(--atd-royal);
  font-weight: 600;
  text-decoration: none;
}

.atd-aviso a:hover {
  text-decoration: underline;
}

/* Spinner */
.atd-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: atd-girar .7s linear infinite;
}

@keyframes atd-girar {
  to { transform: rotate(360deg); }
}

/* Trava o scroll do site com o modal aberto */
body.atd-travado {
  overflow: hidden;
}
