/* =========================================================
   SIMULADOR DE ECONOMIA MENSAL
   ========================================================= */

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

.economy-card,
.economy-info-card {
    padding: 28px;
}


/* =========================================================
   ORIENTAÇÃO
   ========================================================= */

.economy-orientation-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 22px;
}

.economy-orientation-grid h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.economy-orientation-grid p {
    margin: 0;
    color: #64748b;
    line-height: 1.6;
}


/* =========================================================
   DESCRIÇÃO
   ========================================================= */

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


/* =========================================================
   SEÇÕES DO FORMULÁRIO
   ========================================================= */

.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;
    font-size: 1rem;
    font-weight: 700;
}


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

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

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

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

.economy-card .form-group label {
    margin-bottom: 7px;
    font-size: .9rem;
    font-weight: 600;
}

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

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

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


/* =========================================================
   PREFIXO
   ========================================================= */

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

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

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


/* =========================================================
   AÇÕES
   ========================================================= */

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


/* =========================================================
   RESULTADO
   ========================================================= */

.result-area {
    display: none;
}

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

.main-result {
    padding: 28px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    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
   ========================================================= */

.result-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: 12px;
    background: #fff;
    text-align: center;
}

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

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


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

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

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


/* =========================================================
   DISTRIBUIÇÃO
   ========================================================= */

.distribution {
    margin-top: 20px;
}

.distribution-bar {
    display: flex;
    width: 100%;
    height: 30px;
    overflow: hidden;
    border-radius: 8px;
    background: #e2e8f0;
}

.distribution-expenses {
    width: 0;
    background: #64748b;
    transition: width .4s ease;
}

.distribution-savings {
    width: 0;
    background: #2563eb;
    transition: width .4s ease;
}

.distribution-legend {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: .78rem;
    color: #64748b;
}


/* =========================================================
   META
   ========================================================= */

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

.goal-box {
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    text-align: center;
}

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

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


/* =========================================================
   PROGRESSO DA META
   ========================================================= */

.goal-progress {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 25px;
    overflow: hidden;
    border-radius: 8px;
    background: #e2e8f0;
}

.progress-fill {
    width: 0;
    height: 100%;
    background: #2563eb;
    transition: width .5s ease;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-top: 7px;
    font-size: .78rem;
    color: #64748b;
}


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

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

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

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

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


/* =========================================================
   TABELA
   ========================================================= */

.table-wrapper {
    overflow-x: auto;
}

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

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

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

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


/* =========================================================
   CENÁRIOS
   ========================================================= */

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

.scenario-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
    background: #fff;
}

.scenario-card h4 {
    margin: 0 0 15px;
    font-size: .95rem;
    color: #0f172a;
}

.scenario-line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: .82rem;
}

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

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


/* =========================================================
   AVISO E STATUS
   ========================================================= */

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

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


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

.economy-info-card h2 {
    margin-top: 0;
}

.economy-info-card h3 {
    margin-top: 25px;
    font-size: 1rem;
}

.economy-info-card p {
    color: #475569;
    line-height: 1.65;
}


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

@media (max-width: 800px) {

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

    .indicator-grid,
    .goal-result,
    .scenario-grid,
    .economy-orientation-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 760px) {

    .economy-card .form-grid {
        grid-template-columns: 1fr;
    }

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

}


@media (max-width: 480px) {

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

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

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

    .economy-actions .tool-button {
        width: 100%;
    }

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

}