/**
 * Formidable Forms RTL (Hebrew) Support - AGGRESSIVE VERSION
 * Version: 2.0.1
 * 
 * This CSS file forces RTL layout on ALL Formidable form elements
 * WITHOUT modifying colors, heights, backgrounds, or other design elements.
 */

/* ========================================
   FORCE RTL ON ALL FORMS - HIGHEST PRIORITY
======================================== */

/* All Formidable containers */
form.frm-show-form,
.frm_forms,
.frm_form_fields,
.frm_form_field,
.with_frm_style,
div[id^="frm_form_"],
.frm_style_formidable-style {
    direction: rtl !important;
    text-align: right !important;
}

/* ========================================
   ALL INPUT FIELDS - TEXT, EMAIL, TEL, ETC
======================================== */

/* Every possible input type */
.frm_forms input[type="text"],
.frm_forms input[type="email"],
.frm_forms input[type="url"],
.frm_forms input[type="tel"],
.frm_forms input[type="number"],
.frm_forms input[type="password"],
.frm_forms input[type="search"],
.frm_forms input[type="date"],
.frm_forms input[type="time"],
.frm_forms textarea,
.frm_forms select,
.frm_forms .frm_text,
.frm_forms .frm_email,
.frm_forms .frm_tel,
.frm_forms .frm_number,
form.frm-show-form input,
form.frm-show-form textarea,
form.frm-show-form select {
    direction: rtl !important;
    text-align: right !important;
    unicode-bidi: embed !important;
}

/* Placeholder text direction */
.frm_forms input::placeholder,
.frm_forms textarea::placeholder,
form.frm-show-form input::placeholder,
form.frm-show-form textarea::placeholder {
    text-align: right !important;
    direction: rtl !important;
}

.frm_forms input::-webkit-input-placeholder {
    text-align: right !important;
    direction: rtl !important;
}

.frm_forms input::-moz-placeholder {
    text-align: right !important;
    direction: rtl !important;
}

/* ========================================
   TELEPHONE FIELDS - SPECIAL HANDLING
======================================== */

/* Telephone inputs */
.frm_forms input[type="tel"],
.frm_forms .frm_phone_field,
.frm_forms input.frm_phone,
input[name*="phone"],
input[name*="telephone"],
input[name*="tel"],
.frm_form_field input[type="tel"] {
    direction: rtl !important;
    text-align: right !important;
}

/* International Tel Input */
.frm_forms .iti,
.iti__selected-dial-code,
.iti__tel-input {
    direction: rtl !important;
    text-align: right !important;
}

.frm_forms .iti__flag-container {
    left: auto !important;
    right: 0 !important;
}

.frm_forms .iti__selected-flag {
    padding: 0 8px 0 0 !important;
}

.frm_forms .iti--allow-dropdown input {
    padding-right: 52px !important;
    padding-left: 12px !important;
}

/* ========================================
   LABELS
======================================== */

.frm_forms label,
.frm_forms .frm_primary_label,
.frm_forms .frm_form_field label,
form.frm-show-form label,
.frm_top_container label,
.frm_inside_container label {
    text-align: right !important;
    direction: rtl !important;
}

/* Only show labels that should be visible (not screen-reader-only) */
.frm_forms .frm_top_container label,
.frm_forms .frm_left_container label {
    display: block !important;
}

/* ========================================
   CONSENT TEXT & AGREEMENTS
======================================== */

/* Consent fields, agreements, terms */
.frm_forms .frm_agreement,
.frm_forms .frm_consent,
.frm_forms .frm_agreement_text,
.frm_forms .frm_consent_text,
.frm_form_field .frm_opt_container,
.frm_forms .frm_html_container,
.frm_forms .frm_description,
.frm_forms .frm_note,
.frm_forms .frm_section_heading,
form.frm-show-form .frm_description,
form.frm-show-form .frm_note {
    direction: rtl !important;
    text-align: right !important;
}

/* Consent checkbox labels - specific targeting */
.frm_forms .frm_checkbox label,
.frm_forms .frm_radio label,
.frm_form_field .frm_checkbox label,
.frm_form_field .frm_radio label {
    text-align: right !important;
    direction: rtl !important;
    padding-right: 25px !important;
    padding-left: 0 !important;
}

/* Only force inline-block for visible checkbox/radio labels */
.frm_forms .frm_checkbox label:not(.frm_screen_reader),
.frm_forms .frm_radio label:not(.frm_screen_reader) {
    display: inline-block !important;
}

/* ========================================
   CHECKBOXES & RADIO BUTTONS
======================================== */

.frm_forms .frm_checkbox,
.frm_forms .frm_radio,
.frm_form_field .frm_checkbox,
.frm_form_field .frm_radio {
    direction: rtl !important;
    text-align: right !important;
}

/* Position checkbox/radio on the right */
.frm_forms .frm_checkbox input[type="checkbox"],
.frm_forms .frm_radio input[type="radio"],
.frm_form_field input[type="checkbox"],
.frm_form_field input[type="radio"] {
    float: right !important;
    margin-right: 0 !important;
    margin-left: 10px !important;
    position: relative !important;
    right: -25px !important;
    left: auto !important;
}

/* ========================================
   BUTTONS & SUBMIT
======================================== */

.frm_forms .frm_submit,
.frm_forms .frm_button_submit,
.frm_forms button,
.frm_forms input[type="submit"],
.frm_forms input[type="button"],
form.frm-show-form button,
form.frm-show-form input[type="submit"] {
    direction: rtl !important;
}

/* Button container alignment */
.frm_forms .frm_submit {
    text-align: center !important;
}

/* Multi-page navigation buttons */
.frm_forms .frm_page_nav,
.frm_forms .frm_rootline {
    direction: rtl !important;
}

.frm_forms .frm_prev_page {
    float: right !important;
    margin-right: 0 !important;
    margin-left: 10px !important;
}

.frm_forms .frm_next_page {
    float: left !important;
    margin-left: 0 !important;
    margin-right: 10px !important;
}

/* ========================================
   ERROR & SUCCESS MESSAGES
======================================== */

.frm_forms .frm_error,
.frm_forms .frm_error_style,
.frm_forms .frm_message,
.frm_forms .frm_success_msg,
.frm_forms .frm_error_message,
.frm_form_field .frm_error,
form.frm-show-form .frm_error,
form.frm-show-form .frm_message {
    direction: rtl !important;
    text-align: right !important;
}

/* ========================================
   DROPDOWNS & SELECT FIELDS
======================================== */

.frm_forms select,
.frm_forms .frm_opt_container,
form.frm-show-form select {
    direction: rtl !important;
    text-align: right !important;
}

/* Chosen/Select2 dropdowns */
.frm_forms .chosen-container,
.frm_forms .select2-container {
    direction: rtl !important;
}

.frm_forms .chosen-container .chosen-single,
.frm_forms .select2-selection {
    text-align: right !important;
}

/* ========================================
   FILE UPLOAD FIELDS
======================================== */

.frm_forms .frm_dropzone,
.frm_forms .dz-message,
.frm_form_field .frm_file_container {
    direction: rtl !important;
    text-align: center !important;
}

/* ========================================
   DATE & TIME FIELDS
======================================== */

.frm_forms .frm_date_field,
.frm_forms .frm_time_select,
.frm_forms input[type="date"],
.frm_forms input[type="time"] {
    direction: rtl !important;
    text-align: right !important;
}

/* Flatpickr calendar */
.flatpickr-calendar {
    direction: rtl !important;
}

/* ========================================
   ADDRESS FIELDS
======================================== */

.frm_forms .frm_combo_inputs_container,
.frm_form_field .frm_address_field {
    direction: rtl !important;
}

.frm_forms .frm_combo_inputs_container input,
.frm_forms .frm_combo_inputs_container select {
    text-align: right !important;
}

/* ========================================
   GRID & LAYOUT
======================================== */

.frm_forms .frm_grid,
.frm_forms .frm_grid_container {
    direction: rtl !important;
}

.frm_forms .frm_form_field.frm_left_container,
.frm_forms .frm_form_field.frm_right_container,
.frm_forms .frm_form_field.frm_first,
.frm_forms .frm_form_field.frm_last {
    float: right !important;
}

/* ========================================
   REPEATER FIELDS
======================================== */

.frm_forms .frm_repeat_sec,
.frm_forms .frm_repeat_grid,
.frm_forms .frm_repeat_buttons {
    direction: rtl !important;
    text-align: right !important;
}

/* ========================================
   ICONS & VISUAL ELEMENTS
======================================== */

.frm_forms .frm_icon_font,
.frm_forms .frm_trigger {
    margin-left: 5px !important;
    margin-right: 0 !important;
}

.frm_forms .frm_required {
    margin-left: 3px !important;
    margin-right: 0 !important;
}

/* ========================================
   STAR RATING
======================================== */

.frm_forms .frm-star-group {
    direction: rtl !important;
}

.frm_forms .frm-star-group input[type=radio] {
    float: right !important;
}

/* ========================================
   SLIDER FIELDS
======================================== */

.frm_forms .frm_slider_field {
    direction: ltr !important; /* Sliders work better LTR */
}

/* ========================================
   TOGGLE SWITCHES
======================================== */

.frm_forms .frm_switch_block {
    direction: rtl !important;
}

/* ========================================
   LOOKUP FIELDS
======================================== */

.frm_forms .frm_lookup_field,
.frm_forms .frm_lookup_container {
    direction: rtl !important;
    text-align: right !important;
}

/* ========================================
   CREDIT CARD FIELDS
======================================== */

.frm_forms .frm_cc_field,
.frm_forms .frm_cc_number,
.frm_forms .frm_cc_cvc,
.frm_forms .frm_cc_exp {
    direction: rtl !important;
    text-align: right !important;
}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 768px) {
    .frm_forms .frm_form_field,
    .frm_forms .frm_form_field.frm_left_container,
    .frm_forms .frm_form_field.frm_right_container {
        float: none !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
}

/* ========================================
   FORCE RTL ON SPECIFIC DIVI INTEGRATION
======================================== */

.et_pb_module .frm_forms,
.et_pb_code .frm_forms,
.et_pb_text .frm_forms {
    direction: rtl !important;
}

/* ========================================
   VIEWS & ENTRY DISPLAY
======================================== */

.frm_forms .frm_view_entry,
.with_frm_style .frm_view_entry {
    direction: rtl !important;
    text-align: right !important;
}

/* ========================================
   INLINE LABELS
======================================== */

.frm_forms .frm_inline_container label {
    text-align: right !important;
    padding-right: 10px !important;
    padding-left: 0 !important;
}

/* ========================================
   SCREEN READER TEXT (KEEP HIDDEN & ACCESSIBLE)
======================================== */

.frm_forms .frm_screen_reader {
    direction: rtl !important;
    /* Keep labels hidden when using placeholder-only mode */
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}
