/* iah-chat2.css — Tema complementar (header/CTA do site) */

/* ==============================
   Tokens derivados do site
   (iah-chat2.js preenche estes valores dinamicamente)
   ============================== */
:root{
  /* Header -> barra de título */
  --iah2-header-bg:   #2b3e6f;   /* fallback */
  --iah2-header-fg:   #ffffff;   /* fallback de contraste */

  /* CTA padrão do site -> botão Enviar */
  --iah2-cta-bg:      #F4A53A;    /*#2b3e6f;    fundo do CTA */
  --iah2-cta-fg:      #ffffff;   /* texto do CTA */
  --iah2-cta-bd:      transparent;/* borda do CTA */
  --iah2-cta-radius:  8px;       /* raio do CTA */
  --iah2-cta-shadow:  0 2px 8px rgba(0,0,0,.15); /* sombra do CTA */
}

/* ==============================
   1) Barra de título = cor do header do site
   ============================== */
.iah-chat .iah-header{
  background: var(--iah2-header-bg) !important;
  color: var(--iah2-header-fg) !important;
}
.iah-chat .iah-header h3{
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

/* ==============================
   2) Background do chat = branco
   ============================== */
.iah-chat{
  background: #ffffff !important;
}
.iah-chat .iah-messages{
  background: #ffffff;
}
.iah-chat .iah-form{
  background: #ffffff;
  border-top: 1px solid rgba(0,0,0,.08);
}

/* ==============================
   3) Botão Enviar = layout dos CTAs do site
   (usa tokens capturados do botão principal do site)
   ============================== */

   .iah-chat .iah-form button{
  background: var(--iah2-cta-bg) !important;
  color: var(--iah2-cta-fg) !important;
  border: 1px solid var(--iah2-cta-bd) !important;
  border-radius: var(--iah2-cta-radius) !important;
  box-shadow: var(--iah2-cta-shadow);
  transition: filter .12s ease, transform .04s ease;
  min-width: 44px;
}
.iah-chat .iah-form button:hover{
  filter: brightness(.97);
}
.iah-chat .iah-form button:active{
  transform: translateY(1px);
}
.iah-chat .iah-form button:focus-visible{
  outline: 3px solid color-mix(in srgb, var(--iah2-cta-bg) 35%, transparent);
  outline-offset: 2px;
}

/* Campo mantém contraste adequado ao fundo branco */
.iah-chat .iah-form textarea{
  background: #fff;
  color: #111827;
  border: 1px solid rgba(0,0,0,.12);
}
.iah-chat .iah-form textarea::placeholder{
  color: #6b7280;
}

/* Mensagens sobre fundo branco */
.iah-chat .iah-msg.bot{
  background: #f3f4f6;
  color: #111827;
}
.iah-chat .iah-msg.user{
  /* leve tinte no fundo da mensagem do usuário a partir do CTA */
  background: color-mix(in srgb, var(--iah2-cta-bg) 18%, #ffffff);
  color: #111827;
}

/* Mantém responsividade e segurança em áreas com notch */
@media (max-width: 480px){
  .iah-chat{ right: calc(8px + env(safe-area-inset-right, 0px)); }
}
