/* ============================================================
   SIMULADOR DE POUPANÇA
   Estilos específicos da ferramenta
   ============================================================ */


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

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

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

.orientation-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.orientation-number {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}

.orientation-item h3 {
    margin: 2px 0 7px;
    color: #0f172a;
    font-size: 17px;
}

.orientation-item p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.65;
}

.tip-box {
    display: flex;
    gap: 8px;
    margin-top: 25px;
    padding: 15px 18px;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: #eff6ff;
    color: #334155;
    font-size: 14px;
    line-height: 1.6;
}

.tip-box strong {
    color: #1d4ed8;
    white-space: nowrap;
}


/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */

.simulator-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 24px;
    align-items: start;
}

.sim-card {
    min-width: 0;
}


/* ============================================================
   SELETOR DE MODO
   ============================================================ */

.mode-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 24px 0 28px;
}

.mode-option {
    position: relative;
}

.mode-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mode-option label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #475569;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

.mode-option label:hover {
    border-color: #93c5fd;
    color: #1d4ed8;
}

.mode-option input:checked + label {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}


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

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

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

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

.input-group[hidden] {
    display: none;
}

.input-group label {
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
}

.input-help {
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

.input-group input,
.input-group select {
    width: 100%;
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
    color: #1e293b;
    font: inherit;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

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

.check-group {
    display: flex;
    align-items: center;
    gap: 9px;
    padding-top: 4px;
}

.check-group input {
    width: 18px;
    height: 18px;
    min-height: auto;
    accent-color: #2563eb;
}

.check-group label {
    margin: 0;
    cursor: pointer;
}


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

.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

.action-buttons button {
    min-width: 125px;
}


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

.result-highlight {
    margin-top: 22px;
    padding: 25px 20px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: #eff6ff;
    text-align: center;
}

.result-label {
    display: block;
    margin-bottom: 8px;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
}

.result-value {
    display: block;
    color: #1d4ed8;
    font-size: clamp(30px, 4vw, 42px);
    font-weight: 800;
    line-height: 1.15;
}

.result-description {
    max-width: 470px;
    margin: 12px auto 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.55;
}

.summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    margin-top: 22px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #e2e8f0;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 14px;
    background: #fff;
}

.summary-item span {
    color: #64748b;
    font-size: 12px;
}

.summary-item strong {
    color: #0f172a;
    font-size: 15px;
}

.comparison-box {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 18px;
}

.comparison-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.comparison-item span {
    color: #64748b;
    font-size: 12px;
}

.comparison-item strong {
    color: #0f172a;
    font-size: 15px;
}


/* ============================================================
   GRÁFICO
   ============================================================ */

.chart-card {
    overflow: hidden;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    height: 360px;
    margin-top: 24px;
}

.chart-wrapper canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-top: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 13px;
}

.legend-line {
    display: inline-block;
    width: 28px;
    height: 3px;
    border-radius: 2px;
    background: #2563eb;
}

.legend-line.secondary {
    height: 2px;
    background: #888;
}


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

.table-wrapper {
    width: 100%;
    margin-top: 22px;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.scenario-table,
.evolution-table {
    width: 100%;
    min-width: 650px;
    border-collapse: collapse;
}

.scenario-table th,
.scenario-table td,
.evolution-table th,
.evolution-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #e2e8f0;
    text-align: right;
    white-space: nowrap;
    font-size: 13px;
}

.scenario-table th:first-child,
.scenario-table td:first-child,
.evolution-table th:first-child,
.evolution-table td:first-child {
    text-align: left;
}

.scenario-table th,
.evolution-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
}

.scenario-table td,
.evolution-table td {
    color: #334155;
}

.scenario-table tbody tr:last-child td,
.evolution-table tbody tr:last-child td {
    border-bottom: 0;
}

.scenario-table tbody tr:hover td,
.evolution-table tbody tr:hover td {
    background: #f8fafc;
}


/* ============================================================
   ANÁLISE DA META
   ============================================================ */

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

.goal-result-item {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.goal-result-item span {
    color: #64748b;
    font-size: 12px;
}

.goal-result-item strong {
    color: #0f172a;
    font-size: 17px;
}


/* ============================================================
   INFORMAÇÕES / INTERPRETAÇÃO
   ============================================================ */

.information-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 24px;
}

.information-item {
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.information-item h3 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 16px;
}

.information-item p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.65;
}

.legal-notice {
    margin-top: 24px;
}

.legal-notice p {
    margin: 0 0 10px;
}

.legal-notice p:last-child {
    margin-bottom: 0;
}


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

@media (max-width: 1050px) {

    .simulator-layout {
        grid-template-columns: 1fr;
    }

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

}


@media (max-width: 700px) {

    .mode-selector {
        grid-template-columns: 1fr;
    }

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

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

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

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

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

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

    .chart-wrapper {
        height: 280px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons button {
        width: 100%;
    }

}


@media (max-width: 500px) {

    .orientation-item {
        gap: 11px;
    }

    .orientation-number {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
        font-size: 13px;
    }

    .tip-box {
        flex-direction: column;
        gap: 3px;
    }

    .result-highlight {
        padding: 22px 15px;
    }

    .result-value {
        font-size: 29px;
    }

    .chart-wrapper {
        height: 240px;
    }

}


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

@media print {

    .mode-selector,
    .action-buttons,
    .ad-container,
    .chart-legend {
        display: none !important;
    }

    .simulator-layout {
        display: block;
    }

    .sim-card,
    .section-card {
        box-shadow: none !important;
        break-inside: avoid;
    }

}