/**
 * Loan Application Form Styles
 */

.elms-loan-application-wrapper {
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px;
    background: #f8f9fa;
}

.application-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
}

.application-title {
    font-size: 32px;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.application-title i {
    margin-right: 10px;
}

.application-subtitle {
    font-size: 16px;
    margin: 0;
    opacity: 0.9;
}

/* Progress Indicator */
.application-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 40px;
    padding: 0 20px;
    position: relative;
}

.application-progress::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 60px;
    right: 60px;
    height: 3px;
    background: #e0e0e0;
    z-index: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 8px;
    transition: all 0.3s;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.step-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    text-align: center;
    max-width: 80px;
}

.progress-step.active .step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(1.1);
}

.progress-step.completed .step-number {
    background: #28a745;
    color: white;
}

.progress-step.active .step-label,
.progress-step.completed .step-label {
    color: #333;
    font-weight: 600;
}

/* Form Container */
.loan-application-form {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.application-section {
    display: none;
}

.application-section.active {
    display: block;
    animation: fadeIn 0.4s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.section-header h3 {
    font-size: 24px;
    margin: 0 0 10px 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h3 i {
    color: #667eea;
}

.section-header p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Loan Type Cards */
.loan-type-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.loan-type-card {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    background: white;
}

.loan-type-card:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.loan-type-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.card-icon {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 15px;
}

.loan-type-card h4 {
    font-size: 20px;
    margin: 0 0 10px 0;
    color: #333;
}

.loan-type-card p {
    font-size: 14px;
    color: #666;
    margin: 0 0 20px 0;
}

.card-features {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
}

.card-features li {
    padding: 8px 0;
    font-size: 14px;
    color: #555;
}

.card-features i {
    color: #28a745;
    margin-right: 8px;
}

.btn-select-loan-type {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-select-loan-type:hover {
    background: #764ba2;
    transform: scale(1.02);
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.required {
    color: #dc3545;
    margin-left: 3px;
}

.form-control {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control:invalid {
    border-color: #e0e0e0;
}

.form-control.error {
    border-color: #dc3545;
}

.subsection-title {
    grid-column: 1 / -1;
    font-size: 18px;
    color: #667eea;
    margin: 20px 0 10px 0;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

/* Conditional Fields */
.business-fields,
.employment-fields {
    display: none;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.business-fields.active,
.employment-fields.active {
    display: grid;
}

/* Document Upload */
.document-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.upload-item {
    border: 2px dashed #d0d0d0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
    background: #fafafa;
}

.upload-item:hover {
    border-color: #667eea;
    background: #f5f7ff;
}

.upload-label {
    display: block;
    cursor: pointer;
    margin-bottom: 15px;
}

.upload-label i {
    font-size: 32px;
    color: #667eea;
    display: block;
    margin-bottom: 10px;
}

.upload-label small {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 5px;
    font-weight: normal;
}

.file-input {
    display: block;
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

.file-preview {
    margin-top: 10px;
    font-size: 12px;
    color: #28a745;
    min-height: 20px;
}

.file-preview i {
    margin-right: 5px;
}

/* Terms Section */
.terms-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    padding: 10px 0;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label span {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

/* Form Navigation */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

.nav-center {
    flex: 1;
    text-align: center;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
    padding: 14px 40px;
    font-size: 16px;
}

.btn-success:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-outline {
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

/* Modal */
.elms-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    border-radius: 10px;
    padding: 40px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.success-modal .modal-icon {
    font-size: 64px;
    color: #28a745;
    margin-bottom: 20px;
}

.success-modal h3 {
    font-size: 24px;
    margin: 0 0 15px 0;
    color: #333;
}

.success-modal .application-id {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
    font-size: 16px;
}

.success-modal .application-id strong {
    color: #667eea;
    font-size: 18px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .elms-loan-application-wrapper {
        padding: 10px;
    }
    
    .loan-application-form {
        padding: 20px;
    }
    
    .application-title {
        font-size: 24px;
    }
    
    .application-progress {
        flex-wrap: wrap;
        gap: 15px;
        padding: 0 10px;
    }
    
    .application-progress::before {
        display: none;
    }
    
    .progress-step {
        flex: 0 0 calc(33.333% - 10px);
    }
    
    .step-label {
        font-size: 10px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .loan-type-cards {
        grid-template-columns: 1fr;
    }
    
    .document-upload-grid {
        grid-template-columns: 1fr;
    }
    
    .form-navigation {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .nav-center {
        order: 3;
        flex-basis: 100%;
    }
}

/* Loading Spinner */
.elms-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 10001;
    text-align: center;
}

.elms-loading i {
    font-size: 32px;
    color: #667eea;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Validation Messages */
.validation-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

.validation-success {
    color: #28a745;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}
