/* ==========================================================================
   WIDGET DE ATENDIMENTO + FORMULÁRIO DE PROPOSTAS
   Campanha Agaciel Maia — 2026

   COMPLIANCE (Res. TSE 23.610/2019 alterada pela 23.732/2024):
   o widget NUNCA pode dar a impressão de que o eleitor fala com o candidato.
   Por isso o header usa monograma "AM" (assessoria digital da campanha), nunca a foto do
   candidato, e carrega o rótulo "Assistente virtual" de forma permanente.
   Não trocar pela foto de Agaciel Maia.
   ========================================================================== */

/* --- Launcher flutuante --- */
.vox-launcher {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: linear-gradient(135deg, var(--color-blue-main), var(--color-blue-dark));
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.vox-launcher:hover {
    transform: scale(1.06);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}

.vox-launcher:focus-visible {
    outline: 3px solid var(--color-yellow);
    outline-offset: 3px;
}

.vox-launcher svg {
    width: 30px;
    height: 30px;
    fill: var(--color-white);
}

/* Anel pulsante — chama o clique sem poluir */
.vox-launcher::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--color-blue-light);
    opacity: 0.55;
    z-index: -1;
    animation: vox-pulse 2.4s ease-out infinite;
}

@keyframes vox-pulse {
    0%   { transform: scale(1);    opacity: 0.5; }
    70%  { transform: scale(1.65); opacity: 0; }
    100% { transform: scale(1.65); opacity: 0; }
}

/* Badge de mensagem não lida */
.vox-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--color-yellow);
    color: var(--color-text-dark);
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    border: 2px solid var(--color-white);
}

/* --- Balão-convite (teaser) --- */
.vox-teaser {
    position: fixed;
    right: 20px;
    bottom: 94px;
    z-index: 899;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 290px;
    padding: 14px 16px;
    border-radius: 16px 16px 4px 16px;
    background: var(--color-white);
    color: var(--color-text-dark);
    font-size: 0.9rem;
    line-height: 1.45;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.vox-teaser.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.vox-teaser-close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--color-gray-light);
    color: var(--color-text-dark);
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
}

.vox-teaser-close:hover {
    background: #e4e8ee;
}

/* --- Painel de conversa --- */
.vox-panel {
    position: fixed;
    right: 20px;
    bottom: 94px;
    z-index: 901;
    display: flex;
    flex-direction: column;
    width: 380px;
    height: min(600px, calc(100vh - 130px));
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    background: var(--color-white);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.24);
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s ease;
}

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

/* Header */
.vox-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--color-blue-main), var(--color-blue-dark));
    color: var(--color-white);
}

.vox-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--color-yellow);
    color: var(--color-blue-dark);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.vox-panel-id {
    flex: 1;
    min-width: 0;
}

.vox-panel-title {
    display: block;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.98rem;
    line-height: 1.2;
}

/* Rótulo permanente de assistente virtual — exigência de compliance. Não remover. */
.vox-panel-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.85);
}

.vox-dot-online {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3ddc84;
    flex-shrink: 0;
}

.vox-panel-close {
    flex-shrink: 0;
    padding: 4px;
    border: none;
    background: transparent;
    color: var(--color-white);
    cursor: pointer;
    border-radius: var(--border-radius);
}

.vox-panel-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.vox-panel-close svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    display: block;
}

/* Corpo das mensagens */
.vox-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    background: var(--color-gray-light);
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.vox-msg {
    max-width: 82%;
    padding: 10px 13px;
    font-size: 0.9rem;
    line-height: 1.5;
    border-radius: 14px;
    white-space: pre-wrap;
    word-wrap: break-word;
    animation: vox-msg-in 0.25s ease;
}

@keyframes vox-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.vox-msg-bot {
    align-self: flex-start;
    background: var(--color-white);
    color: var(--color-text-dark);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.vox-msg-user {
    align-self: flex-end;
    background: var(--color-blue-main);
    color: var(--color-white);
    border-bottom-right-radius: 4px;
}

.vox-msg-sys {
    align-self: center;
    max-width: 92%;
    background: rgba(37, 43, 91, 0.07);
    color: #4a5568;
    font-size: 0.76rem;
    line-height: 1.5;
    text-align: center;
    border-radius: 10px;
    padding: 9px 12px;
}

.vox-msg-sys a {
    color: var(--color-blue-main);
    text-decoration: underline;
}

/* "digitando" */
.vox-typing {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 13px;
    background: var(--color-white);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.vox-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #b4bcc8;
    animation: vox-bounce 1.3s infinite;
}

.vox-typing span:nth-child(2) { animation-delay: 0.18s; }
.vox-typing span:nth-child(3) { animation-delay: 0.36s; }

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

/* Sugestões rápidas */
.vox-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 0 14px 12px;
    background: var(--color-gray-light);
}

.vox-chip {
    padding: 7px 13px;
    border: 1.5px solid var(--color-blue-main);
    border-radius: 999px;
    background: var(--color-white);
    color: var(--color-blue-main);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.vox-chip:hover {
    background: var(--color-blue-main);
    color: var(--color-white);
}

/* Composer */
.vox-composer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--color-white);
}

.vox-input {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid #dde2ea;
    border-radius: 999px;
    background: var(--color-gray-light);
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-text-dark);
}

.vox-input:focus {
    outline: none;
    border-color: var(--color-blue-main);
    background: var(--color-white);
}

.vox-send {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: var(--color-blue-main);
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.vox-send:hover:not(:disabled) { background: var(--color-blue-dark); }
.vox-send:disabled             { opacity: 0.45; cursor: not-allowed; }

.vox-send svg {
    width: 19px;
    height: 19px;
    fill: var(--color-white);
}

/* Rodapé legal do painel — exigência de compliance. Não remover. */
.vox-panel-legal {
    padding: 7px 14px 9px;
    background: var(--color-white);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.66rem;
    line-height: 1.4;
    color: #7a8494;
    text-align: center;
}

.vox-panel-legal a { color: var(--color-blue-main); text-decoration: underline; }

/* --- Mobile --- */
@media (max-width: 560px) {
    .vox-panel {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }

    .vox-teaser { max-width: calc(100vw - 100px); }
}

@media (prefers-reduced-motion: reduce) {
    .vox-launcher::before,
    .vox-typing span,
    .vox-msg { animation: none; }

    .vox-panel,
    .vox-teaser { transition: opacity 0.01s linear; }
}

/* ==========================================================================
   SEÇÃO / FORMULÁRIO DE PROPOSTAS
   ========================================================================== */

.propostas-section {
    background: linear-gradient(135deg, var(--color-blue-dark), var(--color-blue-main));
    color: var(--color-white);
}

.propostas-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.propostas-intro .section-title { color: var(--color-white); }

.propostas-intro p {
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 1rem;
}

.propostas-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-top: 1.5rem;
}

.propostas-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.92);
}

.propostas-list svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    fill: var(--color-yellow);
}

.propostas-form-card {
    background: var(--color-white);
    color: var(--color-text-dark);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.propostas-form-card h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--color-blue-dark);
    margin-bottom: 0.35rem;
}

.propostas-form-card .form-lead {
    font-size: 0.88rem;
    color: #5b6675;
    margin-bottom: 1.35rem;
}

.form-field { margin-bottom: 0.95rem; }

.form-field label {
    display: block;
    margin-bottom: 0.35rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--color-blue-dark);
}

.form-field .optional {
    font-weight: 400;
    color: #8b95a3;
    text-transform: none;
}

.form-field input,
.form-field select {
    width: 100%;
    padding: 0.72rem 0.9rem;
    border: 1px solid #dde2ea;
    border-radius: var(--border-radius);
    background: var(--color-white);
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: var(--color-text-dark);
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--color-blue-main);
    box-shadow: 0 0 0 3px rgba(37, 43, 91, 0.14);
}

.form-field input[aria-invalid="true"],
.form-field select[aria-invalid="true"] { border-color: #d93025; }

.field-error {
    display: none;
    margin-top: 0.3rem;
    font-size: 0.78rem;
    color: #d93025;
}

.field-error.is-visible { display: block; }

/* Consentimento LGPD — checkbox nunca pré-marcado. Não alterar. */
.form-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 1.2rem 0;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #5b6675;
}

.form-consent input[type="checkbox"] {
    flex-shrink: 0;
    width: 17px;
    height: 17px;
    margin-top: 2px;
    accent-color: var(--color-blue-main);
    cursor: pointer;
}

.form-consent a { color: var(--color-blue-main); text-decoration: underline; }

.form-submit {
    width: 100%;
    padding: 0.9rem;
    font-size: 1rem;
}

.form-status {
    display: none;
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.88rem;
    line-height: 1.5;
}

.form-status.is-visible { display: block; }
.form-status.is-error   { background: #fdecea; color: #b3261e; }
.form-status.is-success { background: #e7f6ec; color: #1e6b38; }

/* Botão de download do material. Não existe no HTML: o `vox-captura.js` cria e
   insere depois do cadastro confirmado, e só quando há PDF configurado. Fica
   fora da tela até lá — oferecer download antes do cadastro esvazia o
   formulário, que é o motivo de a peça existir. */
.form-download {
    display: block;
    margin-top: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--color-blue-mid);
    border-radius: var(--border-radius);
    color: var(--color-blue-mid);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: background var(--transition-speed), color var(--transition-speed);
}

.form-download:hover,
.form-download:focus-visible {
    background: var(--color-blue-mid);
    color: var(--color-white);
}

/* `display: block` acima ganharia do atributo `hidden` sem esta regra. */
.form-download[hidden] { display: none; }

.form-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

@media (max-width: 900px) {
    .propostas-grid { grid-template-columns: 1fr; gap: 2rem; }
}
