* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --blue: #0868ff;
    --blue-light: #f0f6ff;
    --border: #dcdfe5;
    --text: #101010;
    --muted: #59606b;
    --orange: #e66a00;
    --yellow: #ff9f22;
    --purple: #8d2cff;
}

/* body {
    min-height: 100vh;
    font-family: "Poppins", sans-serif;
    color: var(--text);
    background: linear-gradient(
        to bottom,
        #fff 0%,
        #fff 45%,
        #f1f7ff 100%
    );
}

button,
input {
    font-family: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.page {
    width: calc(100% - 32px);
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px 0 35px;
} */

/* h1,
.calculator-left > h2,
.meaning > h2,
.schedule-heading h2 {
    font-family: "Roboto Slab", serif;
} */

h1 {
    margin-bottom: 14px;
    font-size: 29px;
    line-height: 1.25;
}


/* ============================================
   MAIN CALCULATOR
============================================ */

.calculator {
    min-height: 485px;
    display: grid;
    grid-template-columns: 54% 46%;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #fff;
}


/* ============================================
   LEFT PANEL
============================================ */

.calculator-left {
    padding: 26px 24px;
    background: var(--blue-light);
    border-right: 1px solid #bad6ff;
}

.calculator-left > h2 {
    margin-bottom: 10px;
    font-size: 24px;
}

.loan-card,
.control-card {
    border: 1px solid #dadde1;
    border-radius: 12px;
    background: #fff;
}

.loan-card {
    padding: 18px 17px;
}

.loan-top {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.field-title {
    width: 42%;
}

.field-title > span,
.control-card label {
    display: block;
    color: #4e5561;
    font-size: 14px;
    font-weight: 600;
}

.input-money {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #c5c5c5;
    font-weight: 600;
}

.input-money input,
.plain-input {
    width: 100%;
    height: 29px;
    border: 0;
    outline: none;
    background: transparent;
    color: #111;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
}

.quick-buttons {
    display: flex;
    align-items: center;
    gap: 9px;
}

.quick {
    min-width: 51px;
    height: 33px;
    padding: 0 12px;
    border: 1px solid #d0d0d0;
    border-radius: 20px;
    background: #fff;
    color: #111;
    font-size: 12px;
    cursor: pointer;
    transition: .2s;
    font-weight: 600;
}

.quick:hover,
.quick.active {
    border-color: var(--blue);
    color: var(--blue);
    background: #f7faff;
}


/* ============================================
   RANGE SLIDER
============================================ */

.range {
    --progress: 20%;

    width: 100%;
    height: 4px;
    display: block;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    border-radius: 20px;
    outline: none;
    cursor: pointer;

    background: linear-gradient(
        to right,
        var(--blue) 0%,
        var(--blue) var(--progress),
        #dedede var(--progress),
        #dedede 100%
    );
}

.range::-webkit-slider-thumb {
    width: 19px;
    height: 19px;
    appearance: none;
    -webkit-appearance: none;
    border: 3px solid var(--blue);
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(0, 104, 255, .08);
}

.range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 3px solid var(--blue);
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

.range-labels {
    margin-top: 11px;
    display: flex;
    justify-content: space-between;
    color: #535b66;
    font-size: 10px;
}


/* ============================================
   INTEREST / TENURE
============================================ */

.control-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.control-card {
    min-height: 137px;
    padding: 18px 17px;
}

.control-card small {
    font-size: 12px;
}

.control-card .plain-input {
    margin: 7px 0 10px;
    border-bottom: 1px solid #c5c5c5;
}

.tenure-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.period-toggle {
    display: flex;
    align-items: center;
}

.period-toggle button {
    width: 52px;
    height: 31px;
    margin-left: 6px;
    border: 1px solid #ccc;
    border-radius: 17px;
    background: #eee;
    color: #111;
    font-size: 12px;
    cursor: pointer;
}

.period-toggle button.active {
    border-color: var(--blue);
    background: #f1f6ff;
    color: var(--blue);
}


/* ============================================
   RIGHT PANEL
============================================ */

.calculator-right {
    padding: 32px 37px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: #fff;
}

.result-card {
    width: 100%;
    max-width: 460px;
    overflow: hidden;
    border: 1px solid #c9dcfa;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 84, 190, .17);
}

.emi-header {
    min-height: 116px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #eff5ff;
}

.emi-header span {
    font-size: 16px;
    font-weight: 500;
}

.emi-header strong {
    margin-top: 2px;
    /* font-family: Georgia, serif; */
    font-size: 43px;
    line-height: 1.1;
}

.result-details {
    margin: 16px 24px 32px;
    padding: 19px 24px;
    border-radius: 12px;
    background: #fafafa;
}

.result-details > div {
    padding: 8px 0;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    font-size: 14px;
}

.result-details strong {
    white-space: nowrap;
}

.result-details .total-result {
    margin-top: 6px;
    padding-top: 15px;
    border-top: 1px dashed #ddd;
    font-size: 17px;
}

.apply-button {
    width: calc(100% - 48px);
    height: 50px;
    margin: 0 24px 23px;
    border: 0;
    border-radius: 4px;
    background: var(--blue);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: .2s;
}

.apply-button:hover {
    background: #0059de;
}


/* ============================================
   SCHEDULE TOGGLE
============================================ */

.schedule-toggle-wrap {
    padding: 19px 0 11px;
    display: flex;
    justify-content: center;
}

.schedule-toggle,
.download-button {
    border: 1px solid #73a8ff;
    background: #fff;
    color: var(--blue);
    font-weight: 500;
    cursor: pointer;
}

.schedule-toggle {
    padding: 12px 21px;
    border-radius: 26px;
}

.schedule-toggle span {
    margin-left: 7px;
}

.download-button {
    padding: 2px 14px;
    border-radius: 20px;
    font-size: 14px;
}

.hidden {
    display: none !important;
}


/* ============================================
   AMORTISATION
============================================ */

.schedule-section {
    margin-top: 4px;
    overflow: hidden;
    border: 1px solid #d7dde6;
    border-radius: 12px;
    background: rgba(255, 255, 255, .75);
}

.schedule-heading {
    padding: 16px 20px 7px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.schedule-heading h2 {
    font-size: 19px;
}

.schedule-summary {
    padding: 7px 20px 8px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.schedule-summary > div {
    min-height: 68px;
    padding: 11px;
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
}

.schedule-summary span {
    color: #59606a;
    font-size: 14px;
}

.schedule-summary strong {
    margin-top: 3px;
    font-size: 22px;
}

.blue-text {
    color: var(--blue);
}

.orange-text {
    color: #bf5a00;
}


/* ============================================
   PRINCIPAL / INTEREST BAR
============================================ */

.payment-bar {
    height: 8px;
    margin: 2px 20px 0;
    display: flex;
    overflow: hidden;
    border-radius: 6px;
    background: #eee;
}

.principal-bar {
    width: 86%;
    background: var(--blue);
}

.interest-bar {
    flex: 1;
    background: var(--yellow);
}

.payment-legend {
    padding: 5px 20px 13px;
    display: flex;
    justify-content: space-between;
    color: #555;
    font-size: 9px;
}

.dot,
.purple-dot,
.yellow-dot {
    display: inline-block;
    border-radius: 50%;
}

.dot {
    width: 7px;
    height: 7px;
}

.blue-dot {
    background: var(--blue);
}

.orange-dot {
    background: var(--yellow);
}


/* ============================================
   AMORTISATION TABLE
============================================ */

.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 14px;
}

thead th {
    padding: 12px 20px;
    border-top: 1px solid #e5e9ef;
    border-bottom: 1px solid #e5e9ef;
    color: #5f6670;
    font-size: 13px;
    font-weight: 600;
    text-align: right;
    letter-spacing: .2px;
}

thead th:first-child {
    width: 30%;
    text-align: left;
}

tbody td {
    padding: 9px 20px;
    border-bottom: 1px solid #edf0f4;
    text-align: right;
}

tbody td:first-child {
    text-align: left;
}


/* ============================================
   YEAR ACCORDION
============================================ */

.year-row {
    background: rgba(255, 255, 255, .92);
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: background .2s ease;
}

.year-row:hover {
    background: #f6f9ff;
}

.year-row.open {
    background: #fff;
}

.year-row td {
    padding-top: 11px;
    padding-bottom: 11px;
    vertical-align: middle;
}

.year-cell {
    display: flex;
    align-items: flex-start;
    gap: 9px;
}

.year-arrow {
    width: 13px;
    flex: 0 0 13px;
    margin-top: -1px;
    color: var(--blue);
    font-size: 20px;
    font-weight: 400;
    line-height: 20px;
    transition: transform .2s ease;
}

.year-info {
    width: 100%;
    max-width: 260px;
    display: flex;
    flex-direction: column;
}

.year-info strong {
    font-size: 13px;
    line-height: 20px;
}


/* blue line below each year */

.year-progress {
    width: 100%;
    height: 4px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 20px;
    background: #e0e9f8;
}

.year-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(
        90deg,
        #0068ff,
        #6a91ff
    );
    transition: width .3s ease;
}


/* ============================================
   MONTH ROWS
============================================ */

.month-row {
    background: rgba(248, 251, 255, .75);
}

.month-row:hover {
    background: #f3f7fd;
}

.month-row td {
    padding-top: 8px;
    padding-bottom: 8px;
    color: #252b33;
    font-size: 13px;
}

.month-row td:first-child {
    padding-left: 67px;
    color: #5e6670;
}

.month-interest {
    color: #c45d00 !important;
}


/* ============================================
   SCHEDULE FOOTER
============================================ */

.schedule-note {
    min-height: 35px;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: #555;
    font-size: 12px;
}

.schedule-note b {
    color: var(--blue);
}

.schedule-note small {
    color: #888;
    /* font-size: 8px; */
}


/* ============================================
   WHAT DOES THIS MEAN
============================================ */

.meaning {
    margin-top: 13px;
}

.meaning > h2 {
    font-size: 22px;
}

.meaning-subtitle {
    margin: 17px 0 14px;
    color: #333;
    font-size: 13px;
}

.meaning-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.explanation-card,
.analysis-card {
    min-height: 280px;
    padding: 18px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #F7F8FA;
}

.mini-stats {
    padding-bottom: 14px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid #ddd;
}

.mini-stats div {
    display: flex;
    flex-direction: column;
}

.mini-stats span,
.analysis-stats span {
    color: #59606a;
    font-size: 14px;
}

.mini-stats strong {
    font-size: 16px;
}

.explanation-lines {
    padding-top: 10px;
}

.explanation-lines p {
    margin: 5px 0;
    display: flex;
    gap: 10px;
    font-size: 14px;
}

.explanation-lines p > span {
    flex: 0 0 auto;
    color: #04a844;
    font-weight: 600;
}


/* ============================================
   ANALYSIS
============================================ */

.analysis-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.analysis-stats > div {
    min-height: 55px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    border-radius: 7px;
    background: #fff;
}

.analysis-stats strong {
    font-size: 16px;
}

.donut-area {
    margin-top: 23px;
    padding-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    border-top: 1px solid #ddd;
}

.donut {
    width: 98px;
    height: 98px;
    display: grid;
    place-items: center;
    flex: 0 0 98px;
    border-radius: 50%;
    background: conic-gradient(
        var(--purple) 0 86%,
        var(--yellow) 86% 100%
    );
}

.donut > div {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #fff;
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 0px;
    font-size: 14px;
}

.purple-dot,
.yellow-dot {
    width: 8px;
    height: 8px;
    margin-right: 5px;
}

.purple-dot {
    background: var(--purple);
}

.yellow-dot {
    background: var(--yellow);
}


/* ============================================
   TABLET
============================================ */

@media (max-width: 900px) {

    .calculator {
        grid-template-columns: 1fr;
    }

    .calculator-left {
        border-right: 0;
        border-bottom: 1px solid #bad6ff;
    }

    .calculator-right {
        padding: 28px;
    }

    .result-card {
        max-width: 600px;
    }

    .meaning-grid {
        grid-template-columns: 1fr;
    }

}


/* ============================================
   MOBILE
============================================ */

@media (max-width: 600px) {

    .page {
        width: 100%;
        padding: 12px;
    }

    h1 {
        font-size: 23px;
    }

    .calculator {
        border-radius: 13px;
    }

    .calculator-left {
        padding: 20px 14px;
    }

    .calculator-left > h2 {
        margin-bottom: 18px;
        font-size: 17px;
    }

    .loan-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .field-title {
        width: 100%;
    }

    .quick-buttons {
        width: 100%;
        padding-bottom: 4px;
        overflow-x: auto;
    }

    .quick {
        flex: 0 0 auto;
    }

    .control-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .calculator-right {
        padding: 20px 12px;
    }

    .emi-header strong {
        font-size: 36px;
    }

    .result-details {
        margin: 14px 12px 22px;
        padding: 15px;
    }

    .result-details > div {
        font-size: 12px;
    }

    .result-details .total-result {
        font-size: 14px;
    }

    .apply-button {
        width: calc(100% - 24px);
        margin: 0 12px 13px;
    }

    .schedule-toggle {
        padding: 10px 15px;
        font-size: 11px;
    }

    .schedule-heading {
        align-items: flex-start;
        gap: 10px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .schedule-heading h2 {
        font-size: 16px;
    }

    .download-button {
        font-size: 9px;
    }

    .schedule-summary {
        padding: 7px 10px;
        gap: 5px;
    }

    .schedule-summary > div {
        min-height: 58px;
        padding: 8px 5px;
    }

    .schedule-summary span {
        font-size: 7px;
    }

    .schedule-summary strong {
        font-size: 12px;
    }

    .payment-bar {
        margin-left: 10px;
        margin-right: 10px;
    }

    .payment-legend {
        padding-left: 10px;
        padding-right: 10px;
    }

    table {
        min-width: 680px;
    }

    .year-info {
        min-width: 105px;
    }

    .year-progress {
        width: 105px;
    }

    .month-row td:first-child {
        padding-left: 45px;
    }

    .schedule-note {
        align-items: flex-start;
        flex-direction: column;
        padding: 10px;
    }

    .meaning > h2 {
        font-size: 19px;
    }

    .explanation-card,
    .analysis-card {
        padding: 13px;
    }

    .mini-stats {
        gap: 5px;
    }

    .mini-stats strong {
        font-size: 9px;
    }

    .explanation-lines p {
        font-size: 11px;
    }

}


/* ============================================
   SMALL PHONE
============================================ */

@media (max-width: 380px) {

    h1 {
        font-size: 20px;
    }

    .period-toggle button {
        width: 45px;
    }

    .result-details > div {
        gap: 7px;
        font-size: 11px;
    }

    .schedule-summary strong {
        font-size: 10px;
    }

    .donut-area {
        flex-direction: column;
    }

}