/**
 * HULLAA — Arabic login / register direction fixes
 * Applies only when the document is RTL / Arabic.
 * Keeps email, phone and numeric values in their natural LTR order.
 */

html[dir="rtl"] .digits_login_form,
html[lang^="ar"] .digits_login_form,
body.rtl .digits_login_form,
html[dir="rtl"] .pls-customer-login-register,
html[lang^="ar"] .pls-customer-login-register,
body.rtl .pls-customer-login-register {
    direction: rtl !important;
}

/* -------- Digits login/register -------- */
html[dir="rtl"] .digits_login_form .dig_ma-box,
html[lang^="ar"] .digits_login_form .dig_ma-box,
body.rtl .digits_login_form .dig_ma-box,
html[dir="rtl"] .digits_login_form .dig-content,
html[lang^="ar"] .digits_login_form .dig-content,
body.rtl .digits_login_form .dig-content,
html[dir="rtl"] .digits_login_form .digits_bx_cred_frm_container,
html[lang^="ar"] .digits_login_form .digits_bx_cred_frm_container,
body.rtl .digits_login_form .digits_bx_cred_frm_container,
html[dir="rtl"] .digits_login_form .digits_bx_cred_frm,
html[lang^="ar"] .digits_login_form .digits_bx_cred_frm,
body.rtl .digits_login_form .digits_bx_cred_frm,
html[dir="rtl"] .digits_login_form .dig_bx_cnt_mdl,
html[lang^="ar"] .digits_login_form .dig_bx_cnt_mdl,
body.rtl .digits_login_form .dig_bx_cnt_mdl,
html[dir="rtl"] .digits_login_form form,
html[lang^="ar"] .digits_login_form form,
body.rtl .digits_login_form form {
    direction: rtl !important;
    text-align: right !important;
}

html[dir="rtl"] .digits_login_form .minput label,
html[lang^="ar"] .digits_login_form .minput label,
body.rtl .digits_login_form .minput label,
html[dir="rtl"] .digits_login_form .dig_sml_box_msg,
html[lang^="ar"] .digits_login_form .dig_sml_box_msg,
body.rtl .digits_login_form .dig_sml_box_msg,
html[dir="rtl"] .digits_login_form .dig_sml_box_msg_head,
html[lang^="ar"] .digits_login_form .dig_sml_box_msg_head,
body.rtl .digits_login_form .dig_sml_box_msg_head {
    direction: rtl !important;
    text-align: right !important;
    unicode-bidi: plaintext;
}

/* Keep the page title and the sign-up prompt centered, while their text flow stays Arabic. */
html[dir="rtl"] .digits_login_form .dig-box-login-title,
html[lang^="ar"] .digits_login_form .dig-box-login-title,
body.rtl .digits_login_form .dig-box-login-title,
html[dir="rtl"] .digits_login_form .signdesc,
html[lang^="ar"] .digits_login_form .signdesc,
body.rtl .digits_login_form .signdesc {
    direction: rtl !important;
    text-align: center !important;
    unicode-bidi: plaintext;
}

/* Arabic placeholders stay on the right. */
html[dir="rtl"] .digits_login_form input::placeholder,
html[lang^="ar"] .digits_login_form input::placeholder,
body.rtl .digits_login_form input::placeholder,
html[dir="rtl"] .digits_login_form textarea::placeholder,
html[lang^="ar"] .digits_login_form textarea::placeholder,
body.rtl .digits_login_form textarea::placeholder {
    direction: rtl !important;
    text-align: right !important;
}

/* Normal text fields follow Arabic direction. */
html[dir="rtl"] .digits_login_form .digits-input-wrapper > input:not([type="email"]):not([type="tel"]):not([type="number"]),
html[lang^="ar"] .digits_login_form .digits-input-wrapper > input:not([type="email"]):not([type="tel"]):not([type="number"]),
body.rtl .digits_login_form .digits-input-wrapper > input:not([type="email"]):not([type="tel"]):not([type="number"]) {
    text-align: right !important;
}

/* Email/mobile/OTP values keep correct character order while staying visually tidy. */
html[dir="rtl"] .digits_login_form input[type="email"],
html[lang^="ar"] .digits_login_form input[type="email"],
body.rtl .digits_login_form input[type="email"],
html[dir="rtl"] .digits_login_form input[type="tel"],
html[lang^="ar"] .digits_login_form input[type="tel"],
body.rtl .digits_login_form input[type="tel"],
html[dir="rtl"] .digits_login_form input[type="number"],
html[lang^="ar"] .digits_login_form input[type="number"],
body.rtl .digits_login_form input[type="number"],
html[dir="rtl"] .digits_login_form .dig-mobmail,
html[lang^="ar"] .digits_login_form .dig-mobmail,
body.rtl .digits_login_form .dig-mobmail,
html[dir="rtl"] .digits_login_form .mobile_field,
html[lang^="ar"] .digits_login_form .mobile_field,
body.rtl .digits_login_form .mobile_field,
html[dir="rtl"] .digits_login_form .countrycode,
html[lang^="ar"] .digits_login_form .countrycode,
body.rtl .digits_login_form .countrycode,
html[dir="rtl"] .digits_login_form input[autocomplete="one-time-code"],
html[lang^="ar"] .digits_login_form input[autocomplete="one-time-code"],
body.rtl .digits_login_form input[autocomplete="one-time-code"] {
    direction: ltr !important;
    unicode-bidi: plaintext;
}

/* Remember me: checkbox and text sit together on the right, not on opposite ends. */
html[dir="rtl"] .digits_login_form .dig_login_rembe,
html[lang^="ar"] .digits_login_form .dig_login_rembe,
body.rtl .digits_login_form .dig_login_rembe {
    direction: rtl !important;
    text-align: right !important;
}

html[dir="rtl"] .digits_login_form .dig_login_rembe label,
html[lang^="ar"] .digits_login_form .dig_login_rembe label,
body.rtl .digits_login_form .dig_login_rembe label,
html[dir="rtl"] .digits_login_form .dig_login_rembe .dig_input_wrapper,
html[lang^="ar"] .digits_login_form .dig_login_rembe .dig_input_wrapper,
body.rtl .digits_login_form .dig_login_rembe .dig_input_wrapper {
    direction: rtl !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 9px !important;
    width: fit-content !important;
    max-width: 100%;
    margin-inline-start: 0 !important;
    margin-inline-end: auto !important;
    text-align: right !important;
}

html[dir="rtl"] .digits_login_form .dig_login_rembe input[type="checkbox"],
html[lang^="ar"] .digits_login_form .dig_login_rembe input[type="checkbox"],
body.rtl .digits_login_form .dig_login_rembe input[type="checkbox"] {
    flex: 0 0 auto;
    margin: 0 !important;
}

/* Buttons stay centered even though the surrounding form is RTL. */
html[dir="rtl"] .digits_login_form button,
html[lang^="ar"] .digits_login_form button,
body.rtl .digits_login_form button,
html[dir="rtl"] .digits_login_form .button,
html[lang^="ar"] .digits_login_form .button,
body.rtl .digits_login_form .button,
html[dir="rtl"] .digits_login_form .signupbutton,
html[lang^="ar"] .digits_login_form .signupbutton,
body.rtl .digits_login_form .signupbutton,
html[dir="rtl"] .digits_login_form .loginviasms,
html[lang^="ar"] .digits_login_form .loginviasms,
body.rtl .digits_login_form .loginviasms {
    direction: rtl !important;
    text-align: center !important;
}

/* Sign-up prompt remains readable in Arabic and centered as a unit. */
html[dir="rtl"] .digits_login_form .signupbutton,
html[lang^="ar"] .digits_login_form .signupbutton,
body.rtl .digits_login_form .signupbutton {
    unicode-bidi: plaintext;
}

/* -------- WooCommerce / Anvogue account login -------- */
html[dir="rtl"] .pls-customer-login-register .pls-wc-login-form,
html[lang^="ar"] .pls-customer-login-register .pls-wc-login-form,
body.rtl .pls-customer-login-register .pls-wc-login-form,
html[dir="rtl"] .pls-customer-login-register .pls-wc-register-form,
html[lang^="ar"] .pls-customer-login-register .pls-wc-register-form,
body.rtl .pls-customer-login-register .pls-wc-register-form,
html[dir="rtl"] .pls-customer-login-register .pls-wc-login-register-info,
html[lang^="ar"] .pls-customer-login-register .pls-wc-login-register-info,
body.rtl .pls-customer-login-register .pls-wc-login-register-info,
html[dir="rtl"] .pls-customer-login-register form,
html[lang^="ar"] .pls-customer-login-register form,
body.rtl .pls-customer-login-register form {
    direction: rtl !important;
    text-align: right !important;
}

html[dir="rtl"] .pls-customer-login-register input::placeholder,
html[lang^="ar"] .pls-customer-login-register input::placeholder,
body.rtl .pls-customer-login-register input::placeholder {
    direction: rtl !important;
    text-align: right !important;
}

html[dir="rtl"] .pls-customer-login-register input[type="email"],
html[lang^="ar"] .pls-customer-login-register input[type="email"],
body.rtl .pls-customer-login-register input[type="email"],
html[dir="rtl"] .pls-customer-login-register input[autocomplete="username"],
html[lang^="ar"] .pls-customer-login-register input[autocomplete="username"],
body.rtl .pls-customer-login-register input[autocomplete="username"] {
    unicode-bidi: plaintext;
}

html[dir="rtl"] .woocommerce .form-row.woocommerce-rememberme-lost_password,
html[lang^="ar"] .woocommerce .form-row.woocommerce-rememberme-lost_password,
body.rtl .woocommerce .form-row.woocommerce-rememberme-lost_password {
    direction: rtl !important;
}

html[dir="rtl"] .woocommerce-form-login__rememberme,
html[lang^="ar"] .woocommerce-form-login__rememberme,
body.rtl .woocommerce-form-login__rememberme {
    direction: rtl !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

html[dir="rtl"] .woocommerce-form-login__rememberme input,
html[lang^="ar"] .woocommerce-form-login__rememberme input,
body.rtl .woocommerce-form-login__rememberme input {
    margin: 0 !important;
}

html[dir="rtl"] .pls-customer-login-register button,
html[lang^="ar"] .pls-customer-login-register button,
body.rtl .pls-customer-login-register button {
    text-align: center !important;
}

@media (max-width: 575px) {
    html[dir="rtl"] .digits_login_form .dig_ma-box,
    html[lang^="ar"] .digits_login_form .dig_ma-box,
    body.rtl .digits_login_form .dig_ma-box {
        max-width: 100% !important;
    }
}
