/* Universal Login & Register — frontend styles. All themable values are CSS custom
 * properties (var(--ulr-*)) injected inline by ULR_Assets from the Appearance settings.
 * No external requests of any kind happen from this stylesheet. */

.ulr-form,
.ulr-modal {
        --ulr-font-size: 15px;
        --ulr-font-weight: 400;
        --ulr-line-height: 1.6;
        --ulr-text-color: #1e1e1e;
        --ulr-label-color: #333333;
        --ulr-link-color: #2563eb;
        --ulr-link-hover-color: #1d4ed8;
        --ulr-form-bg: #ffffff;
        --ulr-link-decoration: underline;
        --ulr-link-hover-decoration: underline;
        --ulr-border-color: #d1d5db;
        --ulr-border-width: 1px;
        --ulr-form-radius: 12px;
        --ulr-item-gap: 16px;
        --ulr-form-max-width: 420px;
        --ulr-font-family: inherit;
        --ulr-form-padding: 24px;
        --ulr-form-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        --ulr-border-style: solid;
        --ulr-button-padding-x: 20px;
        --ulr-label-gap: 6px;
        /* Resend button (button-mode OTP resend) — defaults mirror the pre-1.4.2 look,
         * which was built from the OTP-box / input variables. */
        /* OTP identifier box ("box" target style). Defaults reproduce the current
         * chip design; override the tokens from custom CSS without edits here. */
        --ulr-otp-target-bg: #F5F5F5;
        --ulr-otp-target-line: #616161;
        --ulr-otp-target-edit-color: #616161;
        --ulr-otp-target-value-color: #212121;
}

/* The browser's own [hidden] { display: none } is a UA-stylesheet rule, so ANY of our own
 * `display` declarations on that same element — .ulr-btn's `display: inline-flex`,
 * .ulr-field's `display: flex`, .ulr-country-select's `display: flex`, .ulr-step's flex
 * layout, etc. — silently wins over it despite matching specificity (author styles always
 * beat UA styles at equal specificity). That left several JS-driven `el.hidden = true`
 * toggles (the OTP step's "switch to password" button, the register step's password field,
 * step visibility itself, ...) fully sanitized/computed correctly but still visually shown.
 * One `!important` rule, scoped to this plugin's own containers, guarantees [hidden] always
 * actually hides — this must come before every other rule below that might set `display`. */
:where(.ulr-form, .ulr-modal, .ulr-standalone-login) [hidden] {
        display: none !important;
}

/* Reset the theme's/browser's default styling for form controls and links so the
 * Appearance settings are the only thing that ever determines how these look. Uses
 * :where() so the reset itself carries zero specificity — every actual component rule
 * below (.ulr-input, .ulr-btn, ...) still wins regardless of selector order. Checkboxes
 * and radios keep their native appearance (no custom replacement graphic is drawn for
 * them), everything else loses browser/theme chrome entirely. */
:where(.ulr-form, .ulr-modal) button,
:where(.ulr-form, .ulr-modal) input,
:where(.ulr-form, .ulr-modal) select,
:where(.ulr-form, .ulr-modal) textarea,
:where(.ulr-form, .ulr-modal) a {
        margin: 0;
        padding: 0;
        border: 0;
        background: none;
        color: inherit;
        font: inherit;
        line-height: inherit;
        text-decoration: none;
        border-radius: 0;
        box-shadow: none;
        outline: none;
}

:where(.ulr-form, .ulr-modal) input:not([type="checkbox"]):not([type="radio"]),
:where(.ulr-form, .ulr-modal) select,
:where(.ulr-form, .ulr-modal) textarea,
:where(.ulr-form, .ulr-modal) button {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
}

:where(.ulr-form, .ulr-modal) button,
:where(.ulr-form, .ulr-modal) a {
        cursor: pointer;
}

:where(.ulr-form, .ulr-modal) ul,
:where(.ulr-form, .ulr-modal) ol {
        list-style: none;
        margin: 0;
        padding: 0;
}

:where(.ulr-form, .ulr-modal) h1,
:where(.ulr-form, .ulr-modal) h2,
:where(.ulr-form, .ulr-modal) h3,
:where(.ulr-form, .ulr-modal) p {
        margin: 0;
}

.ulr-form {
        box-sizing: border-box;
        max-width: var(--ulr-form-max-width);
        margin: 0 auto;
        padding: var(--ulr-form-padding);
        background: var(--ulr-form-bg);
        border-radius: var(--ulr-form-radius);
        border: var(--ulr-border-width) var(--ulr-border-style) var(--ulr-border-color);
        box-shadow: var(--ulr-form-shadow);
        font-family: var(--ulr-font-family);
        font-size: var(--ulr-font-size);
        font-weight: var(--ulr-font-weight);
        line-height: var(--ulr-line-height);
        color: var(--ulr-text-color);
}

/* Controls, buttons, checkboxes, OTP boxes and toasts are Zenith Form Style's (a required
 * plugin): they take the site's tokens from there and nothing here restyles them. ULR keeps
 * the layout — its flex gaps space the fields, so Zenith's own field margins are zeroed. */
.ulr-form.zt-form {
        --zt-label-gap: 0px;
        --zt-field-gap: 0px;
}

/* Zenith writes component margins through tokens; ULR's flex gaps already do
 * that spacing, so neutralize the residual element margins here. .zt-field's
 * own display:flow-root would also kill ULR's label/control gap, so the flex
 * column layout is reasserted at higher specificity. */
.ulr-form .ulr-field.zt-field {
        display: flex;
        flex-direction: column;
        gap: var(--ulr-label-gap);
        margin-block-end: 0;
}

.ulr-form .zt-field:last-child {
        margin-block-end: 0;
}

.ulr-form .ulr-label.zt-label {
        margin-block-end: 0;
}

.ulr-form .ulr-field .zt-help,
.ulr-form .ulr-field .zt-error-text {
        margin-block-start: 0;
}

.ulr-form *,
.ulr-modal * {
        box-sizing: border-box;
}

/* Form header: optional icon + title + subtitle, stacked and centered above the steps.
 * Spacing between the three is each element's own bottom margin (not a shared flex `gap`)
 * so every element's spacing is independently configurable. */
.ulr-form-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
}

.ulr-form-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: var(--ulr-header-icon-size);
        height: var(--ulr-header-icon-size);
        margin-bottom: var(--ulr-header-icon-margin);
        color: var(--ulr-link-color);
}

.ulr-form-icon svg {
        width: 100%;
        height: 100%;
}

/* Uploaded-image variant (media library): height comes from --ulr-header-icon-size, width
 * follows the image's own aspect ratio — a brand logo never gets squashed into a square. */
.ulr-form-icon.is-image {
        width: auto;
        max-width: 100%;
}

.ulr-form-icon.is-image img {
        display: block;
        height: var(--ulr-header-icon-size);
        width: auto;
        max-width: 100%;
}

.ulr-form-title {
        margin: 0 0 var(--ulr-header-title-margin);
        font-size: var(--ulr-header-title-font-size);
        font-weight: var(--ulr-header-title-font-weight);
        color: var(--ulr-header-title-color);
}

.ulr-form-subtitle {
        margin: 0 0 var(--ulr-header-subtitle-margin);
        font-size: var(--ulr-header-subtitle-font-size);
        font-weight: var(--ulr-header-subtitle-font-weight);
        color: var(--ulr-header-subtitle-color);
}

.ulr-step-inner {
        display: flex;
        flex-direction: column;
        gap: var(--ulr-item-gap);
}

/* Step entrance animation (UlrForm.prototype.showStep()) — a quick fade + slide rather than
 * the abrupt instant swap [hidden] alone gives, so moving between steps (e.g. arriving at the
 * OTP step after the code is sent) reads as a deliberate transition. */
.ulr-step-entering {
        animation: ulr-step-in 0.25s ease;
}

@keyframes ulr-step-in {
        from {
                opacity: 0;
                transform: translateY(6px);
        }
        to {
                opacity: 1;
                transform: translateY(0);
        }
}

@media (prefers-reduced-motion: reduce) {
        .ulr-step-entering {
                animation: none;
        }
}

/* Busy-state spinner (UlrForm.prototype.setBusy()) — a small rotating ring before the label,
 * so a pending request (send OTP, verify, ...) reads as "working", not frozen. */
.ulr-btn-busy:not(.zt-button):not(.zt-loading) {
        position: relative;
        padding-inline-start: calc(var(--ulr-button-padding-x) + 20px);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
}

.ulr-btn.ulr-btn-busy:not(.zt-button):not(.zt-loading)::before {
        content: "";
        width: 14px;
        height: 14px;
        border: 2px solid currentColor;
        border-inline-start-color: transparent;
        border-radius: 50%;
        animation: ulr-spin 0.6s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
        .ulr-btn-busy::before {
                animation: none;
        }
}

.ulr-field {
        display: flex;
        flex-direction: column;
        gap: var(--ulr-label-gap);
}

.ulr-fields-grid {
        display: flex;
        flex-wrap: wrap;
        gap: var(--ulr-item-gap);
}

.ulr-field-full {
        flex: 1 1 100%;
}

.ulr-field-half {
        flex: 1 1 calc(50% - var(--ulr-item-gap) / 2);
        min-width: 160px;
}

.ulr-required {
        color: var(--zt-required-color);
}

/* Input with a leading icon: the icon sits inside the field's start padding. Uses logical
 * properties (inset-inline-start / padding-inline-start) so it flips correctly in RTL. */
.ulr-input-wrap {
        position: relative;
        display: block;
        width: 100%;
}

.ulr-input-wrap.has-icon .ulr-input {
        --zt-c-pad-start: 40px; /* Zenith channel: widen the start padding around the icon */
}

.ulr-input-icon {
        position: absolute;
        inset-inline-start: 12px;
        top: 50%;
        transform: translateY(-50%);
        display: inline-flex;
        width: 18px;
        height: 18px;
        color: var(--zt-placeholder);
        pointer-events: none;
}

.ulr-input-icon svg {
        width: 100%;
        height: 100%;
}

.ulr-input-icon img {
        width: 100%;
        height: 100%;
        object-fit: contain;
}

.ulr-identifier-row {
        display: flex;
        gap: 8px;
}

.ulr-identifier-row .ulr-input,
.ulr-identifier-row .ulr-input-wrap {
        flex: 1;
}

.ulr-country-select {
        display: flex;
        align-items: center;
        gap: 4px;
        height: var(--zt-control-height);
        padding: 0 10px;
        background: var(--zt-bg);
        border: var(--zt-border-width) solid var(--zt-border);
        border-radius: var(--zt-radius);
        cursor: pointer;
        color: var(--zt-text);
}

.ulr-country-dropdown {
        position: absolute;
        z-index: 20;
        margin-top: calc(var(--zt-control-height) + 8px);
        max-height: 260px;
        overflow-y: auto;
        background: var(--zt-bg);
        border: var(--zt-border-width) solid var(--zt-dropdown-border);
        border-radius: var(--zt-radius);
        box-shadow: var(--zt-dropdown-shadow);
        min-width: 220px;
}

.ulr-country-dropdown input[type="search"] {
        width: 100%;
        height: 36px;
        padding: 0 10px;
        border: none;
        border-bottom: 1px solid var(--zt-border);
}

.ulr-country-option {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 10px;
        cursor: pointer;
        font-size: 0.92em;
}

.ulr-country-option:hover,
.ulr-country-option.is-active {
        background: var(--zt-accent-soft);
}

.ulr-identifier-group[data-ulr-has-country] .ulr-country-select:not([hidden]) {
        display: flex;
}

/* Primary buttons are .zt-button (Zenith Form Style); .ulr-btn only lays buttons out. */
.ulr-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        font-family: inherit;
        cursor: pointer;
}

.ulr-btn-link {
        height: auto;
        padding: 4px 2px;
        border: none;
        background: transparent;
        color: var(--ulr-link-color);
        font-size: 1em;
        font-weight: 500;
        text-decoration: var(--ulr-link-decoration);
}
.ulr-btn-link:disabled {
        cursor: default;
        opacity: 1;
        color: var(--ulr-text-color,#212121);
}

.ulr-btn-link:hover:not(:disabled) {
        background: transparent;
        color: var(--ulr-link-hover-color);
        text-decoration: var(--ulr-link-hover-decoration);
}

.ulr-reset-link {
        text-decoration: var(--ulr-link-decoration);
}

.ulr-reset-link:hover {
        color: var(--ulr-link-hover-color);
        text-decoration: var(--ulr-link-hover-decoration);
}

.ulr-back {
        align-self: flex-start;
}

.ulr-btn-icon {
        display: inline-flex;
        width: 16px;
        height: 16px;
        flex: none;
}

.ulr-btn-icon svg {
        width: 100%;
        height: 100%;
}

.ulr-btn-icon img {
        width: 100%;
        height: 100%;
        object-fit: contain;
}

/* OTP step's "Back" button: a two-line prompt ("Change Mobile Number" / "Is your mobile
 * number incorrect?") instead of a plain "Back" label — text is filled in by JS once the
 * identifier type (phone/email) is known. */
.ulr-change-identifier,
.ulr-change-identifier:hover {
        height: auto;
        display: flex;
        justify-content: space-between;
        align-items: center;
        color: var(--ulr-text-color);
        font-size: 14px;
        line-height: 22px;
        width: 100%;
}


.ulr-change-identifier-text {
        display: flex;
        gap: 8px;
        align-items: center
}

.ulr-error {
        margin: 0;
        color: var(--zt-error);
        font-size: 0.85em;
}

.ulr-step-desc {
        margin: 0;
        color: var(--ulr-text-color);
        text-align: center;
}
.ulr-step-desc strong{
        direction: ltr;
        display: inline-block;
        color: var(--ulr-link-color)
}

/* One box per digit (UlrForm.prototype.initOtpBoxes()): Zenith Form Style's OTP component
 * (.zt-otp / .zt-otp__box) draws them; the real value lives in the hidden #ulr-otp-code. */
.ulr-otp-boxes {
        justify-content: center;
}

.ulr-resend-row {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
}

.ulr-countdown {
        color: inherit;
        font-size: 14px;
        font-weight: 400;
}

/* 'button' resend style (content.otp_resend_style): code boxes and a compact icon button
 * share one row; the countdown ticks underneath the button itself. The row is forced LTR to
 * match the boxes' own direction, so the button always sits at the row's right edge. */
.ulr-otp-boxes-row {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: calc(var(--zt-otp-gap) + 4px);
        direction: ltr;
}

.ulr-otp-boxes-row .ulr-otp-boxes {
        /* Button mode only: keeps the classic full-width link-mode boxes row
         * untouched while pushing the boxes away from the resend button. */
        margin-inline-end: 10px;
        flex: 0 1 auto;
        min-width: 0;
}

.ulr-resend-block {
        /* Same share of the row as a digit box, so it shrinks with them on a narrow phone. */
        inline-size: var(--zt-otp-resend-size, 60px);
        min-width: 36px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        flex: 0 1 var(--zt-otp-resend-size, 60px);
}

/* The resend button is Zenith Form Style's .zt-otp-resend (a box the size of a digit). */
.ulr-resend-block .ulr-countdown {
        font-size: 14px;
        font-weight: 400;
        line-height: 1.6;
        white-space: nowrap;
}

/* Finished cooldown: the timer stays visible showing 00:00 (button mode only),
 * muted so it reads as "elapsed" rather than actively counting. */
.ulr-resend-block .ulr-countdown.is-done {
        opacity: 0.55;
}

/* 'box' OTP-target style (content.otp_target_style): the destination identifier sits in its
 * own bordered row with an inline "edit" button (which jumps back to the identifier step).
 * DOM order [edit][sep][value] renders edit-at-start / number-at-end in RTL — matching the
 * classic "edit number | 09xx…" mock — and mirrors naturally in LTR. */
.ulr-otp-target-box {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 18px;
        padding: 16px 18px;
        background: var(--ulr-otp-target-bg);
        border-radius: var(--zt-radius);
        max-width: 314px;
        margin-inline: auto;
        width: 100%;
}

.ulr-otp-target-edit {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        flex: none;
        cursor: pointer;
        color: var(--ulr-otp-target-edit-color);
        font-size: inherit;
        font-weight: 400;
}

.ulr-otp-target-edit svg {
        width: 16px;
        height: 16px;
        flex: none;
}

.ulr-otp-target-sep {
        width: 1px;
        align-self: stretch;
        background: var(--ulr-otp-target-line);
        flex: none;
}

.ulr-otp-target-value {
        flex: 1;
        min-width: 0;
        direction: ltr;
        text-align: start;
        color: var(--ulr-otp-target-value-color);
        font-weight: 500;
        overflow-wrap: anywhere;
}

.ulr-hp-wrap {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        overflow: hidden !important;
        clip: rect(0 0 0 0) !important;
        white-space: nowrap !important;
}

.ulr-terms {
        font-size: 0.85em;
        color: var(--ulr-label-color);
}

.ulr-checkbox {
        display: flex;
        align-items: center;
        gap: var(--zt-option-gap);
        cursor: pointer;
        user-select: none;
}

.ulr-terms a {
        color: var(--ulr-link-color);
        text-decoration: var(--ulr-link-decoration);
}

.ulr-terms a:hover {
        color: var(--ulr-link-hover-color);
        text-decoration: var(--ulr-link-hover-decoration);
}

.ulr-radio-group,
.ulr-checkbox-group {
        display: flex;
        flex-direction: column;
        gap: 6px;
}

.ulr-radio,
.ulr-checkbox {
        display: flex;
        align-items: center;
        gap: 4px;
        font-weight: 400;
        cursor: pointer;
}

.ulr-field-desc {
        margin: 0;
        font-size: 0.8em;
        color: var(--ulr-label-color);
}

.ulr-notice {
        color: var(--ulr-text-color);
}

.ulr-modal-trigger {
        cursor: pointer;
}

/* Modal */
.ulr-modal-overlay {
        position: fixed;
        inset: 0;
        z-index: 100000;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--ulr-modal-overlay-color);
        padding: 20px;
}

.ulr-modal-overlay[hidden] {
        display: none;
}

/* Fade in/out (ulr-public.js toggles .is-open around `hidden`). */
.ulr-modal-overlay {
        -webkit-backdrop-filter: blur(var(--ulr-modal-overlay-blur, 0px));
        backdrop-filter: blur(var(--ulr-modal-overlay-blur, 0px));
        opacity: 0;
        transition: opacity .25s ease;
}
.ulr-modal-overlay.is-open {
        opacity: 1;
}
.ulr-modal-overlay .ulr-modal {
        transform: translateY(12px) scale(.98);
        transition: transform .25s ease;
}
.ulr-modal-overlay.is-open .ulr-modal {
        transform: none;
}
@media (prefers-reduced-motion: reduce) {
        .ulr-modal-overlay, .ulr-modal-overlay .ulr-modal { transition: none; }
}

/* With a side panel (filter ulr_modal_aside): form card and panel side by side.
 * Every measure is a variable, so a theme matches its design without overriding rules. */
.ulr-modal.ulr-modal--split {
        display: flex;
        align-items: center;
        gap: var(--ulr-modal-split-gap, 48px);
        width: auto;
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 40px);
        padding-block: var(--ulr-modal-split-padding-block, 20px);
        padding-inline: var(--ulr-modal-split-padding-start, 48px) var(--ulr-modal-split-padding-end, 20px);
        border-radius: var(--ulr-modal-split-radius, 32px);
        background: var(--ulr-modal-split-bg, var(--ulr-form-bg));
}
.ulr-modal--split .ulr-modal-body {
        order: 1;
        flex: none;
        width: var(--ulr-modal-card-width, 416px);
}
.ulr-modal--split .ulr-modal-body .ulr-form {
        padding: var(--ulr-modal-card-padding, 36px);
        border-radius: var(--ulr-modal-card-radius, 20px);
        background: var(--ulr-modal-card-bg, var(--ulr-form-bg));
}
.ulr-modal-aside {
        order: 2;
        position: relative;
        flex: none;
        width: var(--ulr-modal-aside-width, 560px);
        height: var(--ulr-modal-aside-height, 600px);
        max-height: calc(100vh - 80px);
        border-radius: var(--ulr-modal-aside-radius, 24px);
        overflow: hidden;
}
.ulr-modal-aside img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
}
.ulr-modal--split .ulr-modal-close {
        top: var(--ulr-modal-close-top, 24px);
        inset-inline-end: auto;
        inset-inline-start: var(--ulr-modal-close-start, 24px);
}
.ulr-modal-back {
        display: none;
}
@media (max-width: 960px) {
        .ulr-modal-aside { width: var(--ulr-modal-aside-width-md, 360px); }
}
/* Phones: the whole screen — back bar, form, then the panel. */
@media (max-width: 782px) {
        .ulr-modal-overlay:has(.ulr-modal--split) {
                align-items: stretch;
                padding: 0;
        }
        .ulr-modal.ulr-modal--split {
                flex-direction: column;
                align-items: stretch;
                gap: 20px;
                width: 100%;
                max-width: none;
                max-height: none;
                height: 100%;
                padding: 0 16px 24px;
                border-radius: 0;
                background: var(--ulr-modal-mobile-bg, var(--ulr-form-bg));
                overflow-y: auto;
        }
        .ulr-modal--split .ulr-modal-close { display: none; }
        .ulr-modal--split .ulr-modal-back {
                position: sticky;
                top: 0;
                z-index: 2;
                display: flex;
                align-items: center;
                gap: 10px;
                flex: none;
                margin: 0 -16px;
                padding: 20px 16px;
                border: 0;
                border-bottom: .5px solid var(--ulr-modal-back-line, #BDBDBD);
                background: var(--ulr-modal-mobile-bg, var(--ulr-form-bg));
                color: var(--ulr-text-color);
                font: inherit;
                font-size: 14px;
                font-weight: 500;
                line-height: 1.6;
                cursor: pointer;
        }
        .ulr-modal-back-icon { display: inline-flex; font-size: 20px; line-height: 1; }
        .ulr-modal-back-icon svg { width: 24px; height: 24px; }
        .ulr-modal--split .ulr-modal-body {
                width: auto;
                margin-top: 31px;
        }
        .ulr-modal--split .ulr-modal-body .ulr-form { padding: var(--ulr-modal-card-padding-mobile, 16px 12px); }
        .ulr-modal-aside {
                width: auto;
                height: var(--ulr-modal-aside-height-mobile, 348px);
                max-height: none;
                border-radius: var(--ulr-modal-aside-radius-mobile, 20px);
        }
}

.ulr-modal {
        position: relative;
        width: 100%;
        max-width: calc(var(--ulr-form-max-width) + 48px);
        max-height: 90vh;
        overflow-y: auto;
        background: var(--ulr-form-bg);
        border-radius: var(--ulr-form-radius);
        padding: 8px;
}

.ulr-modal-close {
        position: absolute;
        top: 8px;
        inset-inline-end: 8px;
        width: 32px;
        height: 32px;
        border: none;
        background: transparent;
        font-size: 22px;
        line-height: 1;
        cursor: pointer;
        color: var(--ulr-text-color);
        z-index: 2;
}

.ulr-modal .ulr-form {
        border: none;
        max-width: none;
}

/* RTL / LTR: `start`/`end` follow the element's own `dir` automatically, so this single
 * rule covers both directions without needing separate [dir="rtl"]/[dir="ltr"] blocks. */
.ulr-form,
.ulr-modal {
        text-align: start;
}

/* Phone numbers, emails, and passwords are always Latin/numeric content, so their
 * typed text stays LTR even inside an RTL form — but the (often Persian/Arabic)
 * placeholder text should still read RTL. #ulr-identifier is included explicitly
 * since it's type="text" (it accepts either a phone or an email, so it can't use
 * type="tel"/"email" itself). */
.ulr-form[dir="rtl"] input[type="email"],
.ulr-form[dir="rtl"] input[type="tel"],
.ulr-form[dir="rtl"] input[type="password"],
.ulr-form[dir="rtl"] #ulr-identifier {
        direction: ltr;
        text-align: left;
}

.ulr-form[dir="rtl"] input[type="email"]::placeholder,
.ulr-form[dir="rtl"] input[type="tel"]::placeholder,
.ulr-form[dir="rtl"] input[type="password"]::placeholder,
.ulr-form[dir="rtl"] #ulr-identifier::placeholder {
        direction: rtl;
        text-align: right;
}

/* When such an LTR-forced input carries a leading icon, flip its wrapper to LTR too so the
 * icon and the input's start padding land on the same (left) side instead of opposite ones. */
.ulr-form[dir="rtl"] .ulr-input-wrap:has(#ulr-identifier),
.ulr-form[dir="rtl"] .ulr-input-wrap:has(input[type="email"]),
.ulr-form[dir="rtl"] .ulr-input-wrap:has(input[type="tel"]) {
        direction: ltr;
}

/* Mobile only. Everything above is the shared/desktop layout; these overrides tighten
 * spacing so the header fits a narrow screen. */
@media (max-width: 480px) {
        .ulr-field-half {
                flex: 1 1 100%;
        }
}

/* WooCommerce My Account takeover: our form is injected before the native login/register
 * markup via woocommerce_before_customer_login_form, then the native markup is hidden here
 * rather than overridden by template, so the toggle stays a single switch. The native
 * markup is a single <div class="u-columns col2-set" id="customer_login"> wrapping both
 * the login and register columns — that's the actual selector WooCommerce renders.
*
 * Two independent selectors hide it, since either one alone can fail on some themes:
 *  - the body class one requires the theme to actually call body_class() with filters
 *    applied (some fully custom headers skip this);
 *  - the sibling-combinator one requires our form and #customer_login to share a parent,
 *    which is true for WooCommerce's own unmodified my-account/form-login.php template,
 *    but not guaranteed if a theme overrides that template with extra wrapping markup.
 * With "registration on My Account" off, WooCommerce prints a bare <h2> + login form
 * (no #customer_login wrapper), so those are hidden as well. */
.ulr-wc-takeover #customer_login,
.ulr-form[data-ulr-context="auth"] ~ #customer_login,
.ulr-wc-takeover .woocommerce-form-login,
.ulr-form[data-ulr-context="auth"] ~ .woocommerce-form-login,
.ulr-form[data-ulr-context="auth"] ~ h2 {
        display: none;
}

/* Standalone login page (wp-login.php takeover): a full page we render ourselves,
 * site logo + our form only — see ULR_WPLogin::render_standalone_page(). */
.ulr-standalone-login {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        margin: 0;
        background: var(--ulr-standalone-bg, #f0f0f1);
}

.ulr-standalone-login-card {
        width: 100%;
        max-width: calc(var(--ulr-form-max-width, 420px) + 32px);
        padding: 16px;
        box-sizing: border-box;
}

.ulr-standalone-logo {
        text-align: center;
        margin-bottom: 20px;
}

.ulr-standalone-logo img {
        max-width: 100%;
        height: auto;
}

.ulr-standalone-site-name {
        font-size: 20px;
        font-weight: 700;
        text-decoration: none;
        color: var(--ulr-text-color, #1e1e1e);
}

.ulr-standalone-back {
        text-align: center;
        margin: 16px 0 0;
}

.ulr-standalone-back a {
        color: var(--ulr-link-color, #2563eb);
        text-decoration: none;
        font-size: 13px;
}

.ulr-standalone-back a:hover {
        color: var(--ulr-link-hover-color, #1d4ed8);
}
