/* Estilos Globais */
:root {
    --body-color: #f7f7f7;
    --card-color: #ffffff;
    --primary-color: #FF750C;
    --primary-color-light: #fff0e7;
    --text-color: #707070;
    --title-color: #18191A;
    --input-border-color: #e0e0e0;
    --input-focus-color: #005A9C;
    --tran-03: all 0.3s ease;
    --tran-05: all 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--body-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    all: unset;
    cursor: pointer;
}

/* --- Estrutura de Login (NOVO LAYOUT) --- */
.login-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 40px;
}

.logos-container {
    display: flex;
    gap: 30px;
    align-items: center;
}

.login-logo {
    height: 45px;
    filter: brightness(0) invert(1);
    /* Deixa os logos brancos */
}

.login-page-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../img/background.jpg');
    background-size: cover;
    background-position: center;
}

.login-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    max-width: 1100px;
    width: 100%;
    gap: 50px;
}

.login-tagline {
    color: white;
}

/* Logo */
.main-branding-logo {
    width: 260px; /* Largura do logo maior */
    margin-bottom: 25px; /* Espaço entre o logo e o título */
    filter: brightness(0) invert(1); /* Deixa o logo branco */
}

.login-tagline h1 {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 20px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

.login-tagline p {
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.9;
    max-width: 450px;
}

.login-form-wrapper {
    background-color: var(--card-color);
    padding: 50px 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.login-form-wrapper h2 {
    color: var(--title-color);
    font-size: 1.8rem;
    margin-bottom: 30px;
    text-align: center;
}

#loginForm {
    display: flex;
    flex-direction: column;
    gap: 20px;
}


/* --- NOVO: Estilos para o seletor CPF/CNPJ --- */
.doc-type-selector {
    display: flex;
    border: 1px solid var(--input-border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.doc-type-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background-color: var(--card-color);
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--tran-03);
}

.doc-type-btn.active {
    background-color:var(--primary-color); 
    color: white;
}

.doc-type-btn:not(.active):hover {
    background-color: #f1f1f1;
}
/* --- FIM DOS NOVOS ESTILOS --- */

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 0.9rem;
    color: var(--title-color);
    margin-bottom: 8px;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--input-border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--tran-03);
}

.input-group input:focus {
    outline: none;
    border-color: var(--input-focus-color);
    box-shadow: 0 0 0 3px var(--primary-color-light);
}

.cta-button {
    background-color: var(--primary-color);
    color: white !important;
    border: none;
    padding: 14px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--tran-03);
    margin-top: 10px;
    text-align: center;
    display: block;
}

.cta-button:hover {
    background-color: #db650b;
}

/* --- Estilos para o Tooltip de Ajuda --- */
.label-wrapper {
    display: flex;
    align-items: center;
    gap: 8px; /* Espaço entre o texto e o ícone */
}

.tooltip-container {
    position: relative;
    display: none; /* Começa escondido por padrão */
    cursor: help;
}

.tooltip-container .fa-question-circle {
    color: var(--input-focus-color); /* Cor azul para chamar atenção sutilmente */
    font-size: 1.1rem;
    position: relative; /* Permite o ajuste de posição */
    top: -2px;          /* Move o ícone 2 pixels para cima */
}

/* O balão do tooltip */
.tooltip-text {
    visibility: hidden;
    opacity: 0;
    width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%; /* Posição acima do ícone */
    left: 50%;
    margin-left: -125px; /* Centraliza o tooltip */
    transition: opacity 0.3s;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Flecha do tooltip */
.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* Exibe o tooltip no hover */
.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Mensagens de Alerta/Erro */
.alert-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}


/* --- Estilos de Páginas Internas --- */
.main-header {
    background-color: var(--primary-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 15px 0;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
}

/*NOVAS REGRAS ABAIXO */
.header-logo-container {
    display: flex;
    align-items: center;
    gap: 20px; /* Espaçamento entre os logos */
}

.header-logo {
    height: 40px; /* Altura dos logos no header pós-login */
    filter: brightness(0) invert(1); /* Deixa os logos brancos */
}
/* FIM DAS NOVAS REGRAS */

/* NOVO: Estilo do Protocolo */
.protocol-number {
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 5px; /* Espaço entre o logo e o protocolo */
    text-align: left;
}
/* FIM NOVO ESTILO */

.container {
    max-width: 1100px;
    width: 90%;
    margin: 0 auto;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    color: var(--body-color);
    font-weight: 600;
}

.logout-button {
    background-color: var(--primary-color-light);
    color: var(--primary-color) !important;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--tran-03);
}

.logout-button:hover {
    background-color: var(--primary-color);
    color: white !important;
}

main.container {
    padding-top: 130px; /* ATUALIZADO PÓS PROTOCOLO: Aumenta o espaço para o header maior */
    padding-bottom: 40px;
    flex-grow: 1;
}

.content-wrapper h2 {
    color: var(--title-color);
    font-size: 2rem;
    margin-bottom: 8px;
}

.content-wrapper p {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.table-container {
    background-color: var(--card-color);
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.debts-table {
    width: 100%;
    border-collapse: collapse;
}

.debts-table th,
.debts-table td {
    padding: 18px 20px;
    text-align: left;
    color: var(--text-color);
}

.debts-table thead {
    background-color: #f9f9f9;
}

.debts-table th {
    color: var(--title-color);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.debts-table tbody tr {
    border-bottom: 1px solid var(--body-color);
}

.debts-table tbody tr:last-child {
    border-bottom: none;
}

.debts-table tbody tr:hover {
    background-color: var(--primary-color-light);
}

.pay-button {
    background-color: var(--primary-color);
    color: white !important;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--tran-03);
}

.pay-button:hover {
    opacity: 0.85;
}

/* --- Estilos da Página de Pagamento --- */
main.page-pagamento {
    display: grid;
    grid-template-columns: 40% 1fr;
    gap: 30px;
    align-items: start;
}

.card {
    background-color: var(--card-color);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.payment-summary h3 {
    color: var(--title-color);
    font-size: 1.5rem;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--body-color);
    padding-bottom: 15px;
}

.summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.summary-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--body-color);
    font-size: 1rem;
}

.summary-list li:last-child {
    border-bottom: none;
}

.summary-list li span {
    color: var(--text-color);
}

.summary-list li strong {
    color: var(--title-color);
    font-weight: 600;
}

.summary-list li.summary-total {
    padding-top: 20px;
}

.summary-list li.summary-total span {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--title-color);
}

.summary-list li.summary-total strong {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.payment-action h3 {
    text-align: center;
    color: var(--title-color);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.pix-instructions {
    text-align: center;
    color: var(--text-color);
    margin-bottom: 20px;
}

.qr-code-container {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
}

.qr-code-container img {
    border: 6px solid var(--body-color);
    border-radius: 8px;
    max-width: 200px;
    width: 100%;
}

.pix-copy-paste label {
    display: block;
    color: var(--title-color);
    font-weight: 500;
    margin-bottom: 10px;
    text-align: center;
}

.input-copy-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-copy-wrapper input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--input-border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    background-color: var(--body-color);
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
}

.input-copy-wrapper button {
    flex-shrink: 0;
    background-color: var(--primary-color-light);
    color: var(--primary-color);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--tran-03);
}

.input-copy-wrapper button:hover {
    background-color: var(--primary-color);
    color: white;
}

.support-message {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--body-color);
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.6;
}

.support-message a {
    color: var(--primary-color) !important;
    font-weight: 600;
    text-decoration: none;
}

.support-message a:hover {
    text-decoration: underline;
}

/* --- Estilos do Botão com Spinner --- */
.with-spinner {
    position: relative;
}

.spinner {
    display: none;
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    border-top-color: #ffffff;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
}

.loading .spinner {
    display: block;
}

.loading .button-text {
    visibility: hidden;
    opacity: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- Botões Flutuantes (FAB) --- */
.fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.phone-fab,
.whatsapp-fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: var(--tran-03);
    margin-top: 10px;
}

.phone-fab:hover,
.whatsapp-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.phone-fab {
    background-color: #25D366;
    color: white;
    font-size: 24px;
    text-decoration: none;
}

.whatsapp-fab {
    background-color: #25D366;
}

.whatsapp-fab img {
    width: 32px;
    height: auto;
}

/* --- Estilos do Rodapé --- */
.main-footer {
    background-color: #1c1c1c;
    color: #f0f0f0;
    padding-top: 50px;
    font-size: 0.9rem;
}

/* Ocultar rodapé na tela de login */
.login-page-wrapper+.main-footer {
    display: none;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    padding-bottom: 40px;
}

.footer-column h3,
.footer-column h4 {
    color: #ffffff;
    font-size: 1.1rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.footer-column ul li a {
    color: #c7c7c7;
    text-decoration: none;
    transition: var(--tran-03);
}

.footer-column ul li a:hover {
    color: var(--primary-color);
}

.footer-column.contact li span {
    color: #c7c7c7;
}

.footer-column.contact li i {
    width: 25px;
    font-size: 1rem;
    color: var(--primary-color);
}

.footer-logos {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    filter: brightness(0) invert(1);
}

.footer-logo {
    max-width: 150px;
}

.social-media {
    margin-top: 20px;
}

.social-icons a {
    color: #f0f0f0;
    font-size: 1.3rem;
    margin-right: 15px;
    transition: var(--tran-03);
}

.social-icons a:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.footer-bottom-bar {
    border-top: 1px solid #333;
    padding: 20px 0;
    text-align: center;
}

.footer-bottom-bar p {
    margin: 0;
    color: #a0a0a0;
    font-size: 0.85rem;
}


/* --- Páginas Legais (Termos, Privacidade, etc.) --- */
.legal-page {
    background-color: var(--card-color);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 40px;
}

.legal-page h1 {
    font-size: 2.2rem;
    color: var(--title-color);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
}

.legal-page section {
    margin-bottom: 30px;
}

.legal-page h2 {
    font-size: 1.6rem;
    color: var(--title-color);
    margin-bottom: 15px;
}

.legal-page p {
    line-height: 1.8;
    margin-bottom: 15px;
    color: var(--text-color);
}

.legal-page ul {
    list-style-position: inside;
    padding-left: 10px;
    margin-bottom: 15px;
}

.legal-page ul li {
    margin-bottom: 10px;
    line-height: 1.7;
    color: var(--text-color);
}

.legal-page strong {
    color: var(--title-color);
    font-weight: 600;
}

.document-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--input-border-color);
    text-align: right;
    font-size: 0.8rem;
    color: #a0a0a0;
}

/* Tabela para Políticas */
.table-container-legal {
    overflow-x: auto;
    margin: 20px 0;
}

.table-container-legal table {
    width: 100%;
    border-collapse: collapse;
}

.table-container-legal th,
.table-container-legal td {
    padding: 15px;
    text-align: left;
    border: 1px solid var(--input-border-color);
}

.table-container-legal thead {
    background-color: #f9f9f9;
}

.table-container-legal th {
    font-weight: 600;
    color: var(--title-color);
}

/* --- Página de Dúvidas (FAQ) --- */
.faq-page h1 {
    font-size: 2.2rem;
    color: var(--title-color);
}

.faq-page p {
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--input-border-color);
}

.faq-question {
    width: 100%;
    background-color: transparent;
    border: none;
    padding: 20px 0;
    text-align: left;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--title-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--tran-03);
}

.faq-question:hover {
    color: var(--primary-color);
}

.faq-question i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-answer p {
    padding: 0 10px 20px 10px;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-color);
    margin: 0;
}

/* Estilos para o estado ativo (aberto) */
.faq-item.active .faq-question {
    color: var(--primary-color);
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-item.active .faq-answer {
    max-height: 300px;
}

.g-recaptcha {
    margin: 0 auto 15px auto;
}


/* --- DESIGN RESPONSIVO --- */
@media (max-width: 900px) {
    .login-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 20px;
        padding-top: 20px;
        /* Espaço para o header */
    }

    #docLabel {
        text-align: left;
    }

    .login-tagline p {
        margin: 0 auto;
    }

    .login-tagline h1 {
        font-size: 2.2rem;
        margin-bottom: 15px; /* Reduz a margem inferior do título */
    }

    .login-form-wrapper {
        padding: 40px 25px; /* Reduz o preenchimento interno do card do formulário */
    }
    
    #loginForm {
        gap: 15px; /* Diminui o espaço entre os campos do formulário */
    }

    .main-branding-logo {
        width: 220px; /* Diminui um pouco o logo */
        margin-bottom: 20px; /* Ajusta a margem do logo */
    }

    main.page-pagamento {
        grid-template-columns: 1fr;
    }

    .footer-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .table-container {
        background-color: transparent;
        box-shadow: none;
        padding: 0;
    }

    .debts-table thead {
        display: none;
    }

    .debts-table,
    .debts-table tbody,
    .debts-table tr,
    .debts-table td {
        display: block;
        width: 100%;
    }

    .debts-table tr {
        margin-bottom: 15px;
        border: 1px solid var(--input-border-color);
        border-radius: 8px;
        padding: 10px;
        background-color: var(--card-color);
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    }

    .debts-table td {
        padding: 12px 10px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        border-bottom: 1px dashed #eee;
    }

    .debts-table td:last-child {
        border-bottom: none;
    }

    .debts-table td::before {
        content: attr(data-label);
        float: left;
        font-weight: 600;
        color: var(--title-color);
    }

    .debts-table td[data-label="Ação"]::before {
        display: none;
    }

    .debts-table td[data-label="Ação"] {
        justify-content: center;
        padding-top: 20px;
    }

    .pay-button {
        width: 100%;
        text-align: center;
    }

    .fab-container {
        bottom: 20px;
        right: 20px;
    }

    .phone-fab,
    .whatsapp-fab {
        width: 55px;
        height: 55px;
    }

    .table-container-legal thead {
        display: none;
    }

    .table-container-legal,
    .table-container-legal tbody,
    .table-container-legal tr,
    .table-container-legal td {
        display: block;
        width: 100%;
    }

    .table-container-legal tr {
        margin-bottom: 15px;
        border: 1px solid var(--input-border-color);
    }

    .table-container-legal td {
        padding-left: 50%;
        position: relative;
        text-align: left;
        border-bottom: 1px dashed #eee;
    }

    .table-container-legal td:before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        color: var(--title-color);
    }
}

@media (max-width: 576px) {
    .login-header {
        padding: 20px;
        justify-content: center;
    }

    .login-logo {
        height: 35px;
    }

    .login-tagline h1 {
        font-size: 1.8rem;
    }

    .login-form-wrapper {
        padding: 15px 25px;
    }

    .login-form-wrapper h2 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }

    /* ATUALIZAÇÃO: Ajuste Header Responsivo */
    .header-content {
        flex-direction: row; /* Volta a ser linha */
        justify-content: space-between; /* Espaço entre os itens */
        align-items: center;
        padding-bottom: 0; /* Remove padding extra */
    }
    
    .header-left-content {
        display: flex;
        flex-direction: column;
        align-items: flex-start; /* Alinha logo/protocolo à esquerda */
    }
    /* FIM DA ATUALIZAÇÃO */

    .protocol-number {
        font-size: 0.8rem;
        margin-top: 8px;
    }

    #docLabel {
        margin-top: -15px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-logos {
        align-items: center; 
    }

    .footer-column.contact ul li {
        justify-content: center;
    }

    .social-icons {
        margin-bottom: 20px;
    }

    .g-recaptcha {
        /* margin: 0 auto 15px auto; */
        margin-top: -5px;
        margin-bottom: -5px;
    }
}

@media (max-height: 750px) {
    /* Estilos para celulares com telas mais baixas */
    .login-form-wrapper {
        padding: 30px 25px;
    }
    .login-tagline h1 {
        font-size: 2rem;
    }
    .login-tagline {
        margin-top: 20px;
    }
}