/* ============================================================
   ARAgent — Widget de chat embebível
   AR Consultoria & Gestão Lda
   Paleta oficial: cinzento-carvão #475159 + dourado #F9CC47
   Todos os estilos têm prefixo .arachat para isolamento.
   ============================================================ */

.arachat {
  /* Paleta da marca AR */
  --ara-primary: #475159;
  --ara-primary-dark: #2f3539;
  --ara-primary-soft: #5c6770;
  --ara-accent: #f9cc47;
  --ara-accent-dark: #e0b227;

  /* Cabeçalho — azul-ardósia do site WordPress AR */
  --ara-header: #526e94;
  --ara-header-dark: #405673;

  /* Superfícies */
  --ara-bg: #ffffff;
  --ara-surface: #f6f7f8;
  --ara-surface-2: #eef0f2;
  --ara-text: #1f2629;
  --ara-text-soft: #6b757c;
  --ara-text-mute: #98a2a8;
  --ara-bot-bubble: #ffffff;
  --ara-user-bubble: #475159;
  --ara-border: #e4e7ea;
  --ara-border-strong: #cfd5d9;

  /* Geometria */
  --ara-radius: 18px;
  --ara-radius-sm: 12px;
  --ara-shadow: 0 18px 50px rgba(31, 38, 41, 0.18), 0 2px 6px rgba(31, 38, 41, 0.06);
  --ara-shadow-launcher: 0 10px 28px rgba(71, 81, 89, 0.35), 0 2px 6px rgba(71, 81, 89, 0.18);
  --ara-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2147483000;
  font-family: var(--ara-font);
  color: var(--ara-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.arachat *,
.arachat *::before,
.arachat *::after {
  box-sizing: border-box;
}

/* ── Botão flutuante ──────────────────────────────────── */
.arachat-launcher {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(140deg, var(--ara-primary) 0%, var(--ara-primary-dark) 100%);
  color: #fff;
  box-shadow: var(--ara-shadow-launcher);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.arachat-launcher::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ara-accent) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.arachat-launcher:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 14px 34px rgba(71, 81, 89, 0.4), 0 2px 8px rgba(71, 81, 89, 0.2);
}

.arachat-launcher:hover::before {
  opacity: 0.4;
}

.arachat-launcher:active { transform: scale(0.95); }

.arachat-launcher svg {
  width: 28px;
  height: 28px;
}

/* Badge dourado "1" ao primeiro carregamento */
.arachat-launcher-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--ara-accent);
  color: var(--ara-primary-dark);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  animation: araPulse 2s ease-in-out infinite;
}

@keyframes araPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.arachat-launcher--hidden { display: none; }

/* ── Balão teaser (chama a atenção de quem entra no site) ──── */
.arachat-teaser {
  position: absolute;
  bottom: 80px; /* acima do launcher de 64px */
  right: 0;
  width: 250px;
  max-width: calc(100vw - 48px);
  background: #fff;
  border: 1px solid var(--ara-border);
  border-radius: 16px;
  border-bottom-right-radius: 6px;
  box-shadow: 0 12px 32px rgba(31, 38, 41, 0.18), 0 2px 6px rgba(31, 38, 41, 0.08);
  padding: 14px 34px 14px 16px;
  cursor: pointer;
  transform-origin: bottom right;
  animation: araTeaserIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1;
}
.arachat-teaser[hidden] { display: none !important; }

/* Cauda do balão a apontar para o launcher. */
.arachat-teaser::after {
  content: "";
  position: absolute;
  bottom: -7px;
  right: 26px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-right: 1px solid var(--ara-border);
  border-bottom: 1px solid var(--ara-border);
  transform: rotate(45deg);
}

.arachat-teaser__text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ara-text);
}
.arachat-teaser__text strong { color: var(--ara-primary); font-weight: 600; }

.arachat-teaser__close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border: none;
  background: var(--ara-surface);
  color: var(--ara-text-soft);
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.arachat-teaser__close:hover { background: var(--ara-surface-2); color: var(--ara-text); }

@keyframes araTeaserIn {
  from { opacity: 0; transform: translateY(8px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Anel pulsante à volta do launcher para captar o olhar. Fica atrás do
   botão (z-index:-1) — só a parte que se expande para fora é visível. */
.arachat-launcher--attention::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--ara-accent);
  animation: araLauncherRing 1.8s ease-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes araLauncherRing {
  0%   { transform: scale(1); opacity: 0.75; }
  70%  { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .arachat-teaser { animation: none; }
  .arachat-launcher--attention::after { animation: none; display: none; }
}

/* ── Painel de chat ───────────────────────────────────── */
.arachat-panel {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 620px;
  max-height: calc(100vh - 48px);
  background: var(--ara-bg);
  border-radius: var(--ara-radius);
  box-shadow: var(--ara-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid var(--ara-border);
}

.arachat-panel--open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ── Cabeçalho ────────────────────────────────────────── */
.arachat-header {
  background: linear-gradient(140deg, var(--ara-header) 0%, var(--ara-header-dark) 100%);
  color: #fff;
  padding: 6px 12px 6px 12px; /* topo:6 / dir:12 / fundo:6 / esq:12 — teste compacto */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 2px;
  position: relative;
  overflow: hidden;
}

/* Brand: logo em cima, depois título e badges (tudo coluna, à esquerda). */
.arachat-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0; /* logo ↔ título — teste sem gap */
  max-width: 100%;
  min-width: 0;
  width: 100%;
}
.arachat-brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5px; /* título ↔ badges */
  min-width: 0;
}

/* Badges de estado por baixo do título, alinhadas à esquerda. */
.arachat-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 4px 6px;
}
.arachat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 1px 6px; /* reduzido de 2px 8px para diminuir a altura geral */
  border-radius: 999px;
}
.arachat-badge__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #94a3ad;
  box-shadow: 0 0 0 0 rgba(148, 163, 173, 0);
}
.arachat-badge--on .arachat-badge__dot {
  background: #4ade80;
  animation: araDot 2s ease-in-out infinite;
}
.arachat-badge--team-on .arachat-badge__dot {
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.55);
}
.arachat-badge--team-off .arachat-badge__dot {
  background: #f87171;
  box-shadow: 0 0 6px rgba(248, 113, 113, 0.55);
}

/* Linha de contacto por email (visível só quando equipa offline).
   Compacta para não comer o espaço dos chips de sugestão. */
.arachat-contact-line {
  grid-area: contact;
  margin: 2px 0 0;
  font-size: 11.5px;
  line-height: 1.3; /* teste: 1.35 → 1.3 */
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 3px 9px; /* teste: 3px 8px → 3px 9px */
  width: calc(100% - 24px); /* deixa folga para o X à direita */
  animation: araFadeIn 0.25s ease;
}
.arachat-contact-line[hidden] { display: none !important; }
.arachat-contact-line a {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.55);
  text-underline-offset: 2px;
  word-break: break-all;
}
.arachat-contact-line a:hover { text-decoration-color: #fff; }

.arachat-header::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(249, 204, 71, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.arachat-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #fff;
  padding: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.arachat-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.arachat-header-info {
  flex: 1;
  min-width: 0;
}

.arachat-title {
  font-size: 11px;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
  letter-spacing: 0;
  text-align: left;
  color: rgba(255, 255, 255, 0.95);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arachat-subtitle {
  font-size: 12px;
  opacity: 0.78;
  margin-top: 2px;
}

.arachat-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.arachat-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5);
  animation: araDot 2s ease-in-out infinite;
}

@keyframes araDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
  50% { box-shadow: 0 0 0 5px rgba(74, 222, 128, 0); }
}

/* X de fechar — canto inferior direito do cabeçalho. Fica colado à linha
   de transição entre o header e a área de mensagens, separado verticalmente
   do botão "Falar com um colaborador" (no topo direito). */
.arachat-close {
  position: absolute;
  bottom: 4px;
  right: 6px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  opacity: 0.95;
  transition: opacity 0.15s ease, background 0.15s ease, transform 0.15s ease;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
}

.arachat-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.32);
  transform: scale(1.05);
}

.arachat-close svg { width: 14px; height: 14px; }

/* ── Área de mensagens ────────────────────────────────── */
.arachat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background:
    radial-gradient(circle at 0% 0%, rgba(249, 204, 71, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(71, 81, 89, 0.04) 0%, transparent 40%),
    var(--ara-surface);
}

.arachat-msg {
  max-width: 84%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: araFadeIn 0.25s ease;
}

.arachat-msg--bot {
  align-self: flex-start;
  background: var(--ara-bot-bubble);
  color: var(--ara-text);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(31, 38, 41, 0.06), 0 0 0 1px var(--ara-border);
}

.arachat-msg--user {
  align-self: flex-end;
  background: var(--ara-user-bubble);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 6px rgba(71, 81, 89, 0.18);
}

/* Bolha de agente humano — distinta da do bot (acento da marca). */
.arachat-msg--agent {
  align-self: flex-start;
  background: #eef2f8;
  color: var(--ara-text);
  border-bottom-left-radius: 4px;
  border-left: 3px solid var(--ara-primary, #405673);
  box-shadow: 0 1px 2px rgba(31, 38, 41, 0.06), 0 0 0 1px var(--ara-border);
}

/* Linha de sistema centrada (entrou/saiu, em espera). */
.arachat-system {
  align-self: center;
  max-width: 90%;
  text-align: center;
  font-size: 12px;
  line-height: 1.4;
  color: #6b7785;
  background: transparent;
  padding: 2px 8px;
  animation: araFadeIn 0.25s ease;
}

@keyframes araFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Chips de perguntas sugeridas ─────────────────────── */
.arachat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-self: flex-start;
  margin-top: 2px;
  max-width: 100%;
  animation: araFadeIn 0.3s ease;
}

.arachat-chip {
  background: #fff;
  border: 1px solid var(--ara-border);
  color: var(--ara-primary);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.arachat-chip:hover {
  background: var(--ara-primary);
  color: #fff;
  border-color: var(--ara-primary);
  transform: translateY(-1px);
}

/* ── Indicador "a escrever" ───────────────────────────── */
.arachat-typing {
  align-self: flex-start;
  background: var(--ara-bot-bubble);
  padding: 14px 16px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  display: flex;
  gap: 4px;
  box-shadow: 0 1px 2px rgba(31, 38, 41, 0.06), 0 0 0 1px var(--ara-border);
}

.arachat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ara-primary-soft);
  animation: araBounce 1.2s infinite ease-in-out;
}

.arachat-typing span:nth-child(2) { animation-delay: 0.15s; }
.arachat-typing span:nth-child(3) { animation-delay: 0.3s; }

/* Indicador "agente a escrever" — acento da marca para o distinguir do bot. */
.arachat-typing--agent {
  background: #eef2f8;
  border-left: 3px solid var(--ara-primary, #405673);
}
.arachat-typing--agent span { background: var(--ara-primary, #405673); }

@keyframes araBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ── Formulário de captura de email ───────────────────── */
.arachat-email-form {
  align-self: stretch;
  background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
  border: 1px solid var(--ara-border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: araFadeIn 0.25s ease;
  box-shadow: 0 2px 8px rgba(31, 38, 41, 0.04);
  position: relative;
}

.arachat-email-form::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  background: var(--ara-accent);
  border-radius: 0 3px 3px 0;
}

.arachat-email-form p {
  margin: 0 0 0 6px;
  font-size: 13px;
  color: var(--ara-text);
  line-height: 1.45;
}

.arachat-email-input {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--ara-border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  background: #fff;
}

.arachat-email-input:focus {
  border-color: var(--ara-primary);
  box-shadow: 0 0 0 3px rgba(71, 81, 89, 0.1);
}

.arachat-email-submit {
  background: var(--ara-accent);
  color: var(--ara-primary-dark);
  border: none;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 6px rgba(249, 204, 71, 0.3);
}

.arachat-email-submit:hover {
  background: var(--ara-accent-dark);
  box-shadow: 0 4px 12px rgba(249, 204, 71, 0.4);
}

.arachat-email-submit:active { transform: scale(0.98); }

.arachat-email-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Cartão de resposta técnica "gated" ──────────────── */
.arachat-gated {
  align-self: stretch;
  background: #fff;
  border: 1px solid var(--ara-border);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(31, 38, 41, 0.06);
  animation: araFadeIn 0.3s ease;
  display: flex;
  flex-direction: column;
}

.arachat-gated__preview {
  position: relative;
  padding: 14px 16px 24px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ara-text);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.arachat-gated__fade {
  display: inline;
  color: var(--ara-text-mute);
  font-weight: 600;
  margin-left: 2px;
}

.arachat-gated__preview::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, #fff 100%);
  pointer-events: none;
}

.arachat-gated__notice {
  background: linear-gradient(180deg, #fef9e4 0%, #fdf3d3 100%);
  border-top: 1px solid #f1e3a5;
  border-bottom: 1px solid #f1e3a5;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.arachat-gated__notice-icon {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--ara-accent);
  color: var(--ara-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 2px 6px rgba(249, 204, 71, 0.35);
}

.arachat-gated__notice-body { flex: 1; min-width: 0; }

.arachat-gated__notice-msg {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ara-text);
}

.arachat-gated__price {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ara-text);
}

.arachat-gated__price span {
  color: var(--ara-text-soft);
  font-size: 12px;
}

.arachat-gated__price strong {
  color: var(--ara-primary-dark);
  font-weight: 700;
}

.arachat-gated__cta {
  margin: 12px 14px 14px;
  background: var(--ara-accent);
  color: var(--ara-primary-dark);
  border: none;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 6px rgba(249, 204, 71, 0.3);
}

.arachat-gated__cta:hover {
  background: var(--ara-accent-dark);
  box-shadow: 0 4px 12px rgba(249, 204, 71, 0.4);
}

.arachat-gated__cta:active { transform: scale(0.98); }

.arachat-gated--unlocked {
  background: linear-gradient(180deg, #f1faf3 0%, #e7f5ea 100%);
  border-color: #b8dec2;
}

/* ── Sugestão FAQ (chip) ─────────────────────────────── */
.arachat-faq-nudge {
  align-self: flex-start;
  max-width: 92%;
  background: #fff;
  border: 1px dashed var(--ara-border-strong);
  border-radius: 12px;
  padding: 9px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  animation: araFadeIn 0.3s ease;
}

.arachat-faq-nudge__icon { font-size: 14px; }

.arachat-faq-nudge__label {
  font-size: 12px;
  color: var(--ara-text-soft);
}

.arachat-faq-nudge__chip {
  background: var(--ara-primary);
  color: #fff;
  border: none;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.1s ease;
  text-align: left;
}

.arachat-faq-nudge__chip:hover {
  background: var(--ara-primary-dark);
  transform: translateY(-1px);
}

/* ── Formulário de unlock dentro do cartão ───────────── */
.arachat-unlock-form {
  padding: 12px 14px 14px;
  background: #fafbfc;
  border-top: 1px solid var(--ara-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: araFadeIn 0.2s ease;
}

.arachat-unlock-form__intro {
  margin: 0;
  font-size: 13px;
  color: var(--ara-text);
  line-height: 1.45;
}

.arachat-unlock-form__email,
.arachat-unlock-form__name {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--ara-border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.arachat-unlock-form__email:focus,
.arachat-unlock-form__name:focus {
  border-color: var(--ara-primary);
  box-shadow: 0 0 0 3px rgba(71, 81, 89, 0.1);
}

.arachat-unlock-form__submit {
  background: var(--ara-primary);
  color: #fff;
  border: none;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.1s ease;
}

.arachat-unlock-form__submit:hover { background: var(--ara-primary-dark); }
.arachat-unlock-form__submit:active { transform: scale(0.98); }
.arachat-unlock-form__submit:disabled { opacity: 0.6; cursor: not-allowed; }

.arachat-unlock-form__legal {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--ara-text-mute);
  line-height: 1.4;
}

.arachat-unlock-form__error {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: #b54034;
  background: #fdecea;
  border-radius: 8px;
  padding: 7px 10px;
}

/* ── Estado de sucesso após unlock ───────────────────── */
.arachat-unlock-success {
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.arachat-unlock-success__icon {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2f8a4a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.arachat-unlock-success__body { flex: 1; min-width: 0; }

.arachat-unlock-success__title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ara-primary-dark);
}

.arachat-unlock-success__msg {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ara-text);
}

.arachat-unlock-success__ref {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--ara-text-soft);
}

.arachat-unlock-success__ref strong {
  font-family: "SF Mono", Monaco, Consolas, monospace;
  color: var(--ara-primary-dark);
}

/* ── Botão "Falar com um colaborador" — canto superior direito do header. */
/* Pílula que se expande no hover/focus/click para revelar o rótulo. */
.arachat-talkbtn {
  position: absolute;
  top: 4px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 0;
  width: 22px;
  height: 22px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  transition: width 0.22s ease, background 0.15s ease, transform 0.12s ease, border-color 0.15s ease;
  z-index: 3;
}
.arachat-talkbtn[hidden] { display: none !important; }
.arachat-talkbtn__icon {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
}
.arachat-talkbtn__label {
  padding: 0 10px 0 2px;
  opacity: 0;
  transition: opacity 0.18s ease 0.04s;
}
.arachat-talkbtn:hover,
.arachat-talkbtn:focus-visible,
.arachat-talkbtn.is-open {
  width: auto;
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.45);
  outline: none;
}
.arachat-talkbtn:hover .arachat-talkbtn__label,
.arachat-talkbtn:focus-visible .arachat-talkbtn__label,
.arachat-talkbtn.is-open .arachat-talkbtn__label { opacity: 1; }
.arachat-talkbtn:active { transform: scale(0.96); }
.arachat-talkbtn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Compositor ───────────────────────────────────────── */
.arachat-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--ara-border);
  background: #fff;
}

.arachat-textarea {
  flex: 1;
  resize: none;
  border: 1.5px solid var(--ara-border);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.4;
  max-height: 110px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  color: var(--ara-text);
  background: var(--ara-surface);
}

.arachat-textarea::placeholder { color: var(--ara-text-mute); }

.arachat-textarea:focus {
  border-color: var(--ara-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(71, 81, 89, 0.08);
}

/* Botão enviar — usa a imagem enviomsg.png (paper plane sobre círculo azul
   já com fundo e sombra próprios). O button é só um wrapper transparente
   que adiciona estados de hover/active/disabled. */
.arachat-send {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              filter 0.18s ease, opacity 0.18s ease;
  filter: drop-shadow(0 3px 8px rgba(82, 110, 148, 0.35));
  animation: araSendIdle 3.6s ease-in-out infinite;
}

.arachat-send img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
  transition: transform 0.2s ease;
}

.arachat-send:hover {
  transform: translateY(-1px) scale(1.06);
  filter: drop-shadow(0 6px 14px rgba(82, 110, 148, 0.45));
  animation-play-state: paused;
}

.arachat-send:focus-visible {
  outline: none;
  filter: drop-shadow(0 0 0 3px rgba(111, 143, 196, 0.5)) drop-shadow(0 4px 10px rgba(82, 110, 148, 0.4));
}

.arachat-send:active:not(:disabled) {
  animation: araSendLaunch 0.4s cubic-bezier(0.5, -0.3, 0.7, 1.5);
}

.arachat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(0.5);
  animation: none;
}

@keyframes araSendIdle {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-1px) scale(1.015); }
}

@keyframes araSendLaunch {
  0%   { transform: translateY(0) scale(1); }
  35%  { transform: translateY(-6px) translateX(5px) rotate(-12deg) scale(0.94); }
  60%  { transform: translateY(-2px) translateX(1px) rotate(-4deg) scale(1.03); }
  100% { transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .arachat-send { animation: none; transition: box-shadow 0.15s, transform 0.1s; }
  .arachat-send:hover { transform: scale(1.04); }
  .arachat-send:active:not(:disabled) { animation: none; transform: scale(0.96); }
  .arachat-send img { transform: none; }
}

/* ── Aviso permanente (sempre visível) ────────────────── */
.arachat-disclaimer {
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--ara-text-soft);
  background: #fdf6e0;
  border-top: 1px solid var(--ara-border);
  padding: 7px 14px;
  text-align: center;
  letter-spacing: 0.1px;
}

.arachat-disclaimer strong { color: var(--ara-primary); font-weight: 600; }

/* ── Nota contextual sob respostas geradas por IA ─────── */
.arachat-ai-note {
  max-width: 86%;
  margin: -2px 0 6px 8px;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--ara-text-soft);
  background: #fdf6e0;
  border-left: 3px solid var(--ara-accent);
  border-radius: 6px;
  padding: 6px 9px;
}

.arachat-ai-note strong { color: var(--ara-primary); font-weight: 600; }

/* ── Rodapé ───────────────────────────────────────────── */
.arachat-footer {
  text-align: center;
  font-size: 11px;
  color: var(--ara-text-mute);
  padding: 6px 0 10px;
  background: #fff;
  border-top: 1px solid var(--ara-border);
  letter-spacing: 0.1px;
}

.arachat-footer a {
  color: var(--ara-primary);
  text-decoration: none;
  font-weight: 500;
}

.arachat-footer a:hover { color: var(--ara-accent-dark); }

/* ── Aviso de retenção no footer ──────────────────────── */
.arachat-retention-notice {
  font-size: 11px;
  color: #8a9199;
  text-align: center;
  padding: 2px 12px 0;
  line-height: 1.3;
}

/* ── Checkbox opt-out de email ────────────────────────── */
.arachat-email-optout {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: #5a6670;
  margin: 8px 0 4px;
  cursor: pointer;
  line-height: 1.35;
}
.arachat-email-optout .arachat-optout-check {
  margin-top: 2px;
  accent-color: var(--ara-accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Scrollbar discreta ───────────────────────────────── */
.arachat-messages::-webkit-scrollbar { width: 6px; }
.arachat-messages::-webkit-scrollbar-track { background: transparent; }
.arachat-messages::-webkit-scrollbar-thumb {
  background: rgba(71, 81, 89, 0.2);
  border-radius: 3px;
}
.arachat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(71, 81, 89, 0.35);
}

/* ── Responsivo ───────────────────────────────────────── */
@media (max-width: 480px) {
  /* NÃO esticar o contentor raiz para o ecrã inteiro: como é position:fixed
     com z-index altíssimo, uma raiz a 100vw/100vh fica como um "escudo"
     transparente por cima da página e bloqueia todos os cliques (menu, login).
     A raiz mantém-se ancorada ao canto; é o painel que ocupa o ecrã quando
     aberto, via position:fixed. */
  .arachat-panel {
    /* position:fixed → ancora diretamente à viewport, sem precisar que a raiz
       cubra o ecrã. Usa 100dvh para acompanhar a barra de URL do browser móvel. */
    position: fixed;
    top: 0;
    left: 0;
    bottom: auto;
    right: auto;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
  }
  .arachat-launcher {
    bottom: 16px;
    right: 16px;
    position: fixed;
  }
  .arachat-msg { max-width: 88%; }
}

/* ==========================================================================
   RGPD — Overlay de consentimento
   ========================================================================== */

.arachat-consent-overlay {
  position: absolute;
  inset: 0;
  background: rgba(30, 30, 30, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
  animation: arachat-consent-fadein 0.25s ease;
}

@keyframes arachat-consent-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.arachat-consent-box {
  background: #fff;
  border-radius: 14px;
  padding: 28px 24px 22px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.arachat-consent-icon {
  margin: 0 auto 12px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #475159;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #F9CC47;
}

.arachat-consent-title {
  font-size: 16px;
  font-weight: 700;
  color: #475159;
  margin: 0 0 10px;
  font-family: inherit;
}

.arachat-consent-text {
  font-size: 13px;
  line-height: 1.5;
  color: #555;
  margin: 0 0 12px;
  font-family: inherit;
}

.arachat-consent-text strong {
  color: #475159;
  font-weight: 600;
}

.arachat-consent-links {
  font-size: 12px;
  margin: 0 0 16px;
  font-family: inherit;
}

.arachat-consent-links a {
  color: #475159;
  text-decoration: underline;
  font-weight: 500;
}

.arachat-consent-links a:hover {
  color: #F9CC47;
}

.arachat-consent-accept {
  display: block;
  width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  background: #475159;
  color: #F9CC47;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: inherit;
}

.arachat-consent-accept:hover {
  background: #3a444c;
}

.arachat-consent-accept:active {
  transform: scale(0.97);
}

.arachat-consent-controller {
  font-size: 11px;
  color: #999;
  margin: 12px 0 0;
  font-family: inherit;
}
