/* ==========================================================================
   MHAX COPILOT COMERCIAL — MASCOTE INTERATIVO & CONSULTOR DE VENDAS (LP)
   Suporte Bimodal: Dark Mode (Padrão LP) & Light Mode (.light-mode / html:not(.dark))
   ========================================================================== */

/* Padrão para Landing Pages e Vitrines (Dock Flutuante Unificado Discreto) */
.landing-page .mhax-widget-container,
body.is-landing .mhax-floating-mascot,
.mhax-public-context,
#mhax-mascote-wrapper {
    position: fixed;
    bottom: 18px;
    right: 18px;
    z-index: 990;
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
}

/* Alinhamento horizontal lado a lado com o botão do WhatsApp (Dock Inferior Direito Unificado, zero empilhamento vertical) */
#mhax-mascote-wrapper.mhax-offset-whatsapp,
.mhax-public-context.mhax-offset-whatsapp {
    bottom: 18px !important;
    right: 76px !important;
}

/* Área Administrativa / ERP */
body:not(.is-landing) .mhax-widget-container,
.mhsys-admin-body .mhax-floating-mascot,
.mhsys-admin-area #mhax-mascote-wrapper,
#mhax-mascote-wrapper.mhax-admin-corner,
.mhax-admin-context {
    position: fixed !important;
    bottom: 12px !important;
    right: 14px !important;
    z-index: 1040 !important;
}

/* Botão/Avatar do Mascote no Admin */
body:not(.is-landing) .mhax-mascot-btn,
.mhsys-admin-body .mhax-mascot-avatar-trigger,
.mhsys-admin-area #mhax-avatar-btn,
.mhax-admin-context #mhax-avatar-btn {
    width: 48px !important;
    height: 48px !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18) !important;
    transition: transform 0.2s ease, bottom 0.2s ease;
}

body:not(.is-landing) .mhax-mascot-btn:hover,
.mhsys-admin-body .mhax-mascot-avatar-trigger:hover,
.mhsys-admin-area #mhax-avatar-btn:hover,
.mhax-admin-context #mhax-avatar-btn:hover {
    transform: translateY(-2px) scale(1.04);
}

#mhax-mascote-wrapper.mhax-offset-whatsapp #mhax-chat-window {
    max-height: calc(100vh - 120px);
}

/* Quando o chat está aberto: oculta o botão pill do mascote e ancora a janela confortavelmente na base */
#mhax-mascote-wrapper.mhax-chat-aberto {
    bottom: 20px !important;
}

#mhax-mascote-wrapper.mhax-chat-aberto #mhax-avatar-btn {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: scale(0.8) translateY(12px) !important;
    visibility: hidden !important;
    display: none !important;
}

#mhax-mascote-wrapper.mhax-chat-aberto #mhax-chat-window {
    bottom: 0 !important;
    position: relative !important;
    margin-bottom: 0 !important;
}

/* ==========================================================================
   1. BALÃO DE FALA PROATIVO (SPEECH BUBBLE)
   ========================================================================== */
#mhax-balao-proativo {
    pointer-events: auto;
    position: relative;
    max-width: 335px;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(59, 130, 246, 0.45);
    border-radius: 18px 18px 4px 18px;
    padding: 14px 16px;
    margin-bottom: 14px;
    color: #f8fafc;
    box-shadow: 0 18px 40px -10px rgba(0, 0, 0, 0.55), 0 0 24px rgba(59, 130, 246, 0.22);
    transform: translateY(14px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    display: none;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, visibility 0.25s ease;
}

#mhax-balao-proativo.mhax-balao-visivel {
    display: block;
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.mhax-balao-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.mhax-balao-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #60a5fa;
}

.mhax-balao-mini-robot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    vertical-align: middle;
    border: 1px solid rgba(0, 240, 255, 0.45);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.35);
}

.mhax-balao-mini-robot svg {
    width: 100%;
    height: 100%;
    display: block;
}

.mhax-balao-tag-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: mhaxPulseDot 2s infinite;
}

.mhax-balao-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.85rem;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.mhax-balao-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.mhax-balao-texto {
    font-size: 0.84rem;
    line-height: 1.48;
    color: #e2e8f0;
    margin: 0 0 10px 0;
    cursor: pointer;
}

.mhax-balao-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mhax-balao-cta {
    flex: 1;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    color: #ffffff;
    border: none;
    border-radius: 9px;
    padding: 7px 12px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.35);
}

.mhax-balao-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.5);
}

/* ==========================================================================
   2. BOTÃO DO MASCOTE FLUTUANTE (#mhax-avatar-btn) — PÍLULA EXECUTIVA 52PX DOCK
   ========================================================================== */
#mhax-avatar-btn {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 52px;
    background: linear-gradient(135deg, rgba(10, 17, 32, 0.96) 0%, rgba(21, 33, 58, 0.96) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid rgba(37, 99, 235, 0.62);
    border-radius: 999px;
    padding: 5px 16px 5px 6px;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(2, 6, 23, 0.48), 0 0 22px rgba(0, 240, 255, 0.22);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
    position: relative;
    box-sizing: border-box;
}

#mhax-avatar-btn:hover {
    transform: translateY(-2px);
    border-color: #00f0ff;
    box-shadow: 0 14px 32px rgba(2, 6, 23, 0.58), 0 0 28px rgba(0, 240, 255, 0.42);
}

.mhax-avatar-ring {
    position: relative;
    width: 40px;
    height: 40px;
    box-sizing: border-box;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 40%, #132342 0%, #050914 100%);
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.38), inset 0 0 8px rgba(37, 99, 235, 0.45);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.mhax-orbital-halo {
    position: absolute;
    inset: -1.5px;
    border-radius: 50%;
    padding: 1.5px;
    background: conic-gradient(from 0deg, #00f0ff 0deg, #2563eb 115deg, rgba(251, 191, 36, 0.95) 215deg, #00f5ff 315deg, #00f0ff 360deg);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    will-change: transform;
    animation: mhaxOrbitalSpin 9s linear infinite;
}

#mhax-avatar-btn:hover .mhax-avatar-ring {
    transform: scale(1.06);
    box-shadow: 0 0 22px rgba(0, 245, 255, 0.68), 0 0 10px rgba(251, 191, 36, 0.32);
}

.mhax-avatar-ring .mhax-robo-svg,
.mhax-avatar-ring img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    position: relative;
    z-index: 1;
}

.mhax-avatar-status {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border: 2px solid #091122;
    border-radius: 50%;
    z-index: 3;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
}

.mhax-btn-texts {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    line-height: 1.18;
}

.mhax-btn-title {
    font-size: 0.83rem;
    font-weight: 800;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 5px;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.mhax-btn-subtitle {
    font-size: 0.69rem;
    font-weight: 600;
    color: #7dd3fc;
    white-space: nowrap;
}

.mhax-unread-badge {
    position: absolute;
    top: -5px;
    right: -4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid #0f172a;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.45);
}

/* ==========================================================================
   3. JANELA DE CHAT COMERCIAL INTEGRADA (#mhax-chat-window)
   ========================================================================== */
#mhax-chat-window {
    pointer-events: auto;
    width: 395px;
    max-width: calc(100vw - 28px);
    height: 575px;
    max-height: calc(100vh - 120px);
    background: rgba(15, 23, 42, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 22px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 35px rgba(37, 99, 235, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 14px;
    transform: translateY(20px) scale(0.96);
    opacity: 0;
    visibility: hidden;
    position: absolute;
    bottom: 68px;
    right: 0;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, visibility 0.25s ease;
}

#mhax-chat-window.mhax-chat-aberto {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

/* Cabeçalho do Chat Comercial */
#mhax-chat-window .mhax-chat-header {
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mhax-chat-header-info {
    display: flex;
    align-items: center;
    gap: 11px;
}

.mhax-chat-header-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid #38bdf8;
    background: #0f172a;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.mhax-chat-header-avatar .mhax-robo-svg,
.mhax-chat-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mhax-chat-header-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
}

.mhax-chat-header-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: #6ee7b7;
    font-weight: 600;
    margin-top: 2px;
}

.mhax-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mhax-chat-header-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.mhax-chat-header-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.mhax-chat-header-btn#mhax-chat-encerrar-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.35);
}

/* Corpo de Mensagens */
.mhax-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.mhax-chat-messages::-webkit-scrollbar {
    width: 5px;
}

.mhax-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 999px;
}

.mhax-msg-row {
    display: flex;
    flex-direction: column;
    max-width: 88%;
    animation: mhaxFadeInUp 0.25s ease-out;
}

.mhax-msg-row.mhax-msg-bot {
    align-self: flex-start;
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
}

.mhax-msg-bot-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid rgba(0, 240, 255, 0.55);
    flex-shrink: 0;
    margin-bottom: 2px;
    overflow: hidden;
    background: #081020;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.35);
}

.mhax-msg-bot-avatar svg {
    width: 100%;
    height: 100%;
    display: block;
}

.mhax-msg-row.mhax-msg-user {
    align-self: flex-end;
}

.mhax-msg-bubble {
    padding: 11px 14px;
    border-radius: 16px;
    font-size: 0.84rem;
    line-height: 1.52;
    word-break: break-word;
}

.mhax-msg-bot .mhax-msg-bubble {
    background: rgba(30, 41, 59, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    border-bottom-left-radius: 4px;
}

.mhax-msg-user .mhax-msg-bubble {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.mhax-msg-bubble strong {
    color: #93c5fd;
    font-weight: 700;
}

.mhax-msg-user .mhax-msg-bubble strong {
    color: #ffffff;
}

.mhax-msg-cta-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 12px;
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #34d399;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.mhax-msg-cta-link:hover {
    background: #10b981;
    color: #022c22;
}

/* Indicador de Digitação (Typing Dots) */
.mhax-typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 14px;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px 14px 14px 4px;
    width: fit-content;
}

.mhax-typing-dot {
    width: 7px;
    height: 7px;
    background: #60a5fa;
    border-radius: 50%;
    animation: mhaxTypingBounce 1.3s infinite ease-in-out;
}

.mhax-typing-dot:nth-child(2) {
    animation-delay: 0.18s;
}

.mhax-typing-dot:nth-child(3) {
    animation-delay: 0.36s;
}

/* Chips de Sugestão Rápida (mhax-chip) */
/* Container de Sugestões Rápidas (Chips) com Scroll Horizontal Moderno */
.mhax-chips-container {
    padding: 8px 12px;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(15, 23, 42, 0.75);
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

.mhax-chips-container::-webkit-scrollbar {
    height: 4px;
}

.mhax-chips-container::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 4px;
}

.mhax-chips-container::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

.mhax-chips-container::-webkit-scrollbar-track {
    background: transparent;
}

.mhax-chip {
    background: rgba(37, 99, 235, 0.14);
    border: 1px solid rgba(59, 130, 246, 0.38);
    color: #93c5fd;
    border-radius: 999px;
    padding: 5px 11px;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.mhax-chip:hover {
    background: #2563eb;
    border-color: #3b82f6;
    color: #ffffff;
    transform: translateY(-1px);
}

/* Barra de Transição Rápida (WhatsApp Comercial + Teste 14 Dias) */
.mhax-quick-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(2, 6, 23, 0.65);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.mhax-quick-wa-link,
.mhax-quick-trial-link {
    flex: 1 1 50%;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 7px 10px;
    border-radius: 999px;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mhax-quick-wa-link {
    color: #4ade80;
    background: rgba(34, 197, 94, 0.16);
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.mhax-quick-wa-link:hover {
    background: #22c55e;
    color: #052e16;
    border-color: #22c55e;
}

.mhax-quick-trial-link {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.mhax-quick-trial-link:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #3b82f6;
}

/* Rodapé de Input do Chat Comercial */
#mhax-chat-window .mhax-chat-footer {
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 8px;
}

.mhax-chat-input {
    flex: 1;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    padding: 9px 13px;
    font-size: 0.84rem;
    color: #f8fafc;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mhax-chat-input::placeholder {
    color: #64748b;
}

.mhax-chat-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.mhax-chat-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    border: none;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s, opacity 0.2s;
}

.mhax-chat-send-btn:hover {
    transform: scale(1.05);
}

.mhax-chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   4. SUPORTE BIMODAL ESTRITO AO MODO CLARO (.light-mode / [data-theme="light"])
   Sem falso-positivo em LPs Dark (Nichos, GovTech e Afiliados)
   ========================================================================== */
:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) #mhax-avatar-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(241, 245, 249, 0.98) 100%);
    border-color: rgba(37, 99, 235, 0.45);
    color: #0f172a;
    box-shadow: 0 10px 26px -6px rgba(15, 23, 42, 0.18), 0 0 18px rgba(37, 99, 235, 0.14);
}

:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) #mhax-avatar-btn:hover {
    border-color: #2563eb;
    box-shadow: 0 14px 30px -6px rgba(37, 99, 235, 0.26), 0 0 22px rgba(0, 240, 255, 0.25);
}

:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) .mhax-btn-title {
    color: #0f172a;
}

:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) .mhax-btn-subtitle {
    color: #2563eb;
}

:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) .mhax-avatar-status {
    border-color: #ffffff;
}

:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) #mhax-balao-proativo {
    background: rgba(255, 255, 255, 0.98);
    color: #0f172a;
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: 0 18px 40px -10px rgba(15, 23, 42, 0.18), 0 0 20px rgba(37, 99, 235, 0.12);
}

:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) .mhax-balao-texto {
    color: #334155;
}

:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) .mhax-balao-tag {
    color: #2563eb;
}

:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) #mhax-chat-window {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.25);
}

:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) .mhax-msg-bot .mhax-msg-bubble {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #0f172a;
}

:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) .mhax-msg-bot .mhax-msg-bubble strong {
    color: #1d4ed8;
}

:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) .mhax-chips-container {
    background: #f8fafc;
    border-top-color: #e2e8f0;
}

:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) .mhax-chip {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) .mhax-chip:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) .mhax-quick-bar {
    background: #f1f5f9;
    border-top-color: #e2e8f0;
}

:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) .mhax-quick-wa-link {
    color: #15803d;
    background: #dcfce7;
    border-color: #86efac;
}

:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) .mhax-quick-wa-link:hover {
    background: #16a34a;
    color: #ffffff;
    border-color: #16a34a;
}

:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) .mhax-quick-trial-link {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
}

:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) .mhax-quick-trial-link:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) #mhax-chat-window .mhax-chat-footer {
    background: #ffffff;
    border-top-color: #e2e8f0;
}

:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) .mhax-chat-input {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

/* ==========================================================================
   4.B GRAVAÇÃO DE VOZ & TRANSCRIÇÃO (VOICE INPUT STT - MASCOTE COMERCIAL)
   ========================================================================== */
.mhax-chat-mic-btn {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    border: 1px solid rgba(59, 130, 246, 0.35);
    background: rgba(37, 99, 235, 0.14);
    color: #60a5fa;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.mhax-chat-mic-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px -3px rgba(37, 99, 235, 0.45);
}

.mhax-chat-mic-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.mhax-lp-voice-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 5px 10px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.38);
    animation: mhaxFadeInUp 0.2s ease-out;
}

.mhax-lp-voice-status {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.mhax-lp-rec-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
    animation: mhaxPulseDot 1.1s infinite ease-in-out;
    flex-shrink: 0;
}

.mhax-lp-audio-wave {
    display: inline-flex;
    align-items: center;
    gap: 2.5px;
    height: 16px;
}

.mhax-lp-audio-wave span {
    display: inline-block;
    width: 2.5px;
    height: 5px;
    border-radius: 2px;
    background: #f87171;
    animation: mhaxLpWaveAnim 0.85s infinite ease-in-out;
}

.mhax-lp-audio-wave span:nth-child(1) { animation-delay: 0.0s; }
.mhax-lp-audio-wave span:nth-child(2) { animation-delay: 0.15s; }
.mhax-lp-audio-wave span:nth-child(3) { animation-delay: 0.3s; }
.mhax-lp-audio-wave span:nth-child(4) { animation-delay: 0.2s; }
.mhax-lp-audio-wave span:nth-child(5) { animation-delay: 0.05s; }

@keyframes mhaxLpWaveAnim {
    0%, 100% { height: 4px; opacity: 0.55; }
    50% { height: 15px; opacity: 1; }
}

.mhax-lp-voice-timer {
    font-size: 0.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #fca5a5;
    white-space: nowrap;
}

.mhax-lp-voice-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.mhax-lp-voice-cancel-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
}

.mhax-lp-voice-cancel-btn:hover {
    background: #ef4444;
    color: #ffffff;
}

.mhax-lp-voice-send-btn {
    height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    box-shadow: 0 4px 10px -2px rgba(16, 185, 129, 0.45);
    transition: all 0.18s ease;
}

.mhax-lp-voice-send-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

/* Mini-Player e Transcrição na Timeline do Mascote */
.mhax-lp-audio-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 210px;
    max-width: 100%;
}

.mhax-lp-audio-player {
    width: 100%;
    height: 32px;
    border-radius: 8px;
    outline: none;
}

.mhax-lp-audio-transcript {
    font-size: 0.76rem;
    line-height: 1.38;
    padding: 6px 9px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f8fafc;
}

.mhax-lp-audio-listening {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #93c5fd;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.14);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.mhax-lp-toast-notice {
    margin: 6px 12px 0;
    padding: 8px 11px;
    border-radius: 9px;
    font-size: 0.74rem;
    line-height: 1.35;
    background: rgba(245, 158, 11, 0.16);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fde68a;
    animation: mhaxFadeInUp 0.2s ease-out;
}

html.light-mode .mhax-chat-mic-btn,
body.light-mode .mhax-chat-mic-btn,
html:not(.dark) body.bg-slate-50 .mhax-chat-mic-btn {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
}

html.light-mode .mhax-lp-voice-bar,
body.light-mode .mhax-lp-voice-bar,
html:not(.dark) body.bg-slate-50 .mhax-lp-voice-bar {
    background: #fef2f2;
    border-color: #fecaca;
}

html.light-mode .mhax-lp-voice-timer,
body.light-mode .mhax-lp-voice-timer,
html:not(.dark) body.bg-slate-50 .mhax-lp-voice-timer {
    color: #dc2626;
}

html.light-mode .mhax-lp-voice-cancel-btn,
body.light-mode .mhax-lp-voice-cancel-btn,
html:not(.dark) body.bg-slate-50 .mhax-lp-voice-cancel-btn {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

html.light-mode .mhax-lp-audio-listening,
body.light-mode .mhax-lp-audio-listening,
html:not(.dark) body.bg-slate-50 .mhax-lp-audio-listening {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

html.light-mode .mhax-lp-toast-notice,
body.light-mode .mhax-lp-toast-notice,
html:not(.dark) body.bg-slate-50 .mhax-lp-toast-notice {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

/* ==========================================================================
   5. ANIMAÇÕES E RESPONSIVIDADE MOBILE
   ========================================================================== */
@keyframes mhaxPulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: 0.65; }
}

@keyframes mhaxTypingBounce {
    0%, 80%, 100% { transform: scale(0.65); opacity: 0.45; }
    40% { transform: scale(1); opacity: 1; }
}

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

@keyframes mhaxRobotBlink {
    0%, 92%, 96%, 100% {
        transform: scaleY(1);
    }
    94% {
        transform: scaleY(0.12);
    }
}

@keyframes mhaxAntennaPulse {
    0%, 100% {
        filter: drop-shadow(0 0 2px #38bdf8);
        opacity: 0.85;
    }
    50% {
        filter: drop-shadow(0 0 6px #00f0ff);
        opacity: 1;
    }
}

@keyframes mhaxOrbitalSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes mhaxThinkingPulse {
    0%, 100% {
        filter: drop-shadow(0 0 5px #00f5ff);
        opacity: 1;
    }
    50% {
        filter: drop-shadow(0 0 10px #a855f7);
        opacity: 0.82;
    }
}

.mhax-robot-eyes {
    transform-box: fill-box;
    transform-origin: center center;
    filter: drop-shadow(0 0 5px rgba(0, 245, 255, 0.85));
    animation: mhaxRobotBlink 4.6s infinite ease-in-out;
    transition: transform 0.22s ease, filter 0.22s ease;
}

#mhax-avatar-btn:hover .mhax-robot-eyes {
    transform: translateY(-1px) scale(1.06);
    filter: drop-shadow(0 0 8px #00f5ff);
}

#mhax-mascote-wrapper.mhax-thinking .mhax-robot-eyes {
    animation: mhaxThinkingPulse 1.1s infinite ease-in-out;
}

.mhax-ear-led {
    filter: drop-shadow(0 0 3px #00f0ff);
}

@media (prefers-reduced-motion: reduce) {
    .mhax-orbital-halo,
    .mhax-robot-eyes,
    .mhax-balao-tag-dot,
    .mhax-typing-dot {
        animation: none !important;
    }
}

@media (max-width: 768px) {
    #mhax-mascote-wrapper {
        right: 14px !important;
        bottom: 16px !important;
        z-index: 1060;
    }

    #mhax-mascote-wrapper.mhax-offset-whatsapp {
        right: 14px !important;
        bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
    }

    #mhax-mascote-wrapper.mhax-chat-aberto {
        position: fixed !important;
        inset: auto 10px calc(10px + env(safe-area-inset-bottom, 0px)) 10px !important;
        right: 10px !important;
        left: 10px !important;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
        width: auto !important;
        max-width: calc(100% - 20px) !important;
        align-items: stretch !important;
        z-index: 99999 !important;
    }

    .mhax-btn-texts {
        display: none !important;
    }

    #mhax-avatar-btn {
        width: 56px !important;
        height: 56px !important;
        padding: 4px !important;
        border-radius: 50% !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    #mhax-avatar-btn .mhax-avatar-ring {
        width: 46px !important;
        height: 46px !important;
    }

    #mhax-balao-proativo {
        max-width: 280px;
    }

    #mhax-chat-window {
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        bottom: 62px;
    }

    #mhax-mascote-wrapper.mhax-chat-aberto #mhax-chat-window {
        position: relative !important;
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: min(580px, calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))) !important;
        max-height: min(580px, calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))) !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        border-radius: 20px !important;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(59, 130, 246, 0.4) !important;
    }

    #mhax-chat-window .mhax-chat-header {
        flex-shrink: 0 !important;
        padding: 12px 14px !important;
    }

    .mhax-chat-messages {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 12px !important;
    }

    .mhax-chips-container {
        flex-shrink: 0 !important;
        padding: 6px 10px !important;
    }

    .mhax-quick-bar {
        flex-shrink: 0 !important;
        padding: 6px 10px !important;
    }

    #mhax-chat-window .mhax-chat-footer {
        flex-shrink: 0 !important;
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
        background: rgba(15, 23, 42, 0.98) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    :is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) #mhax-chat-window .mhax-chat-footer {
        background: #ffffff !important;
        border-top: 1px solid #e2e8f0 !important;
    }

    .mhax-chat-input {
        min-height: 40px !important;
        font-size: 16px !important;
        padding: 8px 12px !important;
        touch-action: manipulation !important;
    }

    .mhax-lead-input-wrap input {
        font-size: 16px !important;
        touch-action: manipulation !important;
    }

    /* Oculta completamente a barra de CTA fixa mobile enquanto o chat do Mhax estiver aberto para não sobrepor nem cortar */
    body.mhax-chat-ativo .mobile-fixed-cta,
    body:has(#mhax-chat-window.mhax-chat-aberto) .mobile-fixed-cta,
    #mhax-mascote-wrapper.mhax-chat-aberto ~ .mobile-fixed-cta,
    #mhax-mascote-wrapper.mhax-chat-aberto .mobile-fixed-cta,
    .mhax-chat-ativo .mobile-fixed-cta,
    .mhax-chat-ativo .btn-whatsapp-fixed-cta {
        display: none !important;
        opacity: 0 !important;
        pointer-events: none !important;
        visibility: hidden !important;
    }
}

/* ==========================================================================
   5. PRÉ-CHAT DE CAPTURA DE LEAD (LEAD GATE)
   ========================================================================== */
.mhax-lead-gate-view {
    flex: 1;
    overflow-y: auto;
    padding: 18px 18px 14px 18px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    animation: mhaxFadeIn 0.28s ease;
}

.mhax-lead-gate-view.mhax-force-hide {
    display: none !important;
}

.mhax-chat-messages.mhax-force-show {
    display: flex !important;
}

.mhax-chips-container.mhax-force-show {
    display: flex !important;
}

#mhax-chat-window .mhax-chat-footer.mhax-force-show {
    display: flex !important;
}

.mhax-lead-gate-hero {
    margin-bottom: 14px;
    text-align: left;
}

.mhax-lead-gate-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #60a5fa;
    margin-bottom: 8px;
    letter-spacing: 0.2px;
}

.mhax-lead-gate-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
}

.mhax-lead-gate-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0 0 6px 0;
    line-height: 1.35;
    letter-spacing: -0.2px;
}

.mhax-lead-gate-subtitle {
    font-size: 0.82rem;
    color: #cbd5e1;
    margin: 0;
    line-height: 1.45;
}

.mhax-lead-gate-form {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.mhax-lead-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mhax-lead-label {
    font-size: 0.76rem;
    font-weight: 600;
    color: #94a3b8;
    margin: 0;
}

.mhax-lead-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 10px;
    padding: 0 12px;
    transition: all 0.2s ease;
}

.mhax-lead-input-wrap svg {
    flex-shrink: 0;
    color: #64748b;
    margin-right: 8px;
}

.mhax-lead-input-wrap input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 10px 0;
    font-size: 0.86rem;
    color: #f1f5f9;
    font-family: inherit;
}

.mhax-lead-input-wrap input::placeholder {
    color: #64748b;
    opacity: 1;
}

.mhax-lead-input-wrap:focus-within {
    border-color: #3b82f6;
    background: rgba(30, 41, 59, 0.98);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}

.mhax-lead-input-wrap:focus-within svg {
    color: #60a5fa;
}

.mhax-lead-input-wrap.has-error {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.08) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

.mhax-lead-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.78rem;
    color: #fca5a5;
    line-height: 1.4;
    animation: mhaxFadeIn 0.2s ease;
}

.mhax-lead-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    margin-top: 4px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.38);
    transition: all 0.2s ease;
}

.mhax-lead-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.48);
}

.mhax-lead-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.mhax-lead-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.mhax-lead-privacy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.70rem;
    color: #64748b;
    margin-top: 2px;
    text-align: center;
}

.mhax-lead-privacy svg {
    color: #10b981;
    flex-shrink: 0;
}

/* Modo Claro (Bimodal Estrito) */
:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) .mhax-lead-gate-title {
    color: #0f172a;
}

:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) .mhax-lead-gate-subtitle,
:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) .mhax-lead-label {
    color: #475569;
}

:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) .mhax-lead-input-wrap {
    background: #f8fafc;
    border-color: #cbd5e1;
}

:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) .mhax-lead-input-wrap input {
    color: #0f172a;
}

:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) .mhax-lead-input-wrap:focus-within {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

:is(html.light-mode, body.light-mode, html[data-theme="light"], body[data-theme="light"], html[data-bs-theme="light"], body.light-theme, html:not(.dark) body.bg-slate-50) .mhax-lead-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

/* ==========================================================================
   6. ESCUDO SECOPS ANTI-BOT, HONEYPOT OFF-SCREEN, COOLDOWN & CTA DE CONVERSÃO
   ========================================================================== */

/* Honeypot invisível posicionado fora da viewport (nunca display:none óbvio) */
.mhax-hp-field {
    position: absolute !important;
    left: -9999px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0.001 !important;
    pointer-events: none !important;
}

.mhax-chat-input-box {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
}

.mhax-chat-input-box .mhax-chat-input {
    width: 100%;
    min-width: 0;
    padding-right: 44px;
}

.mhax-char-counter {
    position: absolute;
    right: 9px;
    bottom: 6px;
    font-size: 0.64rem;
    font-weight: 600;
    color: #64748b;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease, color 0.18s ease;
    font-variant-numeric: tabular-nums;
}

.mhax-char-counter.is-visible {
    opacity: 0.9;
}

.mhax-char-counter.is-limit {
    color: #f59e0b;
}

.mhax-chat-send-btn.mhax-cooldown-active {
    opacity: 0.55 !important;
    cursor: wait !important;
    filter: saturate(0.65);
}

/* Alternativas diretas no rodapé do CTA de Qualificação de Lead */
.mhax-lead-alt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.mhax-lead-alt-btn {
    flex: 1 1 130px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 10px;
    border-radius: 9px;
    font-size: 0.74rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: center;
}

.mhax-lead-alt-wa {
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.38);
    color: #34d399;
}

.mhax-lead-alt-wa:hover {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

.mhax-lead-alt-trial {
    background: rgba(59, 130, 246, 0.14);
    border: 1px solid rgba(59, 130, 246, 0.38);
    color: #93c5fd;
}

.mhax-lead-alt-trial:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.mhax-lead-back-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.73rem;
    font-weight: 600;
    padding: 4px 0;
    margin-top: 4px;
    cursor: pointer;
    text-decoration: underline;
    align-self: center;
}

.mhax-lead-back-btn:hover {
    color: #e2e8f0;
}

/* Cartão inline de qualificação dentro da timeline do chat */
.mhax-inline-cta-card {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.35);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mhax-inline-cta-btn {
    width: 100%;
    padding: 8px 12px;
    border-radius: 9px;
    border: none;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, filter 0.18s ease;
}

.mhax-inline-cta-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.07);
}

html.light-mode .mhax-lead-alt-wa,
body.light-mode .mhax-lead-alt-wa {
    background: #dcfce7;
    border-color: #86efac;
    color: #15803d;
}

html.light-mode .mhax-lead-alt-trial,
body.light-mode .mhax-lead-alt-trial {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

html.light-mode .mhax-lead-back-btn,
body.light-mode .mhax-lead-back-btn {
    color: #475569;
}

@media (max-width: 400px) {
    #mhax-mascote-wrapper.mhax-chat-aberto {
        inset: auto 6px calc(6px + env(safe-area-inset-bottom, 0px)) 6px !important;
        right: 6px !important;
        left: 6px !important;
        width: auto !important;
        max-width: calc(100% - 12px) !important;
    }

    .mhax-lead-gate-view {
        padding: 14px 12px 10px 12px;
    }

    .mhax-quick-bar {
        gap: 6px;
        flex-wrap: wrap;
    }

    .mhax-quick-wa-link,
    .mhax-quick-trial-link {
        font-size: 0.70rem !important;
        padding: 5px 8px !important;
    }
}



