/* =====================================================
   CALCHUB LOAN CALCULATOR
   ===================================================== */

.ch-loan-calculator {
    width: 100%;
    max-width: 760px;
    margin: 40px auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(15, 23, 42, 0.10);
    font-family: Arial, Helvetica, sans-serif;
    box-sizing: border-box;
}

.ch-loan-calculator *,
.ch-loan-calculator *::before,
.ch-loan-calculator *::after {
    box-sizing: border-box;
}


/* HEADER */

.ch-loan-header {
    padding: 32px 24px;
    text-align: center;
    background: #f8fbff;
    border-bottom: 1px solid #e8edf3;
}

.ch-loan-icon {
    font-size: 38px;
    margin-bottom: 10px;
}

.ch-loan-header h2 {
    margin: 0;
    color: #172033;
    font-size: 26px;
    line-height: 1.2;
    font-weight: 800;
}

.ch-loan-header p {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 15px;
}


/* FORM */

.ch-loan-form {
    padding: 30px;
}

.ch-loan-group {
    margin-bottom: 21px;
}

.ch-loan-group label {
    display: block;
    margin-bottom: 8px;
    color: #172033;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 700;
}


/* SELECT */

.ch-loan-control {
    width: 100%;
    height: 54px;
    padding: 0 14px;
    border: 1px solid #d7dee8;
    border-radius: 11px;
    background: #ffffff;
    color: #172033;
    font-size: 15px;
    outline: none;
    cursor: pointer;
}

.ch-loan-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}


/* INPUT */

.ch-input-wrap {
    position: relative;
    width: 100%;
}

.ch-loan-input {
    display: block;
    width: 100%;
    height: 54px;
    padding: 0 14px;
    border: 1px solid #d7dee8;
    border-radius: 11px;
    background: #ffffff;
    color: #172033;
    font-size: 16px;
    outline: none;
}

.ch-loan-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.ch-loan-input.ch-has-left {
    padding-left: 62px;
}

.ch-loan-input.ch-has-right {
    padding-right: 45px;
}

.ch-input-left {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
    pointer-events: none;
}

.ch-input-right {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 15px;
    font-weight: 700;
    pointer-events: none;
}


/* TERM */

.ch-term-row {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 12px;
}


/* BUTTON */

.ch-calculate-button {
    width: 100%;
    min-height: 54px;
    margin-top: 3px;
    padding: 12px 20px;
    border: 0;
    border-radius: 11px;
    background: #2563eb;
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s ease;
}

.ch-calculate-button:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.ch-calculate-button:active {
    transform: translateY(0);
}


/* ERROR */

.ch-loan-error {
    display: none;
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 14px;
    line-height: 1.5;
}


/* RESULTS */

.ch-loan-results {
    display: none;
    border-top: 1px solid #e5e7eb;
    background: #fbfdff;
}

.ch-results-title {
    padding: 27px 30px 10px;
    text-align: center;
    color: #172033;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.8px;
}


/* MONTHLY */

.ch-monthly-result {
    padding: 10px 30px 28px;
    text-align: center;
}

.ch-result-label {
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
}

.ch-monthly-value {
    margin-top: 7px;
    color: #172033;
    font-size: 36px;
    line-height: 1.2;
    font-weight: 800;
    overflow-wrap: anywhere;
}


/* SUMMARY */

.ch-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 0 30px 28px;
}

.ch-summary-card {
    min-width: 0;
    padding: 17px 10px;
    text-align: center;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
}

.ch-summary-card div {
    margin-bottom: 8px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.ch-summary-card strong {
    display: block;
    color: #172033;
    font-size: 17px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}


/* SCHEDULE BUTTON */

.ch-schedule-button {
    display: block;
    width: calc(100% - 60px);
    min-height: 50px;
    margin: 0 30px 28px;
    border: 1px solid #2563eb;
    border-radius: 10px;
    background: #ffffff;
    color: #2563eb;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.ch-schedule-button:hover {
    background: #eff6ff;
}


/* SCHEDULE */

.ch-schedule {
    display: none;
    margin: 0 30px 30px;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #ffffff;
    overflow: hidden;
}

.ch-schedule-heading {
    padding: 18px;
    border-bottom: 1px solid #e5e7eb;
}

.ch-schedule-heading h3 {
    margin: 0;
    color: #172033;
    font-size: 17px;
}

.ch-schedule-heading p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 12px;
}

.ch-table-scroll {
    width: 100%;
    overflow-x: auto;
}

.ch-table-scroll table {
    width: 100%;
    min-width: 590px;
    border-collapse: collapse;
}

.ch-table-scroll th {
    padding: 12px 9px;
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
    text-align: right;
    white-space: nowrap;
}

.ch-table-scroll th:first-child,
.ch-table-scroll td:first-child {
    text-align: center;
}

.ch-table-scroll td {
    padding: 11px 9px;
    border-top: 1px solid #eef1f5;
    color: #334155;
    font-size: 12px;
    text-align: right;
    white-space: nowrap;
}


/* FOOTER */

.ch-loan-footer {
    padding: 17px 20px;
    text-align: center;
    border-top: 1px solid #eef1f5;
    background: #fafbfc;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}


/* MOBILE */

@media (max-width: 600px) {

    .ch-loan-calculator {
        margin: 25px auto;
        border-radius: 18px;
    }

    .ch-loan-header {
        padding: 27px 18px;
    }

    .ch-loan-header h2 {
        font-size: 23px;
    }

    .ch-loan-header p {
        font-size: 14px;
    }

    .ch-loan-form {
        padding: 23px 18px;
    }

    .ch-term-row {
        grid-template-columns: 1fr;
    }

    .ch-results-title {
        padding-left: 18px;
        padding-right: 18px;
    }

    .ch-monthly-result {
        padding-left: 18px;
        padding-right: 18px;
    }

    .ch-monthly-value {
        font-size: 29px;
    }

    .ch-summary-grid {
        grid-template-columns: 1fr;
        padding-left: 18px;
        padding-right: 18px;
    }

    .ch-schedule-button {
        width: calc(100% - 36px);
        margin-left: 18px;
        margin-right: 18px;
    }

    .ch-schedule {
        margin-left: 18px;
        margin-right: 18px;
    }

}