/* ============================================================
   Botão "Fale com a gente" + card do atendimento (site público)
   Cores da Redework: azul #1852a5 / #0f2d5c, laranja #f05423.
   Tamanhos em px de propósito: o site usa html { font-size: 62.5% }.
   ============================================================ */
.rwa-botao {
    position: fixed; right: 28px; bottom: 28px; z-index: 1001;
    width: 60px; height: 60px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1852a5, #0f2d5c);
    border: 3px solid #fff; /* destaca o botão também em fundos azuis */
    box-shadow: 0 8px 24px rgba(15,45,92,.38);
    text-decoration: none; cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
    -webkit-tap-highlight-color: transparent;
}
.rwa-botao:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(15,45,92,.45); }
.rwa-botao.ativo { background: linear-gradient(135deg, #f05423, #d4421a); box-shadow: 0 8px 24px rgba(240,84,35,.4); }
.rwa-botao svg { display: block; transition: transform .2s ease, opacity .2s ease; }
.rwa-botao .rwa-icone-fechar { position: absolute; opacity: 0; transform: rotate(-90deg) scale(.6); }
.rwa-botao.ativo .rwa-icone-chat { opacity: 0; transform: rotate(90deg) scale(.6); }
.rwa-botao.ativo .rwa-icone-fechar { opacity: 1; transform: none; }

/* bolinha verde/cinza: estamos online? */
.rwa-ponto {
    position: absolute; top: 0; right: 0; width: 14px; height: 14px; border-radius: 50%;
    background: #9aa3b2; border: 2.5px solid #fff;
}
.rwa-ponto.sup-online { background: #22c55e; }
.rwa-botao.ativo .rwa-ponto { display: none; }

/* balãozinho ao passar o mouse */
.rwa-tooltip {
    position: absolute; right: 74px; top: 50%; transform: translateY(-50%) translateX(6px);
    background: #fff; color: #1a1a2e; padding: 9px 14px; border-radius: 12px;
    font-family: 'Poppins', 'Segoe UI', Arial, sans-serif; font-size: 14px; font-weight: 600; line-height: 1.25;
    white-space: nowrap; box-shadow: 0 8px 24px rgba(15,45,92,.18);
    opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.rwa-tooltip small { display: block; font-size: 12px; font-weight: 500; color: #6b7280; }
.rwa-tooltip::after {
    content: ""; position: absolute; left: 100%; top: 50%; margin-top: -6px;
    border: 6px solid transparent; border-left-color: #fff;
}
.rwa-botao:hover .rwa-tooltip { opacity: 1; transform: translateY(-50%); }
.rwa-botao.ativo .rwa-tooltip { display: none; }

/* ===== card ===== */
.rwa-card {
    position: fixed; right: 28px; bottom: 100px; z-index: 1001;
    width: 400px; height: 640px; max-height: calc(100vh - 124px);
    background: #fff; border-radius: 18px; overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 24px 60px rgba(15,45,92,.32);
    font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
    opacity: 0; transform: translateY(14px) scale(.98); transform-origin: bottom right;
    transition: opacity .2s ease, transform .2s ease;
}
.rwa-card[hidden] { display: none; }
.rwa-card.aberto { opacity: 1; transform: none; }
.rwa-cab {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 16px; flex-shrink: 0;
    background: linear-gradient(135deg, #0f2d5c, #1852a5); color: #fff;
}
.rwa-logo { height: 24px; width: auto; display: block; }
.rwa-cab-txt { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 500; color: rgba(255,255,255,.85); padding-left: 10px; margin-left: 2px; border-left: 1px solid rgba(255,255,255,.25); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rwa-cab-bt {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); color: #fff;
    cursor: pointer; text-decoration: none; transition: background .2s ease;
}
.rwa-cab-bt:hover { background: #f05423; border-color: #f05423; color: #fff; }
.rwa-corpo { flex: 1; min-height: 0; position: relative; background: #eef2f8; }
.rwa-quadro { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.rwa-carregando {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    color: #6b7280; font-size: 14px;
}
.rwa-roda {
    width: 30px; height: 30px; border-radius: 50%; border: 3px solid #dfe3ec; border-top-color: #1852a5;
    animation: rwa-gira .8s linear infinite;
}
@keyframes rwa-gira { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
    .rwa-botao { right: 18px; bottom: 18px; width: 56px; height: 56px; }
    .rwa-tooltip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .rwa-botao, .rwa-card, .rwa-botao svg { transition: none; }
}

/* número de mensagens novas (card fechado) */
.rwa-badge {
    position: absolute; top: -6px; left: -6px; min-width: 22px; height: 22px; padding: 0 6px;
    border-radius: 999px; background: #f05423; color: #fff; border: 2px solid #fff;
    font-family: 'Poppins', 'Segoe UI', Arial, sans-serif; font-size: 12px; font-weight: 700; line-height: 18px; text-align: center;
    box-shadow: 0 3px 8px rgba(240,84,35,.45);
    animation: rwa-pulo .5s ease;
}
.rwa-badge[hidden] { display: none; }
.rwa-botao.ativo .rwa-badge { display: none; }
.rwa-botao.tem-nova { animation: rwa-chama 1.6s ease-in-out 3; }
@keyframes rwa-pulo { 0% { transform: scale(.4); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes rwa-chama { 0%, 100% { transform: none; } 15% { transform: rotate(-12deg); } 30% { transform: rotate(10deg); } 45% { transform: rotate(-6deg); } 60% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .rwa-badge, .rwa-botao.tem-nova { animation: none; } }
