/* ── SIMULATOR CREDIT IMMOBILIER SCOPED STYLES ── */
.sim-wrap {
    background: var(--white);
    min-height: 100vh;
}

.page-header-section .hero-badge {
    border-left: none;
    padding-left: 0;
}

/* ── BREADCRUMB / BACK BAR ── */
.sim-breadcrumb {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
}

.sim-breadcrumb .container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.sim-breadcrumb a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.sim-breadcrumb a:hover {
    color: var(--primary-color);
}

.sim-breadcrumb .sep {
    color: var(--text-light-muted);
}

.sim-breadcrumb .current {
    color: var(--primary-color);
    font-weight: 600;
}

/* ── SIM CONTENT WRAPPER ── */
.sim-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

:root {
    /* Text colors */
    --gd: var(--primary-color);
    --gm: var(--text-muted);
    --gl: var(--text-light-muted);

    /* Theme brand colors */
    --bs: var(--primary-light);
    --bm: var(--primary-light);
    --bd: var(--primary-color);
    --bl: var(--accent-light);
    --bx: rgba(116, 167, 201, 0.08);

    /* Basic background & borders */
    --cr: #F8FAFC;
    --wh: var(--white);
    --bo: var(--border-color);

    /* Shadows & radii */
    --sh: var(--shadow-sm);
    --sh2: var(--shadow-md);

    /* Feedback colors */
    --danger: #9C1C18;
    --danger-bg: #FBEAEA;
    --danger-border: #F0C9C9;
}

/* ── SECTION TITLE ── */
.sec {
    margin-bottom: 28px;
}

.sec-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--bo);
}

.sec-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--wh);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
}

.sec-title h2 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--gd);
}

.sec-title p {
    font-size: 13.5px;
    color: var(--gm);
    margin-top: 2px;
}

/* ── MAIN SIMULATOR CARD ── */
.sim-card {
    background: var(--wh);
    border: 1px solid var(--bo);
    border-radius: var(--radius-md);
    padding: 32px;
    box-shadow: var(--sh2);
}

/* ── MODE TABS SELECTOR ── */
.modes {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.mode-btn {
    border: 1.5px solid var(--bo);
    background: var(--wh);
    color: var(--text-dark);
    border-radius: var(--radius-md);
    padding: 14px 10px;
    cursor: pointer;
    text-align: center;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13.5px;
    line-height: 1.35;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mode-btn:hover {
    border-color: var(--primary-light);
    background: var(--bx);
}

.mode-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--wh);
    box-shadow: 0 4px 12px rgba(19, 52, 84, 0.15);
}

.mode-btn .num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--wh);
    font-size: 12px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.mode-btn.active .num {
    background: var(--wh);
    color: var(--primary-color);
}

/* ── FORM FIELDS GRID ── */
.fields {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.field {
    display: flex;
    flex-direction: column;
}

.field.hidden {
    display: none !important;
}

.field label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.field input {
    width: 100%;
    padding: 12px 42px 12px 14px;
    border: 1.5px solid var(--bo);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--text-dark);
    background: #FFFDF6; /* soft subtle warm background for inputs */
    transition: all 0.2s ease;
}

.field input:focus {
    outline: none;
    border-color: var(--primary-light);
    background: var(--wh);
    box-shadow: 0 0 0 3px rgba(116, 167, 201, 0.2);
}

.field .unit {
    position: absolute;
    right: 14px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    pointer-events: none;
}

.field .hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ── ACTIONS ── */
.actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--bo);
}

.btn-calc {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 15px;
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 28px;
    cursor: pointer;
    background: var(--primary-color);
    color: var(--wh);
    transition: all 0.2s ease;
}

.btn-calc:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(19, 52, 84, 0.2);
}

.btn-reset {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 15px;
    border: 1.5px solid var(--bo);
    border-radius: var(--radius-md);
    padding: 12px 22px;
    cursor: pointer;
    background: var(--wh);
    color: var(--primary-color);
    transition: all 0.2s ease;
}

.btn-reset:hover {
    border-color: var(--primary-light);
    background: var(--cr);
}

/* ── ALERT ── */
.alert {
    display: none;
    margin-top: 20px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
}

.alert.show {
    display: block;
}

/* ── RESULTS ── */
.results {
    display: none;
    margin-top: 28px;
    padding-top: 28px;
    border-top: 2px solid var(--bo);
}

.results.show {
    display: block;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.result-box {
    background: var(--cr);
    border: 1px solid var(--bo);
    border-radius: var(--radius-md);
    padding: 20px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.result-box.primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(19, 52, 84, 0.15);
}

.result-box .rlabel {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-box.primary .rlabel {
    color: var(--primary-light);
}

.result-box .rval {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 26px;
    color: var(--primary-color);
    margin-top: 6px;
    letter-spacing: -0.5px;
}

.result-box.primary .rval {
    color: var(--wh);
}

.result-box .rsub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.result-box.primary .rsub {
    color: var(--accent-light);
}

/* ── AMORTIZATION SECTION ── */
.amort-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 24px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--bo);
}

.amort-head h3 {
    color: var(--primary-color);
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 700;
}

.amort-tools {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-sm {
    font-size: 13px;
    padding: 9px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-toggle {
    background: var(--primary-light);
    color: var(--primary-color);
    border: none;
    font-weight: 700;
}

.btn-toggle:hover {
    background: #6098bd;
    color: var(--wh);
}

.btn-export {
    background: var(--wh);
    color: var(--primary-color);
    border: 1.5px solid var(--bo);
}

.btn-export:hover {
    border-color: var(--primary-light);
    background: var(--cr);
}

.table-scroll {
    display: none;
    margin-top: 20px;
    overflow-x: auto;
    border: 1px solid var(--bo);
    border-radius: var(--radius-md);
    box-shadow: var(--sh);
}

.table-scroll.show {
    display: block;
}

table.amort {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    min-width: 680px;
}

table.amort thead th {
    background: var(--primary-color);
    color: var(--wh);
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 12px 14px;
    text-align: right;
    white-space: nowrap;
    font-size: 13px;
}

table.amort thead th:first-child {
    text-align: center;
}

table.amort tbody td {
    padding: 10px 14px;
    text-align: right;
    border-bottom: 1px solid var(--bo);
    color: var(--text-dark);
}

table.amort tbody td:first-child {
    text-align: center;
    font-weight: 600;
    color: var(--primary-color);
}

table.amort tbody tr:nth-child(even) {
    background: var(--cr);
}

table.amort tbody tr:hover {
    background: rgba(116, 167, 201, 0.08);
}

table.amort tbody tr:last-child td {
    border-bottom: none;
}

/* ── DISCLAIMER ── */
.disclaimer-box {
    margin-top: 32px;
    background: #F0F6FA;
    border: 1px solid #D4E4F0;
    border-radius: var(--radius-md);
    padding: 20px 24px;
    font-size: 13.5px;
    color: #334155;
    line-height: 1.6;
}

.disclaimer-box strong {
    color: var(--primary-color);
}

/* ── RESPONSIVE MEDIA QUERIES ── */
@media (max-width: 840px) {
    .modes {
        grid-template-columns: repeat(2, 1fr);
    }
    .fields {
        grid-template-columns: repeat(2, 1fr);
    }
    .result-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .sim-page {
        padding: 24px 16px 60px;
    }
    .sim-card {
        padding: 20px 16px;
    }
    .modes {
        grid-template-columns: 1fr;
    }
    .fields {
        grid-template-columns: 1fr;
    }
    .amort-head {
        flex-direction: column;
        align-items: stretch;
    }
    .amort-tools {
        flex-direction: column;
    }
    .btn-sm {
        justify-content: center;
        width: 100%;
    }
    .actions {
        flex-direction: column;
    }
    .btn-calc, .btn-reset {
        width: 100%;
        text-align: center;
    }
}
