/* =========================================
   CSS BẢNG TÍNH LÃI SUẤT (FINAL VERSION)
   ========================================= */


/* --- 1. KHUNG BAO NGOÀI --- */
.loan-calculator-wrapper {
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    max-width: 100%;
}

/* --- 2. TIÊU ĐỀ --- */
.calculator-header { margin-bottom: 25px; }
.calculator-title { font-size: 24px; font-weight: 700; color: #2c3e50; margin-bottom: 5px; }
.calculator-subtitle { color: #7f8c8d; font-size: 14px; margin: 0; }

/* --- 3. CẤU TRÚC HÀNG VÀ CỘT (GRID) --- */
.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px; /* Bù trừ khoảng cách padding */
    align-items: flex-end; /* Căn đáy để input thẳng hàng */
}

/* Cột chia đôi (50-50) */
.calc-col-6 {
    width: 50%;
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 10px;
    box-sizing: border-box;
    margin-bottom: 15px;
}

.form-group {
    width: 100%;
}

/* --- 4. LABEL VÀ INPUT --- */
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    line-height: 1.4;
}

.label-unit {
    font-weight: 400;
    color: #95a5a6;
    font-size: 12px;
}

/* Style chung cho Input và Select (thẳng hàng, vuông vức) */
.loan-calculator-wrapper .form-control {
    display: block;
    width: 100% !important;
    height: 45px !important; /* Chiều cao cố định */
    padding: 0 12px;
    font-size: 15px;
    line-height: 45px;
    color: #2c3e50;
    background-color: #fff;
    background-image: none;
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    box-sizing: border-box;
    box-shadow: none;
    transition: border-color 0.2s;
}

/* Riêng cho menu thả xuống (Select) */
.loan-calculator-wrapper select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 30px;
    cursor: pointer;
}

.loan-calculator-wrapper .form-control:focus {
    border-color: #3498db;
    outline: none;
}

.loan-calculator-wrapper .form-control[readonly] {
    background-color: #f5f5f5;
    color: #7f8c8d;
}

/* --- 5. PHẦN KẾT QUẢ (2 CỘT NGANG) --- */
.calculator-result {
    margin-top: 5px;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
}

.result-item {
    flex: 1;
    padding: 0 15px;
    margin: 0;
    border: none;
}

/* Đường kẻ giữa 2 cột kết quả */
.result-item:first-child {
    border-right: 1px dashed #cbd5e0;
}

.result-item.highlight {
    padding-top: 0;
    border-top: none; 
}

/* Font chữ kết quả */
.calculator-result h3 {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.loan-amount {
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    line-height: 1.2;
}

.monthly-payment-amount {
    font-size: 26px;
    font-weight: 800;
    color: #e74c3c;
    margin: 0;
    line-height: 1.2;
}

/* --- 6. NÚT BẤM (KHÔI PHỤC STYLE ĐẸP CŨ) --- */
.calculate-btn {
    width: 100%;
    display: block;
    margin-top: 25px;
    padding: 16px 24px;
    
    /* Gradient đỏ đẹp */
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
    
    color: white !important;
    border: none;
    border-radius: 6px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.calculate-btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.calculate-btn:active {
    transform: translateY(0);
}

.calculate-btn.loading {
    opacity: 0.8;
    pointer-events: none;
}

/* --- 7. MOBILE RESPONSIVE --- */
@media (max-width: 600px) {
    .calc-col-6 {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .calculator-result {
        flex-direction: column;
        gap: 20px;
    }
    
    .result-item:first-child {
        border-right: none;
        border-bottom: 1px dashed #cbd5e0;
        padding-bottom: 20px;
    }
}