.assistente-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
}

.assistente-widget-botao {
    display: flex;
    align-items: center;
    gap: 9px;

    min-height: 54px;
    padding: 0 20px;

    border: none;
    border-radius: 999px;

    background: #005a94;
    color: #ffffff;

    font-size: 0.95rem;
    font-weight: 700;

    cursor: pointer;

    box-shadow: 0 8px 24px rgba(0, 45, 80, 0.28);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.assistente-widget-botao:hover {
    transform: translateY(-2px);
    background: #004a7a;
    box-shadow: 0 12px 30px rgba(0, 45, 80, 0.35);
}

.assistente-widget-icone {
    font-size: 1.25rem;
}

.assistente-widget-janela {
    display: none;
    flex-direction: column;

    position: absolute;
    right: 0;
    bottom: 70px;

    width: 380px;
    height: 560px;

    background: #ffffff;
    border: 1px solid #d8e1e9;
    border-radius: 18px;

    overflow: hidden;

    box-shadow: 0 16px 45px rgba(20, 44, 70, 0.28);
}

.assistente-widget-janela.aberto {
    display: flex;
}

.assistente-widget-janela.expandido {
    position: absolute;

    top: auto;
    left: auto;
    right: 0;
    bottom: 70px;

    width: min(
        900px,
        calc(100vw - 48px)
    );

    height: min(
        760px,
        calc(100vh - 120px)
    );

    transform: none;

    border-radius: 18px;

    box-shadow:
        0 22px 70px
        rgba(8, 32, 58, 0.32);
}

.assistente-widget-cabecalho {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 16px 18px;

    background: #082f57;
    color: #ffffff;
}

.assistente-widget-cabecalho strong {
    display: block;
    font-size: 1rem;
}

.assistente-widget-cabecalho small {
    display: block;
    margin-top: 2px;
    color: #d5e5f1;
    font-size: 0.78rem;
}

.assistente-widget-cabecalho-acoes {
    display: flex;
    align-items: center;

    gap: 8px;
}


.assistente-widget-expandir,
.assistente-widget-fechar {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: none;
    border-radius: 8px;

    background: transparent;

    color: #ffffff;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}


.assistente-widget-expandir {
    font-size: 1.15rem;
}


.assistente-widget-fechar {
    font-size: 1.8rem;
    line-height: 1;
}


.assistente-widget-expandir:hover,
.assistente-widget-fechar:hover {
    background:
        rgba(255, 255, 255, 0.12);
}


.assistente-widget-expandir:active,
.assistente-widget-fechar:active {
    transform: scale(0.94);
}


.assistente-widget-mensagens {
    flex: 1;
    padding: 16px;

    background: #f3f6f9;

    overflow-y: auto;
}

.widget-mensagem {
    width: fit-content;
    max-width: 85%;

    margin-bottom: 12px;
    padding: 11px 14px;

    border-radius: 14px;

    line-height: 1.45;
    overflow-wrap: anywhere;
}

.widget-mensagem-usuario,
.widget-mensagem-erro {
    white-space: pre-wrap;
}

.widget-mensagem-assistente {
    margin-right: auto;

    background: #ffffff;
    color: #24384d;

    border: 1px solid #dce4eb;
    border-bottom-left-radius: 4px;
}

/* ==================================================
   FORMATAÇÃO DO CONTEÚDO DO ASSISTENTE
================================================== */

.widget-mensagem-assistente {
    max-width: 88%;

    font-size: 14px;
    line-height: 1.6;
}


.widget-mensagem-assistente p {
    margin: 0 0 10px;
}


.widget-mensagem-assistente p:last-child {
    margin-bottom: 0;
}


.widget-mensagem-assistente h3,
.widget-mensagem-assistente h4 {
    margin:
        16px 0
        8px;

    color: #0b4f7d;

    line-height: 1.35;
}


.widget-mensagem-assistente h3 {
    font-size: 16px;
}


.widget-mensagem-assistente h4 {
    font-size: 15px;
}


.widget-mensagem-assistente strong {
    color: #153f60;

    font-weight: 700;
}


.widget-mensagem-assistente ul,
.widget-mensagem-assistente ol {
    margin:
        8px 0
        12px;

    padding-left: 24px;
}


.widget-mensagem-assistente li {
    margin-bottom: 7px;

    line-height: 1.55;
}


.widget-mensagem-assistente li:last-child {
    margin-bottom: 0;
}


.widget-mensagem-assistente code {
    padding: 2px 5px;

    background: #eef4f8;

    border: 1px solid #dbe6ed;
    border-radius: 4px;

    color: #0b4f7d;

    font-family:
        Consolas,
        "Courier New",
        monospace;

    font-size: 0.92em;
}


.assistente-widget-janela.expandido
.widget-mensagem-assistente {
    max-width: 82%;

    padding: 15px 18px;

    font-size: 15px;
}

.widget-mensagem-usuario {
    margin-left: auto;

    background: #005a94;
    color: #ffffff;

    border-bottom-right-radius: 4px;
}

.widget-mensagem-erro {
    margin-right: auto;

    background: #fff0f0;
    color: #961f1f;

    border: 1px solid #efbbbb;
}

.assistente-widget-formulario {
    display: flex;
    gap: 10px;

    padding: 12px;

    background: #ffffff;
    border-top: 1px solid #dce4eb;
}

.assistente-widget-formulario textarea {
    flex: 1;

    min-height: 44px;
    max-height: 110px;

    padding: 11px 12px;

    resize: none;

    border: 1px solid #bfcbd6;
    border-radius: 10px;

    font: inherit;
}

.assistente-widget-formulario textarea:focus {
    outline: 2px solid #a3cee8;
    border-color: #005a94;
}

.assistente-widget-formulario button {
    padding: 0 16px;

    border: none;
    border-radius: 10px;

    background: #005a94;
    color: #ffffff;

    font-weight: 700;
    cursor: pointer;
}

.assistente-widget-formulario button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .assistente-widget {
        right: 12px;
        bottom: 12px;
    }

    .assistente-widget-texto {
        display: none;
    }

    .assistente-widget-botao {
        width: 56px;
        height: 56px;
        padding: 0;
        justify-content: center;
    }

    .assistente-widget-janela {
        position: fixed;

        left: 10px;
        right: 10px;
        bottom: 80px;

        width: auto;
        height: calc(100vh - 105px);
        max-height: 650px;
    }
}