/* =========================================================
   SIMULADOR DE ESTUDOS
   Estilos exclusivos da ferramenta
   ========================================================= */

.study-tool {
    width: 100%;
}

.study-input-section {
    margin-bottom: 24px;
}

.study-input-section h2 {
    margin-bottom: 8px;
}

.section-intro {
    margin-bottom: 24px;
}

.study-orientation .tool-card,
.study-information .tool-card {
    padding: 28px;
}

.orientation-grid,
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.orientation-item,
.info-item {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.orientation-item strong,
.info-item strong {
    color: #0f172a;
}

.orientation-item span,
.info-item span {
    color: #64748b;
    line-height: 1.6;
}

.custom-hours-box,
.custom-session-box {
    margin-top: 16px;
}

.is-hidden {
    display: none !important;
}

.session-settings-grid {
    align-items: end;
}

.days-grid {
    margin-top: 10px;
}

.subject-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.subject-mode {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mode-button {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    padding: 9px 15px;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition:
        background-color .2s ease,
        color .2s ease,
        border-color .2s ease;
}

.mode-button:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.mode-button.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.subject-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(180px, 1.6fr) repeat(2, minmax(130px, 1fr)) repeat(2, minmax(120px, .8fr)) 36px;
    gap: 12px;
    align-items: end;
    padding: 18px;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}

.remove-subject {
    width: 36px;
    height: 42px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff;
    color: #dc2626;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition:
        background-color .2s ease,
        color .2s ease;
}

.remove-subject:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.scenario-fields {
    margin-top: 18px;
}

.scenario-toggle {
    margin-top: 8px;
}

.result {
    display: none;
}

.result.active {
    display: block;
}

.result-total {
    margin-bottom: 24px;
}

.result-total-value.status-ok {
    color: #15803d;
}

.result-total-value.status-danger {
    color: #dc2626;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.summary-card {
    min-height: 112px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}

.summary-label {
    margin-bottom: 9px;
    color: #64748b;
    font-size: .88rem;
    line-height: 1.4;
}

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

.summary-value.status-ok {
    color: #15803d;
}

.summary-value.status-danger {
    color: #dc2626;
}

.status-card {
    background: #f8fafc;
}

.result-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

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

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

.result-table th {
    background: #f8fafc;
    color: #334155;
    font-size: .9rem;
}

.result-table td:last-child,
.result-table th:last-child {
    text-align: right;
}

.result-table tfoot .total td {
    font-weight: 700;
    background: #f8fafc;
}

.chart-box {
    margin-top: 24px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
}

.chart-box h2 {
    margin-bottom: 18px;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
}

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

.scenario-result {
    display: none;
    margin-top: 24px;
}

.scenario-result.active {
    display: block;
}

.scenario-box {
    padding: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.scenario-box h2 {
    margin-bottom: 20px;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.comparison-card {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}

.comparison-card h3 {
    margin-bottom: 8px;
}

.comparison-label {
    color: #64748b;
    font-size: .86rem;
}

.comparison-value {
    margin-bottom: 10px;
    color: #0f172a;
    font-size: 1.15rem;
    font-weight: 700;
}

.calculation-box {
    margin-top: 24px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
}

.calculation-box h2 {
    margin-bottom: 18px;
}

.calculation-item {
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
    color: #475569;
    line-height: 1.6;
}

.calculation-item:last-child {
    border-bottom: 0;
}

.calculation-title {
    display: block;
    margin-bottom: 3px;
    color: #0f172a;
    font-weight: 700;
}

.result-actions {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.legal-notice {
    margin-top: 20px;
    padding: 16px 18px;
    border: 1px solid #fde68a;
    border-radius: 10px;
    background: #fffbeb;
    color: #78350f;
    font-size: .9rem;
    line-height: 1.6;
}


/* =========================================================
   RESPONSIVO
   ========================================================= */

@media (max-width: 1050px) {

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

    .subject-row {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .subject-name {
        grid-column: 1 / -1;
    }

    .remove-subject {
        justify-self: start;
    }
}

@media (max-width: 800px) {

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

    .study-orientation .tool-card,
    .study-information .tool-card,
    .chart-box,
    .scenario-box,
    .calculation-box {
        padding: 20px;
    }

    .subject-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .subject-mode {
        width: 100%;
    }

    .mode-button {
        flex: 1;
    }
}

@media (max-width: 650px) {

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

    .subject-row {
        grid-template-columns: 1fr;
    }

    .subject-name {
        grid-column: auto;
    }

    .remove-subject {
        width: 100%;
    }

    .chart-container {
        height: 250px;
    }

    .result-table th,
    .result-table td {
        padding: 10px;
        font-size: .88rem;
    }

    .orientation-grid,
    .info-grid {
        gap: 12px;
    }
}

@media print {

    .subject-toolbar,
    .actions,
    .result-actions,
    .ad-container,
    header,
    footer,
    .study-orientation,
    .study-information {
        display: none !important;
    }

    .result {
        display: block !important;
    }

    .chart-box,
    .scenario-box,
    .calculation-box,
    .section-card {
        break-inside: avoid;
    }
}