body {
    font-family: Arial, sans-serif;
    background: #f7f9fb;
    color: #333;
    margin: 0;
    padding: 12px;
    box-sizing: border-box;
    line-height: 1.5;
}

.container {
    margin: 0 auto; 
    max-width: 1000px; 
    width: 100%;
    padding: 0;
}

.form-section {
    border: 1px solid #ddd;
    padding: 15px 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    background: #fafafa;
    box-sizing: border-box;
}

.form-section h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #071F3A;
    font-size: 1.2em;
    display: flex;
    align-items: center;
}

.obrigatorio {
    color: red;
    margin-left: 4px;
    font-size: 0.9em;
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.grid-cliente {
    grid-template-columns: 1fr;
}

.grid-investimento {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

label {
    font-weight: bold;
    display: block;
    font-size: 0.9em;
    margin-bottom: 6px;
    color: #071F3A;
}

/* CORREÇÃO: Torna a regra de estilo mais específica para não afetar o checkbox */
input[type="text"],
input[type="email"],
select {
    width: 100%;
    padding: 14px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

input:focus {
    border-color: #071F3A;
    outline: none;
}

input {
    max-width: 100%;
}

button {
    background: #071F3A;
    color: white;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
    margin: 5px 0;
}

button:hover {
    background: #071F3A;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 14px;
    table-layout: fixed;
}

table, th, td {
    border: 1px solid #ccc;
}

th, td {
    padding: 10px 8px;
    text-align: center;
    word-wrap: break-word;
}

th {
    background: #071F3A;
    color: white;
    font-weight: 600;
}

.tabela-faixas th {
    background: #071F3A;
}

.destaque {
    background-color: #071F3A !important;
    color: white !important;
    font-weight: bold;
}

.hidden-col {
    display: none;
}

/* Container da imagem */
.image-container {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto 20px;
    padding: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Imagem responsiva */
.form-responsive-image {
    width: 100%;
    height: auto;
    min-height: 150px;
    max-height: 200px;
    display: block;
    object-fit: cover;
    margin: 0 auto;
}

/* Button Groups */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.recebimento-btn, .prazo-btn {
    background: #071F3A;
    color: #ffffff;
    padding: 16px 12px;
    font-size: 15px;
    font-weight: 500;
}

.recebimento-btn.selected, .prazo-btn.selected {
    background: #071F3A;
    color: white;
}

/* Mensagens de erro */
.mensagem-erro {
    color: red;
    font-size: 0.8em;
    margin-top: 5px;
    display: none;
}

/* Estilos para validação visual */
input:valid {
    border-color: #4CAF50 !important;
}

input:invalid {
    border-color: #ccc;
}

/* Estilos para caixas de informação */
.info-box {
    background-color: #f8f9fa;
    border-left: 4px solid #071F3A;
    padding: 15px 12px;
    margin: 20px 0;
    border-radius: 8px;
    font-size: 14px;
}

.info-box h4 {
    color: #071F3A;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.info-box p {
    margin: 8px 0;
    line-height: 1.5;
    color: #555;
}

.info-box strong {
    color: #071F3A;
}

/* REGRAS DE ESTILO PARA TABELAS */
#tabela-resultados table th,
#tabela-resultados table td {
    padding: 14px 10px;
    font-size: 16px;
}
#tabela-resultados table th {
    font-size: 17px;
}
#tabela-faixas table th,
#tabela-faixas table td {
    padding: 8px 6px;
    font-size: 13px;
}
#tabela-faixas h4 {
    font-size: 1em;
    margin-bottom: 8px;
}
/* FIM DAS REGRAS PARA TABELAS */

/* REGRAS PARA O CHECKBOX DE TERMOS */
.terms-section {
    padding: 10px 15px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.checkbox-container input[type="checkbox"] {
    width: auto;
    margin-top: 5px;
    flex-shrink: 0;
}

.checkbox-container label {
    font-size: 13px;
    font-weight: normal;
    color: #555;
    line-height: 1.4;
    cursor: pointer;
}
/* FIM DAS REGRAS DO CHECKBOX */

/* Melhorias para mobile */
.mobile-optimized { -webkit-tap-highlight-color: transparent; }

/* CORREÇÃO: Aplica o reset de aparência apenas em elementos específicos, excluindo o checkbox */
input[type="text"],
input[type="email"],
select,
button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* --- ESTILOS PARA TABELA RESPONSIVA (MOBILE) --- */
@media (max-width: 768px) {
    #tabela-resultados table {
        border: 0;
        table-layout: auto;
    }

    #tabela-resultados table thead {
        display: none; /* Oculta o cabeçalho da tabela */
    }

    #tabela-resultados table tr {
        display: block; /* Transforma cada linha em um bloco/card */
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    #tabela-resultados table td {
        display: flex; /* Alinha o rótulo e o valor */
        justify-content: space-between; /* Espaço entre o rótulo e o valor */
        align-items: center;
        padding: 12px;
        text-align: right; /* Alinha o valor à direita */
        border: none;
        border-bottom: 1px solid #eee;
        font-size: 14px;
    }

    #tabela-resultados table tr td:last-child {
        border-bottom: 0;
    }

    #tabela-resultados table td::before {
        content: attr(data-label); /* Pega o texto do atributo data-label */
        font-weight: bold;
        text-align: left; /* Alinha o rótulo à esquerda */
        color: #400140;
        margin-right: 10px;
    }
}
/* --- FIM DOS ESTILOS PARA TABELA RESPONSIVA --- */


@media (max-width: 768px) {
    body { padding: 10px 8px; font-size: 14px; }
    .form-section, .terms-section { padding: 12px 10px; margin-bottom: 12px; }
    .form-section h3 { font-size: 1.1em; margin-bottom: 10px; }
    input, select { padding: 16px 12px; font-size: 16px; border-radius: 6px; }
    button { padding: 16px; font-size: 16px; border-radius: 6px; }
    /* Removido o estilo de tabela geral para não conflitar com o novo responsivo */
    /* table { font-size: 12px; } */
    /* th, td { padding: 8px 6px; } */
    .button-group { gap: 8px; }
    .recebimento-btn, .prazo-btn { padding: 14px 10px; font-size: 14px; }
    .info-box { padding: 12px 10px; margin: 15px 0; font-size: 13px; }
    .image-container { margin: 0 auto 15px; border-radius: 10px; }
    .form-responsive-image { min-height: 130px; max-height: 180px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .grid, .grid-cliente { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .grid-investimento { flex-direction: row; gap: 20px; }
    .button-group { flex-direction: row; flex-wrap: wrap; }
    button { width: auto; min-width: 120px; }
    .valor-investido-container, .forma-recebimento-container { flex: 1; }
}

@media (min-width: 1025px) {
    body { padding: 20px; }
    .grid, .grid-cliente { grid-template-columns: repeat(4, 1fr); gap: 20px; }
    .grid-investimento { flex-direction: row; gap: 30px; }
    .button-group { flex-direction: row; flex-wrap: nowrap; }
    button { width: auto; min-width: 150px; }
    .btn-group { flex-direction: row; justify-content: center; }
    .form-section, .terms-section { padding: 20px; }
    .image-container { margin: 0 auto 25px; }
    .form-responsive-image { min-height: 180px; max-height: 250px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 360px) {
    body { padding: 8px 6px; font-size: 13px; }
    .form-section, .terms-section { padding: 10px 8px; }
    input, select { padding: 14px 10px; font-size: 15px; }
    button { padding: 14px; font-size: 15px; }
    /* Removido o estilo de tabela geral para não conflitar com o novo responsivo */
    /* table { font-size: 11px; } */
    /* th, td { padding: 6px 4px; } */
}

@media (max-height: 500px) and (orientation: landscape) {
    .container { max-height: 90vh; overflow-y: auto; }
    .form-section, .terms-section { padding: 10px; }
    .grid { gap: 8px; }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
}