/* Centered login/register shell — not full-viewport cover (user + admin guest pages). */
/* Shared account identity fields (bundled here; portal uses resources/css/portal/legacy copy). */
[data-farsi-name-only]::placeholder {
    direction: rtl;
    text-align: right;
}

[data-account-ltr].form-control,
.form-control[data-account-ltr] {
    direction: ltr !important;
    text-align: left !important;
}

[data-account-ltr].form-control::placeholder,
.form-control[data-account-ltr]::placeholder {
    direction: rtl !important;
    text-align: right !important;
}

html[dir="rtl"] [data-account-ltr].form-control,
html[dir="rtl"] .form-control[data-account-ltr] {
    direction: ltr !important;
    text-align: left !important;
}

html[dir="rtl"] [data-account-ltr].form-control::placeholder,
html[dir="rtl"] .form-control[data-account-ltr]::placeholder {
    direction: rtl !important;
    text-align: right !important;
}

[data-account-number].form-control::placeholder,
.form-control[data-account-number]::placeholder,
html[dir="rtl"] [data-account-number].form-control::placeholder,
html[dir="rtl"] .form-control[data-account-number]::placeholder {
    direction: ltr !important;
    text-align: left !important;
}

[data-captcha-field].form-control,
.form-control[data-captcha-field] {
    text-align: center !important;
}

[data-captcha-field].form-control::placeholder,
.form-control[data-captcha-field]::placeholder,
html[dir="rtl"] [data-captcha-field].form-control::placeholder,
html[dir="rtl"] .form-control[data-captcha-field]::placeholder {
    direction: rtl !important;
    text-align: right !important;
}

[data-password-ltr-entry].form-control,
.form-control[data-password-ltr-entry] {
    direction: ltr !important;
    text-align: left !important;
}

[data-password-ltr-entry].form-control::placeholder,
.form-control[data-password-ltr-entry]::placeholder,
html[dir="rtl"] [data-password-ltr-entry].form-control::placeholder,
html[dir="rtl"] .form-control[data-password-ltr-entry]::placeholder {
    direction: rtl !important;
    text-align: right !important;
}

.guest-password-toggle__btn[hidden] {
    display: none !important;
}

.account-avatar-upload__image {
    object-fit: cover;
    border: 2px solid var(--vz-border-color, #e9ecef);
    background: var(--vz-light, #f3f6f9);
}

.account-avatar-upload__preview {
    line-height: 0;
}

.account-avatar-upload--stacked .account-avatar-upload__body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
}

.account-avatar-upload--stacked .account-avatar-upload__preview {
    display: flex;
    justify-content: center;
}

.account-avatar-upload__preview--hidden {
    display: none !important;
}

.account-avatar-upload--inline .account-avatar-upload__input-wrap {
    position: relative;
}

.account-avatar-upload--inline .account-avatar-upload__input-wrap:has(.account-avatar-upload__preview:not(.account-avatar-upload__preview--hidden)) {
    padding-inline-end: calc(var(--account-avatar-preview-size, 52px) + 0.5rem);
}

.account-avatar-upload--inline .account-avatar-upload__input-wrap .form-control {
    width: 100%;
}

.account-avatar-upload--inline .account-avatar-upload__preview {
    position: absolute;
    inset-inline-end: 0;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.account-avatar-upload--inline .account-avatar-upload__image {
    width: var(--account-avatar-preview-size, 52px);
    height: var(--account-avatar-preview-size, 52px);
}

.account-avatar-upload--inline .account-avatar-upload__hint {
    font-size: 0.7rem;
    line-height: 1.35;
}
.guest-auth-page {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background-color: #eef1f6;
}

.guest-auth-page::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: url('../img/auth/guest-auth-bg.jpg');
    background-repeat: repeat;
    background-position: 0 0;
    /* Original tile 784×1168px — display at 1/6 for seamless repeat */
    background-size: 131px 195px;
    /* Faint watermark (~10% strength); page fill is .guest-auth-page background-color */
    opacity: 0.1;
}

.guest-auth-page > .guest-auth-card {
    position: relative;
    z-index: 1;
}

.guest-auth-card {
    width: 100%;
    max-width: 62rem;
    background-color: #fff;
    border-radius: 1rem;
    box-shadow: 0 1.25rem 3rem rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

/* Register (/register): no side image — card keeps original combined width (form + visual) */
.guest-auth-card--form-full {
    max-width: 62rem;
}

.guest-auth-card--form-full .guest-auth-card__row {
    min-height: auto;
}

.guest-auth-card__form--full {
    width: 100%;
    flex: 1 1 auto;
}

.guest-auth-card__form--full .guest-auth-card__form-inner {
    width: 100%;
    max-width: none;
    margin-inline: 0;
}

.guest-auth-card__row {
    min-height: 28rem;
}

.guest-auth-card__form {
    display: flex;
    align-items: center;
    padding: 2rem 2.25rem;
}

.guest-auth-card__form-inner {
    width: 100%;
    max-width: 22rem;
    margin-inline: auto;
}

.guest-auth-card__visual {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(160deg, #f0f2ff 0%, #e4e9f7 100%);
    border-inline-start: 1px solid rgba(15, 23, 42, 0.06);
}

@media (min-width: 992px) {
    .guest-auth-card__visual {
        display: flex;
    }
}

.guest-auth-card__visual-inner {
    max-width: 26rem;
    text-align: center;
}

.guest-auth-card__visual-inner h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.guest-auth-card__visual-inner p {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 0;
}

.guest-auth-card .authentication-cover-img {
    margin-bottom: 1.5rem;
    max-width: 100%;
    height: auto;
}

@media (max-width: 991.98px) {
    .guest-auth-card__form {
        padding: 1.75rem 1.25rem;
    }

    .guest-auth-card__row {
        min-height: auto;
    }
}

.guest-auth-captcha__image {
    height: 50px;
    width: auto;
    max-width: 150px;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Guest auth form field alignment (overrides theme RTL on captcha/password) */
.guest-auth-card__form .form-control[data-captcha-field] {
    text-align: center !important;
}

.guest-auth-card__form .form-control[data-captcha-field]::placeholder {
    direction: rtl !important;
    text-align: right !important;
}

.guest-auth-card__form .form-control[data-password-ltr-entry] {
    direction: ltr !important;
    text-align: left !important;
}

.guest-auth-card__form .form-control[data-password-ltr-entry]::placeholder {
    direction: rtl !important;
    text-align: right !important;
}

/* Password field: full border when visibility toggle is hidden */
.guest-auth-card__form .form-password-toggle .input-group-merge:not(:has(.guest-password-toggle__btn:not([hidden]))) > .form-control {
    border-inline-start: var(--bs-border-width) solid var(--bs-border-color) !important;
    padding-inline-start: 0.875rem !important;
}

[dir="rtl"] .guest-auth-card__form .form-password-toggle .input-group-merge:not(:has(.guest-password-toggle__btn:not([hidden]))) > .form-control {
    border-inline-start: var(--bs-border-width) solid var(--bs-border-color) !important;
    padding-inline-start: 0.875rem !important;
}

/* User login: register + account recovery */
.guest-auth-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.75rem;
    margin-top: 1rem;
}

.guest-auth-actions__btn {
    flex: 1 1 calc(50% - 0.375rem);
    max-width: calc(50% - 0.375rem);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

/* Same solid/shadow pattern as .btn-primary; softer green / red */
.guest-auth-actions__btn--register {
    color: #fff;
    background-color: #3d9a62;
    border-color: #3d9a62;
    box-shadow: 0 0.125rem 0.25rem rgba(147, 158, 170, 0.4);
}

.guest-auth-actions__btn--register:hover,
.guest-auth-actions__btn--register:focus {
    color: #fff !important;
    background-color: #52ad74 !important;
    border-color: #52ad74 !important;
    box-shadow: 0 0.25rem 1rem rgba(147, 158, 170, 0.45) !important;
}

.guest-auth-actions__btn--register:active,
.guest-auth-actions__btn--register.active {
    color: #fff !important;
    background-color: #348554 !important;
    border-color: #348554 !important;
    box-shadow: none !important;
}

.guest-auth-actions__btn--recovery {
    color: #fff;
    background-color: #c96a6a;
    border-color: #c96a6a;
    box-shadow: 0 0.125rem 0.25rem rgba(147, 158, 170, 0.4);
}

.guest-auth-actions__btn--recovery:hover,
.guest-auth-actions__btn--recovery:focus {
    color: #fff !important;
    background-color: #d67f7f !important;
    border-color: #d67f7f !important;
    box-shadow: 0 0.25rem 1rem rgba(147, 158, 170, 0.45) !important;
}

.guest-auth-actions__btn--recovery:active,
.guest-auth-actions__btn--recovery.active {
    color: #fff !important;
    background-color: #b85a5a !important;
    border-color: #b85a5a !important;
    box-shadow: none !important;
}

@media (max-width: 575.98px) {
    .guest-auth-actions {
        flex-direction: column;
    }

    .guest-auth-actions__btn {
        flex: 1 1 100%;
        max-width: 100%;
        width: 100%;
    }
}

/* OTP verify: resend + back — flex on form/link, not inner button */
.guest-auth-verify-actions {
    margin-top: 1rem;
}

.guest-auth-verify-actions > .guest-auth-actions__resend-form,
.guest-auth-verify-actions > .guest-auth-actions__btn {
    flex: 1 1 calc(50% - 0.375rem);
    max-width: calc(50% - 0.375rem);
    margin: 0;
}

.guest-auth-verify-actions > .guest-auth-actions__resend-form {
    display: flex;
    min-width: 0;
}

.guest-auth-verify-actions .otp-resend-btn {
    width: 100%;
    min-height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: var(--bs-btn-line-height, 1.4);
    padding: var(--bs-btn-padding-y, 0.469rem) var(--bs-btn-padding-x, 1.375rem);
}

.guest-auth-verify-actions > a.guest-auth-actions__btn {
    min-height: calc(
        (var(--bs-btn-padding-y, 0.469rem) * 2) + (var(--bs-btn-font-size, 0.9375rem) * var(--bs-btn-line-height, 1.4))
    );
}

.guest-auth-verify-actions .otp-resend-btn__timer {
    font-variant-numeric: tabular-nums;
    font-weight: inherit;
}

.guest-auth-verify-actions .otp-resend-btn:disabled {
    opacity: 1;
    cursor: not-allowed;
}

@media (max-width: 575.98px) {
    .guest-auth-verify-actions > .guest-auth-actions__resend-form,
    .guest-auth-verify-actions > .guest-auth-actions__btn {
        flex: 1 1 100%;
        max-width: 100%;
        width: 100%;
    }
}

.guest-auth-otp-digits input::-webkit-outer-spin-button,
.guest-auth-otp-digits input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.guest-auth-otp-digits input[type='number'].otp-digit {
    -moz-appearance: textfield;
}

.guest-auth-policies__link {
    font-size: 0.9375rem;
    text-decoration: underline;
}

.guest-auth-sponsors__title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
}

.guest-auth-sponsors__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
}

.guest-auth-sponsors__item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    max-width: 120px;
    padding: 0.35rem;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 0.5rem;
}

.guest-auth-sponsors__logo {
    max-height: 48px;
    max-width: 100%;
    object-fit: contain;
}

.guest-auth-sponsors__name {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    line-height: 1.3;
}

@media (max-width: 575.98px) {
    .guest-auth-page {
        padding: 0.75rem;
        align-items: flex-start;
    }

    .guest-auth-card {
        border-radius: 0.75rem;
    }

    .guest-auth-card__form {
        padding: 1.25rem 1rem;
    }

    .guest-auth-card__form-inner {
        max-width: none;
    }

    .guest-auth-card .app-brand-text {
        font-size: 1.05rem !important;
    }

    .guest-auth-captcha__image {
        max-width: 120px;
        height: 44px;
    }

    .guest-auth-card__form .d-flex.align-items-center.gap-2 {
        flex-wrap: wrap;
    }

    .guest-auth-card__form .d-flex.align-items-center.gap-2 .form-control {
        flex: 1 1 100%;
        min-width: 0;
    }

    .guest-auth-otp-digits {
        gap: 0.25rem;
        justify-content: center;
    }

    .guest-auth-otp-digits .otp-digit {
        flex: 1 1 0;
        min-width: 0;
        max-width: 2.75rem;
        padding-inline: 0.25rem;
        margin: 0 !important;
        font-size: 1.1rem;
    }

    .guest-auth-login-options .form-check {
        margin-bottom: 0;
    }
}
