.mortgage-page {
    max-width: var(--small-width);
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mortgage-panel {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.loan-type-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.loan-type-tab {
    flex: 1;
    padding: 12px 20px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    background: #f8fafc;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.loan-type-tab:hover {
    color: #475569;
    background: #f1f5f9;
}

.loan-type-tab.active {
    background: linear-gradient(135deg, #F59E0B 0%, #F8B500 100%);
    color: #ffffff;
}

.loan-form {
    display: none;
}

.loan-form.active {
    display: block;
}

.form-section {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}

.form-input-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.form-input {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #F59E0B;
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-unit {
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #F59E0B;
    background: #f8fafc;
    border-radius: 10px;
    min-width: 80px;
    text-align: center;
}

.loan-term-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.term-option {
    padding: 12px 16px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.term-option:hover {
    border-color: #F59E0B;
    color: #F59E0B;
}

.term-option.active {
    background: #FFFBEB;
    border-color: #F59E0B;
    color: #F59E0B;
}

.rate-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.rate-preset {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rate-preset:hover {
    border-color: #F59E0B;
    color: #F59E0B;
}

.rate-preset.active {
    background: #FFFBEB;
    border-color: #F59E0B;
    color: #F59E0B;
}

.btn-calculate {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #F59E0B 0%, #F8B500 100%);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-calculate:hover {
    box-shadow: 0 8px 25px rgba(78, 115, 223, 0.4);
}

.rate-info {
    margin-top: 20px;
    padding: 16px;
    background: #fffbeb;
    border-radius: 10px;
    border-left: 4px solid #f59e0b;
    font-size: 13px;
    color: #78350f;
    line-height: 1.6;
}

.result-panel {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 30px;
    display: none;
}

.result-panel.show {
    display: block;
}

.repayment-type-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.repayment-type-tab {
    flex: 1;
    padding: 12px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.repayment-type-tab:hover {
    border-color: #4e73df;
    color: #4e73df;
}

.repayment-type-tab.active {
    background: #eef2ff;
    border-color: #4e73df;
    color: #4e73df;
}

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

.result-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.result-card-label {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 8px;
}

.result-card-value {
    font-size: 24px;
    font-weight: 700;
    color: #374151;
}

.result-card-value.highlight {
    color: #4e73df;
}

.result-card-value.warning {
    color: #ef4444;
}

.result-breakdown {
    margin-bottom: 30px;
}

.breakdown-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 16px;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.breakdown-item {
    background: #f8fafc;
    border-radius: 10px;
    padding: 16px;
}

.breakdown-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.breakdown-item-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.breakdown-item-icon.blue {
    background: #dbeafe;
    color: #2563eb;
}

.breakdown-item-icon.green {
    background: #d1fae5;
    color: #059669;
}

.breakdown-item-label {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
}

.breakdown-item-value {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
}

.amortization-table {
    overflow-x: auto;
}

.amortization-table table {
    width: 100%;
    border-collapse: collapse;
}

.amortization-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.amortization-table td {
    padding: 12px 16px;
    font-size: 13px;
    color: #374151;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
}

.amortization-table tr:hover td {
    background: #f8fafc;
}

.amortization-table .current-month {
    background: #eef2ff;
}

.table-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.table-info {
    font-size: 13px;
    color: #64748b;
}

.table-info span {
    font-weight: 600;
    color: #4e73df;
}

.table-nav {
    display: flex;
    gap: 10px;
}

.nav-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    border-color: #4e73df;
    color: #4e73df;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-btn.active {
    background: #4e73df;
    color: #ffffff;
    border-color: #4e73df;
}

@media (max-width: 768px) {
    .mortgage-page {
        max-width: 500px;
    }
    
    .mortgage-panel {
        padding: 20px;
    }
    
    .loan-term-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .result-summary {
        grid-template-columns: 1fr;
    }
    
    .breakdown-grid {
        grid-template-columns: 1fr;
    }
    
    .result-card-value {
        font-size: 20px;
    }
}