/* ========================================
   Job Application Form Modal Styles
   ======================================== */

.jbe-application-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.jbe-application-modal.active {
    display: flex;
}

.jbe-application-modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    margin: 20px;
}

.jbe-application-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.jbe-application-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* Header */
.jbe-application-header {
    padding: 30px;
    background: linear-gradient(135deg, #2557a7 0%, #1e3f7a 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.jbe-application-header h2 {
    margin: 0 0 5px 0;
    font-size: 24px;
    font-weight: 600;
}

.jbe-application-job-title {
    margin: 0 0 20px 0;
    font-size: 14px;
    opacity: 0.9;
}

/* Progress Steps */
.jbe-application-progress {
    margin-top: 20px;
}

.jbe-progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
}

.jbe-progress-step {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.jbe-progress-step.active {
    background: white;
    color: #2557a7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.jbe-progress-step.completed {
    background: #4CAF50;
    color: white;
}

.jbe-progress-line {
    width: 30px;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 10px;
}

/* Form Container */
#jbe-application-form {
    padding: 30px;
}

/* Form Steps */
.jbe-form-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.jbe-form-step.active {
    display: block;
}

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

.jbe-form-step h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #333;
}

/* Form Rows and Groups */
.jbe-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.jbe-form-row.full {
    grid-template-columns: 1fr;
}

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

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

.jbe-form-group input,
.jbe-form-group select,
.jbe-form-group textarea {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: #fff;
}

.jbe-form-group input:focus,
.jbe-form-group select:focus,
.jbe-form-group textarea:focus {
    outline: none;
    border-color: #2557a7;
    box-shadow: 0 0 0 3px rgba(37, 87, 167, 0.1);
}

.jbe-form-group input[readonly] {
    background: #f5f5f5;
    color: #666;
    cursor: not-allowed;
}

/* Resume Upload */
.jbe-resume-upload {
    margin-bottom: 20px;
}

.jbe-file-input-wrapper {
    position: relative;
    margin-top: 10px;
}

#jbe-resume {
    display: none;
}

.jbe-file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    border: 2px dashed #2557a7;
    border-radius: 8px;
    background: #f0f5ff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.jbe-file-input-wrapper.has-file .jbe-file-label {
    background: #e8f5e9;
    border-color: #4CAF50;
}

.jbe-file-label:hover {
    border-color: #1e3f7a;
    background: #e8f0ff;
}

.jbe-file-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.jbe-file-text {
    font-size: 14px;
    font-weight: 500;
    color: #2557a7;
}

.jbe-file-size {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.jbe-file-name {
    margin-top: 10px;
    padding: 8px 12px;
    background: #e8f5e9;
    border-radius: 4px;
    font-size: 12px;
    color: #2e7d32;
    display: none;
}

.jbe-file-name.active {
    display: block;
}

/* Checkbox */
.jbe-form-group label[for*="terms"] {
    display: flex;
    align-items: flex-start;
    font-weight: normal;
}

.jbe-form-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Form Actions */
.jbe-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.jbe-form-actions button {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#jbe-btn-prev {
    background: #f0f0f0;
    color: #333;
}

#jbe-btn-prev:hover {
    background: #e0e0e0;
}

#jbe-btn-prev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#jbe-btn-next,
#jbe-btn-submit {
    background: linear-gradient(135deg, #2557a7 0%, #1e3f7a 100%);
    color: white;
}

#jbe-btn-next:hover,
#jbe-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 87, 167, 0.3);
}

#jbe-btn-next:disabled,
#jbe-btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Loading State */
.jbe-form-actions button.loading {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

.jbe-form-actions button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    right: 20px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

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

/* Success Modal */
.jbe-success-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.jbe-success-modal.active {
    display: flex;
}

.jbe-success-content {
    background: white;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

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

.jbe-success-icon {
    font-size: 48px;
    color: #4CAF50;
    margin-bottom: 15px;
}

.jbe-success-content h2 {
    font-size: 22px;
    color: #333;
    margin: 0 0 10px 0;
}

.jbe-success-content p {
    font-size: 14px;
    color: #666;
    margin: 10px 0 20px 0;
    line-height: 1.6;
}

.jbe-redirect-notice {
    font-size: 13px;
    color: #2557a7;
    font-weight: 600;
    margin: 15px 0 20px 0;
}

#jbe-redirect-timer {
    font-size: 16px;
    font-weight: 700;
    color: #2557a7;
}

.jbe-btn-success-close {
    padding: 12px 30px;
    background: linear-gradient(135deg, #2557a7 0%, #1e3f7a 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.jbe-btn-success-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 87, 167, 0.3);
}

/* Radio Button Groups */
.jbe-radio-group {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.jbe-radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #fff;
}

.jbe-radio-label:hover {
    border-color: #2557a7;
    background: #f5f8fc;
}

.jbe-radio-label input[type="radio"] {
    margin: 0;
    margin-right: 8px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.jbe-radio-label input[type="radio"]:checked + span {
    color: #2557a7;
    font-weight: 600;
}

.jbe-radio-label input[type="radio"]:checked {
    accent-color: #2557a7;
}

/* Field Hints */
.jbe-field-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Error Messages */
.jbe-error-message {
    display: none;
    padding: 12px 15px;
    background: #ffebee;
    border-left: 4px solid #f44336;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #c62828;
}

.jbe-error-message.active {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .jbe-application-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .jbe-application-header {
        padding: 20px;
    }

    #jbe-application-form {
        padding: 20px;
    }

    .jbe-form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .jbe-form-actions {
        flex-direction: column;
    }

    .jbe-progress-steps {
        justify-content: space-around;
    }

    .jbe-progress-line {
        width: 15px;
        margin: 0 5px;
    }

    .jbe-radio-group {
        flex-direction: column;
        gap: 10px;
    }
}
