.bsx-otp {
    margin-bottom: 24px;
}

/* Hide the default WooCommerce password form (rendered after our block via the
   blackstarx_before_login_form action) while the single-field OTP UI is showing.
   Revealed once the visitor enters an email (.bsx-otp--email is added by JS). */
.bsx-otp:not(.bsx-otp--email) ~ form.woocommerce-form-login {
    display: none;
}

/* Same idea when the block is rendered inside the form itself (global/form-login.php
   via woocommerce_login_form_start -- the checkout login popup and friends): there the
   form is our parent, so hide its own rows rather than the form element. */
/* !important because theme rules for the form's own rows (e.g. #login-page
   .login-options) outrank any selector we can build from our own classes. */
form.woocommerce-form-login > .bsx-otp:not(.bsx-otp--email) ~ * {
    display: none !important;
}

.bsx-otp-step[hidden] {
    display: none;
}
/* Reuse the theme button styling via .button.full-width.size-x-large;
   just guarantee full width + spacing here. */
.bsx-otp .bsx-otp-continue,
.bsx-otp .bsx-otp-verify {
    width: 100%;
    margin-top: 16px;
}

/* Code entry */
.bsx-otp-code-intro {
    margin: 0 0 16px;
}

.bsx-otp-target {
    font-weight: 600;
    unicode-bidi: plaintext;
}

.bsx-otp-code-boxes {
    display: flex;
    gap: 10px;
    direction: ltr; /* keep digit order left-to-right even on RTL pages */
    margin-bottom: 16px;
}

.bsx-otp-digit {
    flex: 1 1 0;
    min-width: 0;
    height: 56px;
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    box-sizing: border-box;
    -moz-appearance: textfield;
    appearance: textfield;
}

.bsx-otp-digit::-webkit-outer-spin-button,
.bsx-otp-digit::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.bsx-otp-digit:focus {
    border-color: currentColor;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.bsx-otp-remember {
    margin-top: 8px;
}

.bsx-otp-actions {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    clear: both;
    margin-top: 12px;
}

.bsx-otp-actions a {
    cursor: pointer;
}

.bsx-otp-resend.is-disabled {
    pointer-events: none;
    opacity: 0.6;
}

/* Inline messages */
.bsx-otp-message {
    display: flex;
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.04);
}
.bsx-otp-message:empty {
    display: none;
}

.bsx-otp-message.is-error {
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
}

.bsx-otp-hidden {
    display: none !important;
}
