/* Loan Application Modal Styles - Professional Version */
.loan-application-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    overflow-y: auto;
    padding: 20px;
}

.loan-modal-content {
    background-color: #fff;
    border-radius: 8px;
    max-width: 800px;
    margin: 30px auto;
    position: relative;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.4s ease-out;
}

@keyframes modalFadeIn {
    0% { opacity: 0; transform: translateY(-30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.loan-modal-header {
    padding: 28px 35px 24px;
    border-bottom: 1px solid #eaeaea;
    position: relative;
    background: #3c6eeb;
    border-radius: 8px 8px 0 0;
    color: white;
}

.loan-modal-header h3 {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.loan-modal-header p {
    margin: 0;
    opacity: 0.9;
    font-weight: 300;
    font-size: 15px;
}

.loan-modal-close {
    position: absolute;
    top: 20px;
    right: 22px;
    font-size: 24px;
    font-weight: 300;
    color: white;
    cursor: pointer;
    transition: 0.2s;
    height: 32px;
    width: 32px;
    line-height: 32px;
    text-align: center;
    border-radius: 50%;
}

.loan-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.loan-modal-body {
    padding: 35px;
    background-color: #fcfcfc;
    border-radius: 0 0 8px 8px;
}

.application-form-section {
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 25px;
}

.application-form-section:last-child {
    border-bottom: none;
    margin-bottom: 10px;
}

.application-form-section h4 {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 600;
    color: #1f3365;
    padding-bottom: 10px;
    border-bottom: 2px solid #e6eaf0;
    display: inline-block;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -12px;
    margin-left: -12px;
}

.form-group {
    margin-bottom: 22px;
    padding-right: 12px;
    padding-left: 12px;
    width: 100%;
}

.col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
}

.col-md-4 {
    flex: 0 0 33.33333%;
    max-width: 33.33333%;
}

.col-md-5 {
    flex: 0 0 41.66667%;
    max-width: 41.66667%;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #445;
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #d8dee9;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

input:focus,
select:focus,
textarea:focus {
    border-color: #1f3365;
    box-shadow: 0 0 0 3px rgba(31, 51, 101, 0.1);
    outline: none;
}

.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #667;
}

input.with-icon {
    padding-left: 30px;
}

.custom-file-upload {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.custom-file-upload input[type="file"] {
    display: none;
}

.file-upload-btn {
    display: inline-block;
    padding: 11px 16px;
    background-color: #f7f7f9;
    border: 1px solid #d8dee9;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
    margin-right: 10px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #445;
}

.file-upload-btn:hover {
    background-color: #eef0f7;
    border-color: #c8d1e0;
}

.file-upload-btn i {
    margin-right: 6px;
}

#file-name {
    font-size: 14px;
    color: #667;
}

.loan-summary-box {
    background-color: #f8fafd;
    border-radius: 6px;
    padding: 22px;
    margin-top: 25px;
    border: 1px solid #e6eaf0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.loan-summary-box h4 {
    margin: 0 0 18px;
    font-size: 18px;
    font-weight: 600;
    color: #1f3365;
    border-bottom: none;
    padding-bottom: 0;
}

.loan-summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #e6eaf0;
    font-size: 14px;
}

.loan-summary-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.loan-summary-item.highlight {
    font-weight: 700;
    color: #1f3365;
    font-size: 16px;
}

.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 35px;
}

.submit-application-btn {
    padding: 14px 35px;
    font-size: 16px;
    background: #1f3365;
    border-color: transparent;
    border-radius: 4px;
    transition: 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(31, 51, 101, 0.2);
}

.submit-application-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(31, 51, 101, 0.3);
    background: #283f7c;
}

/* Success Modal Styles */
.success-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
}

.success-modal-content {
    background-color: #fff;
    border-radius: 8px;
    max-width: 500px;
    margin: 100px auto;
    position: relative;
    text-align: center;
    padding: 45px 35px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.4s ease-out;
}

.success-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 22px;
    font-weight: 300;
    color: #999;
    cursor: pointer;
    transition: 0.2s;
    height: 32px;
    width: 32px;
    line-height: 32px;
    text-align: center;
    border-radius: 50%;
}

.success-modal-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #666;
}

.success-icon {
    font-size: 70px;
    color: #28a745;
    margin-bottom: 25px;
}

.success-modal h3 {
    margin: 0 0 16px;
    font-size: 26px;
    font-weight: 600;
    color: #333;
}

.success-modal p {
    margin-bottom: 28px;
    color: #666;
    font-size: 15px;
    line-height: 1.6;
}

.success-modal-close-btn {
    background-color: #28a745;
    border-color: transparent;
    padding: 12px 28px;
    border-radius:.4px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
    transition: 0.3s;
}

.success-modal-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(40, 167, 69, 0.3);
    background-color: #218838;
}

@media (max-width: 767px) {
    .loan-modal-content {
        margin: 15px auto;
        max-width: calc(100% - 30px);
    }
    
    .loan-modal-header {
        padding: 20px 25px;
    }
    
    .loan-modal-body {
        padding: 25px 20px;
    }
    
    .col-md-3, .col-md-4, .col-md-5, .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .success-modal-content {
        margin: 50px auto;
        max-width: calc(100% - 30px);
        padding: 35px 25px;
    }
}