/* =========================================================
   SIMULADOR DE FINANCIAMENTO
   CSS ESPECÍFICO DA FERRAMENTA
   ========================================================= */


/* =========================================================
   ESTRUTURA PRINCIPAL
   ========================================================= */

.financing-tool,
.financing-info {
    max-width: 960px;
    margin: 0 auto;
}


/* =========================================================
   CARDS
   ========================================================= */

.financing-card,
.financing-info-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 28px;
}


.financing-card {
    margin-bottom: 24px;
}


.financing-card h2,
.financing-info-card h2 {
    margin-top: 0;
    color: #0f172a;
}


.financing-card h2 {
    margin-bottom: 8px;
    font-size: 1.25rem;
}


.financing-description {
    margin: 0 0 26px;
    color: #64748b;
    line-height: 1.55;
}


/* =========================================================
   ORIENTAÇÃO — COMO FUNCIONA
   ========================================================= */

.financing-orientation {
    margin-bottom: 0;
}


.financing-orientation h2 {
    margin-bottom: 22px;
    font-size: 1.25rem;
}


.financing-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}


.financing-info-item {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}


.financing-info-icon {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-size: .85rem;
    font-weight: 700;
}


.financing-info-item h3 {
    margin: 2px 0 6px;
    color: #0f172a;
    font-size: .95rem;
}


.financing-info-item p {
    margin: 0;
    color: #64748b;
    font-size: .86rem;
    line-height: 1.5;
}


.financing-tip {
    margin-top: 20px;
    padding: 15px 17px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #eff6ff;
    color: #334155;
    font-size: .87rem;
    line-height: 1.55;
}


/* =========================================================
   SEÇÕES
   ========================================================= */

.form-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}


.form-section:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}


.form-section-title {
    margin: 0 0 16px;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 700;
}


/* =========================================================
   FORMULÁRIO
   ========================================================= */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 17px;
}


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


.form-group.full {
    grid-column: 1 / -1;
}


.form-group label {
    margin-bottom: 7px;
    color: #1e293b;
    font-size: .9rem;
    font-weight: 600;
}


.form-group input,
.form-group select {
    width: 100%;
    min-height: 46px;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #1e293b;
    font: inherit;
}


.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}


.field-help {
    margin-top: 5px;
    color: #64748b;
    font-size: .78rem;
    line-height: 1.4;
}


.input-with-prefix {
    position: relative;
}


.input-with-prefix input {
    padding-left: 38px;
}


.input-prefix {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
}


/* =========================================================
   BOTÕES
   ========================================================= */

.financing-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}


.financing-button {
    min-height: 45px;
    padding: 9px 21px;
    border: 1px solid #2563eb;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    font: inherit;
    cursor: pointer;
    transition: background .2s ease,
                border-color .2s ease,
                transform .2s ease;
}


.financing-button:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}


.financing-button:active {
    transform: translateY(1px);
}


/* =========================================================
   RESULTADOS
   ========================================================= */

.result-area {
    display: none;
}


.result-area.visible {
    display: block;
}


.main-result {
    padding: 28px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #eff6ff;
    text-align: center;
    margin-bottom: 22px;
}


.result-label {
    color: #64748b;
    font-size: .9rem;
    margin-bottom: 8px;
}


.result-value {
    color: #0f172a;
    font-size: 2.45rem;
    font-weight: 700;
    line-height: 1.2;
}


.result-subtitle {
    margin-top: 10px;
    color: #64748b;
    line-height: 1.5;
}


/* =========================================================
   RESUMO
   ========================================================= */

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}


.summary-box {
    padding: 17px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    text-align: center;
}


.summary-label {
    color: #64748b;
    font-size: .8rem;
    margin-bottom: 6px;
}


.summary-value {
    color: #0f172a;
    font-size: 1.1rem;
    font-weight: 700;
}


/* =========================================================
   SEÇÕES DE RESULTADO
   ========================================================= */

.result-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}


.result-section-title {
    margin: 0 0 15px;
    color: #0f172a;
    font-size: 1.05rem;
}


/* =========================================================
   COMPARAÇÃO
   ========================================================= */

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}


.comparison-card {
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}


.comparison-card h3 {
    margin: 0 0 16px;
    color: #0f172a;
    font-size: 1rem;
}


.comparison-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
    font-size: .86rem;
}


.comparison-line:last-child {
    border-bottom: 0;
}


.comparison-line strong {
    color: #0f172a;
    text-align: right;
}


/* =========================================================
   TABELAS
   ========================================================= */

.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
}


.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .84rem;
}


.result-table th,
.result-table td {
    padding: 10px;
    border: 1px solid #e2e8f0;
    text-align: left;
}


.result-table th {
    background: #f8fafc;
    color: #334155;
    font-weight: 600;
}


.result-table td {
    color: #475569;
}


.result-table td:not(:first-child),
.result-table th:not(:first-child) {
    text-align: right;
}


/* =========================================================
   INDICADORES
   ========================================================= */

.indicator-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}


.indicator {
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}


.indicator-title {
    color: #64748b;
    font-size: .8rem;
    margin-bottom: 6px;
}


.indicator-value {
    color: #0f172a;
    font-size: 1.2rem;
    font-weight: 700;
}


.inverse-financing-indicators {
    margin-top: 18px;
}


/* =========================================================
   AVISO
   ========================================================= */

.warning-box {
    margin-top: 22px;
    padding: 15px;
    border: 1px solid #fde68a;
    border-radius: 10px;
    background: #fffbeb;
    color: #475569;
    font-size: .84rem;
    line-height: 1.55;
}


.status-message {
    margin-top: 15px;
    padding: 12px 14px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #eff6ff;
    color: #334155;
    line-height: 1.5;
    font-size: .88rem;
}


/* =========================================================
   INFORMAÇÕES
   ========================================================= */

.financing-info-card {
    line-height: 1.65;
}


.financing-info-card h2 {
    margin-bottom: 18px;
    font-size: 1.2rem;
}


.financing-info-card h3 {
    margin-top: 25px;
    margin-bottom: 8px;
    color: #0f172a;
    font-size: 1rem;
}


.financing-info-card p {
    margin-bottom: 14px;
    color: #475569;
    line-height: 1.65;
}


/* =========================================================
   RESPONSIVIDADE
   ========================================================= */

@media (max-width: 900px) {

    .financing-info-grid {
        grid-template-columns: 1fr;
    }

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

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

}


@media (max-width: 760px) {

    .form-grid,
    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full {
        grid-column: auto;
    }

}


@media (max-width: 600px) {

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

    .financing-card,
    .financing-info-card {
        padding: 20px;
    }

    .financing-actions {
        flex-direction: column;
    }

    .financing-button {
        width: 100%;
    }

    .result-value {
        font-size: 2rem;
    }

}


@media (max-width: 480px) {

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

    .financing-info-item {
        padding: 15px;
    }

}


/* =========================================================
   IMPRESSÃO
   ========================================================= */

@media print {

    .financing-actions,
    .ad-container,
    header,
    footer {
        display: none !important;
    }

    .result-area {
        display: block !important;
    }

    .financing-card,
    .financing-info-card {
        border: 0;
        box-shadow: none;
    }

}