/**
 * Registration Form Two-Column Layout Styles
 *
 * Provides responsive two-column grid layout for Lusail registration forms
 * with full RTL (Right-to-Left) support for Arabic language.
 *
 * Classes:
 * - frm_half: 50% width field
 * - frm_first: Left/first column (clears float)
 * - frm_last: Right/last column
 * - lusail-full-width: Forces full width
 */

/* ================================================================
   BASE LAYOUT - Two Column Grid
   ================================================================ */

/* Form wrapper - establishes context for float clearing */
.registration-form-wrap .frm_form_fields,
.frm_forms .frm_form_fields {
    overflow: hidden; /* Clearfix for floated children */
}

/* Half-width fields */
.registration-form-wrap .frm_form_field.frm_half,
.frm_forms .frm_form_field.frm_half {
    width: 48%;
    float: left;
    box-sizing: border-box;
}

/* First column - clears previous floats */
.registration-form-wrap .frm_form_field.frm_first,
.frm_forms .frm_form_field.frm_first {
    clear: left;
    margin-right: 2%;
}

/* Last column - no right margin */
.registration-form-wrap .frm_form_field.frm_last,
.frm_forms .frm_form_field.frm_last {
    margin-right: 0;
}

/* Full-width fields - forces single column */
.registration-form-wrap .frm_form_field.lusail-full-width,
.frm_forms .frm_form_field.lusail-full-width {
    width: 100% !important;
    float: none !important;
    clear: both !important;
}

/* ================================================================
   SECTION HEADINGS
   ================================================================ */

/* Section dividers */
.registration-form-wrap .frm_form_field.frm_section_heading,
.frm_forms .frm_form_field.frm_section_heading,
.registration-form-wrap .frm_form_field[class*="divider"],
.frm_forms .frm_form_field[class*="divider"] {
    width: 100% !important;
    float: none !important;
    clear: both !important;
    margin-top: 10px;
    margin-bottom: 20px;
}

/* Section heading title */
.registration-form-wrap .frm_form_field.frm_section_heading h3,
.frm_forms .frm_form_field.frm_section_heading h3,
.registration-form-wrap .frm_form_field[class*="divider"] h3,
.frm_forms .frm_form_field[class*="divider"] h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #2DCCD2; /* Lusail teal accent */
    padding-bottom: 12px;
    margin-bottom: 15px;
    margin-top: 0;
}

/* First section - no top margin */
.registration-form-wrap .frm_form_field.frm_section_heading:first-child,
.frm_forms .frm_form_field.frm_section_heading:first-child {
    margin-top: 0;
}

/* ================================================================
   SPECIAL FIELD TYPES - Always Full Width
   ================================================================ */

/* File upload fields */
.registration-form-wrap .frm_form_field[class*="file"],
.frm_forms .frm_form_field[class*="file"] {
    width: 100% !important;
    float: none !important;
    clear: both !important;
}

/* Map picker container */
.registration-form-wrap .frm_form_field.lusail-map-field,
.frm_forms .frm_form_field.lusail-map-field,
.registration-form-wrap .lusail-map-picker-container,
.frm_forms .lusail-map-picker-container {
    width: 100% !important;
    float: none !important;
    clear: both !important;
}

/* HTML/embed fields */
.registration-form-wrap .frm_form_field[data-type="html"],
.frm_forms .frm_form_field[data-type="html"] {
    width: 100% !important;
    float: none !important;
    clear: both !important;
}

/* ================================================================
   FORM FIELD SPACING
   ================================================================ */

.registration-form-wrap .frm_form_field,
.frm_forms .frm_form_field {
    margin-bottom: 20px;
}

/* Input field styling */
.registration-form-wrap .frm_form_field input[type="text"],
.registration-form-wrap .frm_form_field input[type="email"],
.registration-form-wrap .frm_form_field input[type="url"],
.registration-form-wrap .frm_form_field input[type="tel"],
.registration-form-wrap .frm_form_field select,
.registration-form-wrap .frm_form_field textarea,
.frm_forms .frm_form_field input[type="text"],
.frm_forms .frm_form_field input[type="email"],
.frm_forms .frm_form_field input[type="url"],
.frm_forms .frm_form_field input[type="tel"],
.frm_forms .frm_form_field select,
.frm_forms .frm_form_field textarea {
    width: 100%;
    box-sizing: border-box;
}

/* ================================================================
   RTL (Right-to-Left) SUPPORT - Arabic
   ================================================================ */

/* RTL float direction swap */
[dir="rtl"] .registration-form-wrap .frm_form_field.frm_half,
[dir="rtl"] .frm_forms .frm_form_field.frm_half,
html[lang="ar"] .registration-form-wrap .frm_form_field.frm_half,
html[lang="ar"] .frm_forms .frm_form_field.frm_half {
    float: right;
}

/* RTL first column - clears right */
[dir="rtl"] .registration-form-wrap .frm_form_field.frm_first,
[dir="rtl"] .frm_forms .frm_form_field.frm_first,
html[lang="ar"] .registration-form-wrap .frm_form_field.frm_first,
html[lang="ar"] .frm_forms .frm_form_field.frm_first {
    clear: right;
    margin-right: 0;
    margin-left: 2%;
}

/* RTL last column */
[dir="rtl"] .registration-form-wrap .frm_form_field.frm_last,
[dir="rtl"] .frm_forms .frm_form_field.frm_last,
html[lang="ar"] .registration-form-wrap .frm_form_field.frm_last,
html[lang="ar"] .frm_forms .frm_form_field.frm_last {
    margin-left: 0;
}

/* RTL text alignment for labels */
[dir="rtl"] .registration-form-wrap .frm_form_field label,
[dir="rtl"] .frm_forms .frm_form_field label,
html[lang="ar"] .registration-form-wrap .frm_form_field label,
html[lang="ar"] .frm_forms .frm_form_field label {
    text-align: right;
}

/* RTL section heading border on right */
[dir="rtl"] .registration-form-wrap .frm_form_field.frm_section_heading h3,
[dir="rtl"] .frm_forms .frm_form_field.frm_section_heading h3,
html[lang="ar"] .registration-form-wrap .frm_form_field.frm_section_heading h3,
html[lang="ar"] .frm_forms .frm_form_field.frm_section_heading h3 {
    text-align: right;
}

/* ================================================================
   MOBILE RESPONSIVE - Stack to Single Column
   ================================================================ */

@media screen and (max-width: 768px) {
    /* Stack all fields to full width */
    .registration-form-wrap .frm_form_field.frm_half,
    .frm_forms .frm_form_field.frm_half {
        width: 100% !important;
        float: none !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    /* Reset clear for mobile */
    .registration-form-wrap .frm_form_field.frm_first,
    .registration-form-wrap .frm_form_field.frm_last,
    .frm_forms .frm_form_field.frm_first,
    .frm_forms .frm_form_field.frm_last {
        clear: none !important;
    }

    /* Reduce section heading margins on mobile */
    .registration-form-wrap .frm_form_field.frm_section_heading,
    .frm_forms .frm_form_field.frm_section_heading {
        margin-top: 20px;
        margin-bottom: 15px;
    }

    .registration-form-wrap .frm_form_field.frm_section_heading h3,
    .frm_forms .frm_form_field.frm_section_heading h3 {
        font-size: 16px;
    }
}

/* ================================================================
   TABLET RESPONSIVE - Adjust spacing
   ================================================================ */

@media screen and (min-width: 769px) and (max-width: 1024px) {
    .registration-form-wrap .frm_form_field.frm_half,
    .frm_forms .frm_form_field.frm_half {
        width: 48%;
    }

    .registration-form-wrap .frm_form_field.frm_first,
    .frm_forms .frm_form_field.frm_first {
        margin-right: 2%;
    }

    /* RTL tablet adjustment */
    [dir="rtl"] .registration-form-wrap .frm_form_field.frm_first,
    [dir="rtl"] .frm_forms .frm_form_field.frm_first,
    html[lang="ar"] .registration-form-wrap .frm_form_field.frm_first,
    html[lang="ar"] .frm_forms .frm_form_field.frm_first {
        margin-right: 0;
        margin-left: 2%;
    }
}

/* ================================================================
   FORMIDABLE FORMS OVERRIDES
   ================================================================ */

/* Ensure Formidable's default styles don't conflict */
.frm_forms .frm_fields_container {
    overflow: hidden; /* Clearfix */
}

/* Submit button - full width and clear */
.registration-form-wrap .frm_submit,
.frm_forms .frm_submit {
    clear: both !important;
    width: 100%;
    margin-top: 25px;
}

/* Error messages - full width */
.registration-form-wrap .frm_error,
.frm_forms .frm_error {
    width: 100% !important;
}

/* Required field indicator styling */
.registration-form-wrap .frm_required,
.frm_forms .frm_required {
    color: #e74c3c;
}

/* ================================================================
   WEBVIEW FORM SPECIFIC STYLES
   ================================================================ */

/* Webview wrapper */
.webview-form-container .frm_form_field.frm_half {
    width: 48%;
    float: left;
}

.webview-form-container .frm_form_field.frm_first {
    clear: left;
    margin-right: 2%;
}

.webview-form-container .frm_form_field.frm_last {
    margin-right: 0;
}

/* Webview RTL */
[dir="rtl"] .webview-form-container .frm_form_field.frm_half,
html[lang="ar"] .webview-form-container .frm_form_field.frm_half {
    float: right;
}

[dir="rtl"] .webview-form-container .frm_form_field.frm_first,
html[lang="ar"] .webview-form-container .frm_form_field.frm_first {
    clear: right;
    margin-right: 0;
    margin-left: 2%;
}

/* Webview mobile */
@media screen and (max-width: 768px) {
    .webview-form-container .frm_form_field.frm_half {
        width: 100% !important;
        float: none !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
}
