/* Portal login — mobile-only mode (no email/username tabs in Digits) */
body.ls-portal-mobile-only .digits_login_use_email,
body.ls-portal-mobile-only .digits-form_tab-bar .digits_login_use_email,
body.ls-portal-mobile-only .digits-form_tab-bar .digits-form_tab-item:not(.digits_login_use_phone) {
    display: none !important;
}

body.ls-portal-mobile-only .digits-form_tab-bar .digits_login_use_phone {
    width: 100%;
    text-align: center;
    border-radius: 10px;
}

body.ls-portal-mobile-only .digits-form_tab-bar {
    grid-template-columns: 1fr;
}

/* Role picker on Digits login */
.ls-portal-role-picker {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.ls-portal-role-picker__label {
    margin: 0 0 0.65rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748b;
    text-align: center;
}

.ls-portal-role-picker__hint {
    margin: 0.75rem 0 0;
    font-size: 0.8rem;
    color: #64748b;
    text-align: center;
    line-height: 1.5;
}

.ls-portal-role-picker__tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}

.ls-portal-staff-link {
    margin: 1rem 0 0;
    padding-top: 0.85rem;
    border-top: 1px dashed rgba(15, 23, 42, 0.12);
    text-align: center;
    font-size: 0.82rem;
    color: #64748b;
}

.ls-portal-staff-link a {
    color: #111827;
    font-weight: 700;
    text-decoration: underline;
}

.ls-portal-role-tab {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 10px;
    padding: 0.55rem 0.4rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    color: #334155;
}

.ls-portal-role-tab:hover {
    border-color: #dc2626;
    color: #dc2626;
}

.ls-portal-role-tab.is-active {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.25);
}

.ls-portal-password-form {
    margin-top: 0.5rem;
}

.ls-portal-password-form[hidden] {
    display: none !important;
}

.ls-portal-field {
    margin-bottom: 0.85rem;
}

.ls-portal-field label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}

.ls-portal-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.85rem;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    font: inherit;
    background: #fff;
}

.ls-portal-field input:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.ls-portal-submit {
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.75rem 1rem;
    border: 0;
    border-radius: 10px;
    background: #dc2626;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.ls-portal-submit:disabled {
    opacity: 0.7;
    cursor: wait;
}

.ls-portal-form-message {
    margin-bottom: 0.75rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
}

.ls-portal-form-message.is-error {
    background: #fef2f2;
    color: #b91c1c;
}

.ls-portal-form-message[hidden] {
    display: none !important;
}

/* Customer: show Digits OTP form */
body.ls-portal-mode-customer .ls-portal-password-form {
    display: none !important;
}

body.ls-portal-mode-customer .digits-form_tab_wrapper,
body.ls-portal-mode-customer .digits-form_footer,
body.ls-portal-mode-customer .digits-form_button.digits-form_submit {
    display: block !important;
}

body.ls-portal-login-page form.digloginpage .digits-form_submit-btn,
body.ls-portal-login-page form.register .digits-form_submit-btn {
    display: block !important;
    width: 100%;
    margin-top: 0.75rem;
}

/* Rep: OTP via Digits (same as customer) */
body.ls-portal-mode-rep .ls-portal-password-form {
    display: none !important;
}

body.ls-portal-mode-rep .digits-form_tab_wrapper,
body.ls-portal-mode-rep .digits-form_footer,
body.ls-portal-mode-rep .digits-form_button.digits-form_submit {
    display: block !important;
}

body.ls-portal-login-page .ls-auth-digits-slot .digits-form_container {
    max-width: 100% !important;
    width: 100% !important;
}

body.ls-portal-login-page .ls-digits-inline-form .digits-form_page {
    min-height: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    display: block !important;
}

body.ls-portal-login-page .ls-digits-inline-form .digits-form_page::before {
    display: none !important;
}

body.ls-portal-login-page .ls-digits-inline-form .dig_login_cancel {
    display: none !important;
}

body.ls-portal-login-page .digits_main_wrapper#digits_protected {
    display: none !important;
}

/* Iran-only: no country picker on portal login */
body.ls-portal-login-page.ls-digits-iran-only .digits_countrycodecontainer,
body.ls-portal-login-page.ls-digits-iran-only .digits-form_countrycode,
body.ls-portal-login-page.dig_hideccode .ls-auth-digits-slot .digits_countrycodecontainer {
    display: none !important;
}

body.ls-portal-login-page.ls-digits-iran-only .ls-auth-digits-slot .dig-mobile_field,
body.ls-portal-login-page.ls-digits-iran-only .ls-auth-digits-slot input[name="phone"],
body.ls-portal-login-page.ls-digits-iran-only .ls-auth-digits-slot input[name="optional_phone"],
body.ls-portal-login-page.dig_hideccode .ls-auth-digits-slot .dig-mobile_field,
body.ls-portal-login-page.dig_hideccode .ls-auth-digits-slot input[name="phone"] {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
    text-align: center !important;
    direction: ltr;
}

body.ls-portal-login-page .ls-auth-digits-slot form.register .digits-form_register {
    margin-top: 0;
}

body.ls-portal-login-page .ls-auth-digits-slot .dig_login_signup_bar {
    font-size: 0.82rem;
    text-align: center;
    margin-top: 0.75rem;
}

/* OTP-only portal — no remember-me (mobile OTP login) */
body.ls-portal-login-page .digits-form_rememberme,
body.ls-portal-login-page .digits_login_remember_me {
    display: none !important;
}

.ls-portal-digits-notice {
    display: block;
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.55;
    font-weight: 700;
    text-align: center;
    border-width: 2px;
    border-style: solid;
}

.ls-portal-digits-notice[hidden] {
    display: none !important;
}

.ls-portal-digits-notice.is-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #f87171;
    box-shadow: 0 4px 14px rgba(185, 28, 28, 0.12);
}

.ls-portal-digits-notice.is-success {
    background: #ecfdf5;
    color: #047857;
    border-color: #34d399;
    box-shadow: 0 4px 14px rgba(4, 120, 87, 0.12);
}

.ls-portal-digits-notice.is-info {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #60a5fa;
}

/* OTP-only portal login — no password recovery */
body.ls-portal-login-page .digits-form_show_forgot_password,
body.ls-portal-login-page .digits_reset_pass,
body.ls-portal-login-page .digits-form_forgot_password,
body.ls-portal-login-page form.forgot,
body.ls-portal-login-page .digits_forgot_pass {
    display: none !important;
}

body.ls-portal-login-page .digits-form_footer {
    display: block !important;
    margin-top: 0.85rem;
    padding-top: 0.25rem;
    text-align: center;
    min-height: 1.5rem;
}

body.ls-portal-login-page .digits-form_footer .digits-form_resend_otp,
body.ls-portal-login-page .digits-form_link.digits-form_resend_otp {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.88rem;
    color: #64748b;
    cursor: pointer;
    font-weight: 600;
}

body.ls-portal-login-page .digits-form_resend_otp.digits_resend_disabled {
    opacity: 0.9;
    cursor: default;
}

body.ls-portal-login-page .digits-form_resend_otp:not(.digits_resend_disabled) {
    color: #dc2626;
    pointer-events: auto;
}

body.ls-portal-login-page .digits-form_resend_otp span {
    font-weight: 800;
    color: #dc2626;
    direction: ltr;
    display: inline-block;
    min-width: 3.25rem;
}

@media (min-width: 520px) {
    .ls-portal-role-tab {
        font-size: 0.85rem;
    }
}
