/* General Variables */
:root {
    --primary-color: #007BFF;
    --secondary-color: #6c757d;
    --brand-green-light: #C2CD27;
    --brand-green-dark: #AAB61F;
    --text-dark: #343a40;
    --text-medium: #606060;
    --text-light: #f8f9fa;
    --background-light: #ffffff;
    --background-gray: #f2f4f6;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.15);
    --error-color: #dc3545;
    --success-color: #28a745;
}

/* Base Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-gray);
    color: var(--text-dark);
    line-height: 1.6;
    direction: rtl;
    text-align: right;
}

form {
    width: 100%;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

    a:hover {
        color: #0056b3;
    }
.btn-submit, .btn-previous, .btn-skip, .another-btn{
    justify-content: center;
}
/* Wizard Container Layout (DEFAULT/LARGE SCREENS: Vertically Centered, Image Left, Form Right) */
.wizard-container {
    display: flex;
    flex-direction: row-reverse !important; /* Image Left, Form Right */
    max-width: 950px;
    width: 100%;
    background: var(--background-light);
    box-shadow: 0 0 15px var(--shadow-color);
    border-radius: 12px;
    overflow: hidden;
    opacity: 0;
    animation: fadeIn 0.7s ease-out 0.2s forwards;
    min-height: 450px;
    align-items: stretch;
    /* REVERTED CHANGES FOR VERTICAL CENTERING ON LARGE SCREENS */
    position: fixed; /* Fix to the viewport */
    top: 50%; /* Start at 50% from top */
    left: 50%; /* Start at 50% from left */
    transform: translate(-50%, -50%); /* Shift back by half its own size */
    z-index: 1000;
    margin: 0; /* Clear previous margin */
}

.image-section {
    flex: 1;
    max-width: 40%;
    flex-shrink: 0; /* Prevent unwanted shrinking */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-left: 2px solid var(--border-color);
    background-color: #f9f9f9;
    border-right: 3px solid var(--brand-green-light);
    order: 1; /* Image on the left side */
}

    .image-section img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        opacity: 0;
        animation: slideInRight 0.8s ease-out 0.3s forwards;
        border-radius: inherit;
    }

.form-section {
    flex: 1;
    padding: 30px 40px;
    display: flex;
    padding-right: 1.2rem;
    padding-left: 1.2rem;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    order: 2; /* Form on the right side */
}

/* ... (Unchanged styles for form elements, buttons, animations, etc. follow here) ... */

.form-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--brand-green-dark);
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}


.form-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, var(--brand-green-light), #aadd00, var(--brand-green-dark), #00aaff, var(--brand-green-light));
    background-size: 200% 100%;
    border-radius: 5px;
    transform: translateX(-50%);
    animation: animatedBorder 3s linear infinite alternate;
}

.description {
    font-size: 18px;
    color: var(--text-medium);
    margin-bottom: 30px;
    line-height: 1.8;
}

/* Form Elements */
.form-horizontal {
    width: 95%;
    max-width: 600px;
    margin: 0 auto 30px auto;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    width: 100%;
    justify-content: center;
}

.form-holder {
    width: calc(50% - 10px);
    min-width: 280px;
}

    .form-holder.single-field {
        width: 100%;
    }

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    color: var(--text-dark);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--background-light);
}
select.form-control{
    padding: 0 !important;
}

.form-control:focus {
    border-color: var(--brand-green-light);
    box-shadow: 0 0 0 4px rgba(194, 205, 39, 0.25);
    outline: none;
}

/* Validation Summary & Messages */
.text-danger {
    color: var(--error-color);
    font-size: 14px;
    margin-top: 5px;
    display: block;
    text-align: right;
}

/* Button Group */
.button-group {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    width: 100%;
}

.btn-submit {
    background-color: var(--brand-green-light);
    padding: 14px 28px;
    color: white;
    font-size: 17px;
    font-weight: 600;
    border-radius: 10px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease-in-out, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}


    .btn-submit i {
        font-size: 18px;
    }

    .btn-submit:hover {
        background-color: var(--brand-green-dark);
        transform: translateY(-3px);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    }

    .btn-submit:active {
        transform: translateY(0);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

    .btn-submit:disabled {
        background-color: var(--secondary-color);
        cursor: not-allowed;
        box-shadow: none;
        transform: none;
    }

.btn-previous {
    background-color: #494a45;
}

    .btn-previous:hover {
        background-color: #3b3c37;
    }

.btn-skip {
    background-color: #99465f;
}

    .btn-skip:hover {
        background-color: #96425b;
    }

.another-btn {
    background-color: #6e4391bf;
}

    .another-btn:hover {
        background-color: #6e4391e6;
    }

.wizard-steps-container {
    width: 100%;
    margin-bottom: 40px;
}

.step-label {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-medium);
    margin-bottom: 10px;
}

.wizard-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
}

    .wizard-steps::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 0;
        right: 0;
        height: 4px;
        background-color: var(--border-color);
        transform: translateY(-50%);
        z-index: 0;
    }

    .wizard-steps .step {
        position: relative;
        z-index: 1;
        width: 40px;
        height: 40px;
        background-color: var(--background-light);
        border: 3px solid var(--border-color);
        border-radius: 50%;
        text-align: center;
        line-height: 34px;
        font-weight: bold;
        color: var(--text-medium);
        transition: all 0.3s ease;
    }

        .wizard-steps .step.active {
            background-color: var(--brand-green-light);
            border-color: var(--brand-green-light);
            color: white;
            animation: pulse 1.5s infinite alternate ease-in-out;
        }

        .wizard-steps .step.completed {
            background-color: var(--brand-green-light);
            border-color: var(--brand-green-light);
            color: white;
        }
/* ... (Animation keyframes) ... */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(50px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes animatedBorder {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(194, 205, 39, 0.7);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(194, 205, 39, 0);
        transform: scale(1.03);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(194, 205, 39, 0.7);
        transform: scale(1);
    }
}

/* ========================================= */
/* File Upload Styles (Improved)             */
/* ========================================= */
.file-upload-wrapper {
    width: 30rem;
}

.file-upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 450px;
    /* Removed unused variables (var(--spacing-md) etc.) and replaced with fixed values */
    margin: 20px auto;
    padding: 20px;
    background-color: var(--background-light);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

    .file-upload-container:hover {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    }

.file-input {
    display: none !important;
}

.custom-file-upload {
    border: 2px dashed var(--primary-color);
    border-radius: 10px;
    /* Removed unused variables (var(--spacing-lg) etc.) and replaced with fixed values */
    padding: 20px;
    cursor: pointer;
    background-color: var(--background-light);
    color: var(--primary-color);
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    width: 100%;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 60px;
}

    .custom-file-upload i {
        font-size: 24px;
    }

    .custom-file-upload:hover {
        background-color: #e6f2ff;
        border-color: #0056b3;
        transform: translateY(-2px);
    }

.file-name {
    font-size: 14px;
    color: var(--text-medium);
    margin-top: 5px;
    text-align: center;
    width: 100%;
    word-wrap: break-word;
    padding: 0 5px;
}


.file-input.file-selected {
    background-color: var(--brand-green-light) !important;
    border: 1px solid var(--brand-green-dark) !important;
}


/* Remove unused/redundant rule for company logo */
.company-logo-small {
    display: none;
}


/* ************************************************************************************* For Button Loader (*/
.htmx-request .btn-text,
.htmx-request .fa-arrow-left {
    display: none !important;
}


.spinner {
    display: none !important;
}

.htmx-request .spinner {
    display: inline-block !important;
    margin-left: 5px !important;
}


.btn-submit:disabled {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
}
/* ************************************************************************************* For Button Loader )*/

/* ----------------------------------------------------------------------------------------------------
 * START: Media Query Management (Targeting < 1000px)
 * ---------------------------------------------------------------------------------------------------- */

/* Override large screen settings when screen width is less than 1000px */
@media (max-width: 1049px) {

    /* Primary Container Change: Go from vertically centered dialog to standard flow */
    .wizard-container {
        flex-direction: column; /* Stack vertically */
        margin: 20px auto; /* Add vertical margin for breathing room */
        max-width: 95%; /* Use full available width on mobile/tablet */
        min-height: unset;
        /* Disable fixed positioning for mobile view */
        position: static;
        top: auto;
        left: auto;
        transform: none;
        border-radius: 10px;
        box-shadow: 0 0 10px var(--shadow-color);
    }

    /* Image Section: Hide it completely */
    .image-section {
        display: none;
    }

    /* Form Section: Make it full width and apply mobile padding */
    .form-section {
        max-width: 100%;
        padding: 25px 20px;
        order: 1;
    }

    .form-title {
        font-size: 28px;
        margin-bottom: 20px;
    }

        .form-title::after {
            width: 80%;
        }

    .description {
        font-size: 16px;
        margin-bottom: 20px;
    }

    /* Form Layout: Stack fields vertically */
    .form-row {
        flex-direction: column;
        gap: 15px;
    }

    .form-holder,
    .form-holder.single-field {
        width: 100%;
        min-width: unset;
    }

    /* Buttons: Stack vertically */
    .button-group {
        display: flex;
        flex-direction: column; /* ترتيب عمودي */
        gap: 15px;
    }

    /* زر التالي (أو زر الإرسال) يأخذ الترتيب الأول */
    .btn-submit {
        order: 1;
    }

    /* زر السابق يأخذ الترتيب الثاني ليظهر تحت التالي */
    .btn-previous {
        order: 2;
    }

    /* أي أزرار أخرى مثل تخطي تظهر في النهاية */
    .btn-skip, .another-btn {
        order: 3;
    }

    .btn-submit,
    .btn-previous,
    .btn-skip,
    .another-btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 16px;
    }

    .step-label {
        font-size: 16px;
    }

    .wizard-steps .step {
        width: 35px;
        height: 35px;
        line-height: 29px;
    }

    /* Small Company Logo in Form Header (if used) */
    .company-logo-small {
        max-height: 40px;
        margin-left: 10px;
        display: block;
    }

    .file-upload-wrapper {
        width: 100%;
        margin: auto;
    }


    .form-title-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 90%;
    }

    .form-title::after{
        width: 100%;
    }

}

@media (max-width: 460px){
    .form-title {
        font-size: 23px;
    }
    
}
/* Ensure large screen settings are reapplied for width >= 1000px */
@media (min-width: 1050px) {
    .wizard-container {
        /* Optional: increase max width slightly for large desktops */
        max-width: 1100px;
    }

    .image-section {
        max-width: 35%;
        display: flex;
        order: 1;
    }

    .form-section {
        order: 2;
    }

    
}
/* ----------------------------------------------------------------------------------------------------
 * END: Media Query Management
 * ---------------------------------------------------------------------------------------------------- */
