/* =========================
    試算器外框
========================= */

.calculator-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 430px;
    column-gap: 56px;
    align-items: stretch;
    padding: 50px 5% 50px 5%;
    background-color: #ffffff;
    border: 1px solid #d1d1d1;
    border-radius: 46px;
    margin-bottom: 10px;
}

/* =========================
    左側表單區
========================= */

.calculator-form {
    min-width: 0;
    padding-top: 0;
}

.field-group {
    margin-bottom: 27px;
}

.field-group:last-child {
    margin-bottom: 0;
}

.field-label {
    display: block;
    margin-bottom: 13px;
    color: #111111;
    font-size: 20px;
    line-height: 1.4;
    font-weight: 500;
}

/* =========================
    貸款金額
========================= */

.amount-row {
    display: flex;
    align-items: center;
    width: 59%;
    gap: 24px;
}

.amount-input {
    flex: 1;
    min-width: 0;
    height: 55px;
    padding: 0 20px;
    color: #333333;
    background-color: #ffffff;
    border: 1px solid #cecece;
    border-radius: 10px;
    outline: none;
    font-size: 18px;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.amount-input::placeholder {
    color: #b1b1b1;
}

.amount-input:hover {
    border-color: #aaaaaa;
}

.amount-input:focus {
    border-color: #45aaa4;
    box-shadow: 0 0 0 4px rgba(69, 170, 164, 0.12);
}

/* 隱藏 number 預設箭頭 */
.amount-input::-webkit-outer-spin-button,
.amount-input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.amount-input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

.amount-unit {
    flex: 0 0 auto;
    color: #111111;
    font-size: 20px;
    font-weight: 500;
    white-space: nowrap;
}

/* =========================
    貸款費用按鈕
========================= */

.fee-options {
    display: flex;
    width: 100%;
    gap: 28px;
}

.fee-btn {
    flex: 1;
    height: 50px;
    padding: 0 16px;
    color: #555555;
    background-color: #ffffff;
    border: 1px solid #cecece;
    border-radius: 10px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    font-weight: 700;
    transition:
        color 0.2s ease,
        border-color 0.2s ease,
        background-color 0.2s ease,
        transform 0.2s ease;
}

.fee-btn:hover {
    border-color: #45aaa4;
}

.fee-btn:active {
    transform: scale(0.99);
}

.fee-btn.active {
    color: #45aaa4;
    background-color: #e9fbf5;
    border-color: #45aaa4;
}

/* =========================
    利率與年期滑桿
========================= */

.range-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 9px;
}

.range-heading .field-label {
    margin-bottom: 0;
}

.slider-value {
    color: #399e9e;
    font-size: 20px;
    line-height: 1.4;
    font-weight: 700;
    white-space: nowrap;
}

.slider {
    width: 100%;
    height: 10px;
    margin: 0;
    display: block;
    border-radius: 10px;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background: linear-gradient(
        90deg,
        #45a7a2 50%,
        #dddddd 50%
    );
}

/* Chrome、Safari、Edge */

.slider::-webkit-slider-runnable-track {
    height: 10px;
    background: transparent;
    border-radius: 10px;
}

.slider::-webkit-slider-thumb {
    width: 21px;
    height: 21px;
    margin-top: -5.5px;
    appearance: none;
    -webkit-appearance: none;
    background-color: #ffffff;
    border: 2px solid #45a7a2;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Firefox */

.slider::-moz-range-track {
    height: 10px;
    background-color: #dddddd;
    border-radius: 10px;
}

.slider::-moz-range-progress {
    height: 10px;
    background-color: #45a7a2;
    border-radius: 10px;
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background-color: #ffffff;
    border: 2px solid #45a7a2;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* =========================
    右側試算結果
========================= */

.result-box {
    width: 100%;
    min-height: 428px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 28px;
    text-align: center;
    background-color: #effcf7;
}

.result-title {
    margin: 0 0 19px ;
    color: #555555 ;
    font-size: 26px ;
    line-height: 1.5 ;
    font-weight: 700 ;
    padding: 0px !important;
}

.monthly-payment-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 17px;
}

#monthlyPayment {
    color: #ff9e01;
    font-size: 70px;
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -2px;
}

.payment-unit {
    margin-left: 7px;
    color: #555555;
    font-size: 35px;
    line-height: 1;
    font-weight: 700;
}

.apr-text {
    margin-top: 0;
    color: #777777;
    font-size: 17px;
    line-height: 1.5;
    font-weight: 400;
}

.detail-button {
    width: 160px;
    height: 65px;
    margin-top: 33px;
    padding: 0 0px;
    color: #ffffff;
    background-color: #00a19b;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    font-weight: 400;
    letter-spacing: 1px;
    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.detail-button:hover {
    opacity: 0.8;
    transition: 0.5s;
}

.detail-button:active {
    transform: translateY(1px);
}

.calculator-notice{
    width: 90%;
    margin: 0 auto;
    text-align: center;
    margin-bottom: 80px;
}
/* =========================
    平板版
========================= */

@media screen and (max-width: 1000px) {
    .page-wrapper {
        padding-top: 34px;
    }

    .page-title {
        margin-bottom: 34px;
        font-size: 36px;
    }

    .calculator-container {
        grid-template-columns: minmax(0, 1fr) 340px;
        column-gap: 30px;
        padding: 32px;
        border-radius: 34px;
    }

    .field-label {
        font-size: 22px;
    }

    .amount-unit {
        font-size: 22px;
    }

    .fee-options {
        gap: 16px;
    }

    .fee-btn {
        font-size: 20px;
    }

    .result-box {
        min-height: 410px;
        padding: 30px 20px;
    }

    .result-title {
        font-size: 24px;
    }

    #monthlyPayment {
        font-size: 62px;
    }

    .payment-unit {
        font-size: 30px;
    }

    .apr-text {
        font-size: 17px;
    }
}


/* =========================
    小於 700px
    上方表單，下方綠色試算結果
    整體寬度為裝置 90%
========================= */

@media screen and (max-width: 700px) {
    .page-wrapper {
        width: 90%;
        max-width: none;
        padding: 28px 0 40px;
    }

    .page-title {
        margin-bottom: 26px;
        font-size: 30px;
        line-height: 1.35;
    }

    .calculator-container {
        display: flex;
        flex-direction: column;
        width: 90%;
        padding: 27px 20px 20px;
        border-radius: 26px;
    }

    .calculator-form {
        width: 100%;
    }

    .field-group {
        margin-bottom: 25px;
    }

    .field-label {
        margin-bottom: 10px;
        font-size: 20px;
    }

    .amount-row {
        width: 100%;
        gap: 10px;
    }

    .amount-input {
        width: 100%;
        height: 54px;
        padding: 0 14px;
        font-size: 18px;
        border-width: 1.5px;
        border-radius: 8px;
    }

    .amount-unit {
        font-size: 18px;
    }

    .fee-options {
        gap: 10px;
    }

    .fee-btn {
        height: 50px;
        padding: 0 8px;
        font-size: 17px;
        border-width: 1.5px;
        border-radius: 8px;
    }

    .range-heading {
        margin-bottom: 9px;
    }

    .slider-value {
        font-size: 18px;
    }

    .slider {
        height: 8px;
    }

    .slider::-webkit-slider-runnable-track {
        height: 8px;
    }

    .slider::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
        margin-top: -6px;
    }

    .slider::-moz-range-track,
    .slider::-moz-range-progress {
        height: 8px;
    }

    /* 手機版結果綠框移至表單下方 */
    .result-box {
        order: 2;
        width: 100%;
        min-height: auto;
        margin-top: 40px;
        padding: 34px 16px;
    }

    .result-title {
        margin-bottom: 13px;
        font-size: 22px;
    }

    .monthly-payment-row {
        margin-bottom: 13px;
    }

    #monthlyPayment {
        font-size: clamp(48px, 15vw, 64px);
        letter-spacing: -1px;
    }

    .payment-unit {
        margin-left: 4px;
        font-size: 26px;
    }

    .apr-text {
        font-size: 15px;
    }

    .detail-button {
        width: auto;
        min-width: 190px;
        height: 52px;
        margin-top: 26px;
        font-size: 18px;
    }
}

/* =========================
    極小尺寸裝置
========================= */

@media screen and (max-width: 360px) {
    .calculator-container {
        padding-right: 15px;
        padding-left: 15px;
    }

    .fee-options {
        flex-direction: column;
    }

    .fee-btn {
        width: 100%;
    }

    #monthlyPayment {
        font-size: 45px;
    }

    .payment-unit {
        font-size: 23px;
    }
}