/*
 * Unlimited Sourcing — login / sign-up.
 * Built on us-ui.css; scoped to `.us-ui:not(#_)` like the rest of the kit.
 *
 * Calm layout: a plain page, one centred column, filled fields, one filled
 * button per view. No card chrome (no border, no shadow, no gradient).
 */

.us-ui:not(#_).us-auth {
    --_w: 400px;
    min-height: calc(100dvh - var(--us-header-h, 0px) - var(--us-admin-bar, 0px));
    display: flex;
    flex-direction: column;
    background: var(--us-canvas);
}

/* Longer sign-up forms get a little more room for two-column rows. */
.us-ui:not(#_).us-auth[data-view="buyer-info"],
.us-ui:not(#_).us-auth[data-view="vendor-identity"],
.us-ui:not(#_).us-auth[data-view="vendor-business"] {
    --_w: 480px;
}

.us-ui:not(#_) .us-auth__stage {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(32px, 9vh, 80px) 16px 48px;
}

.us-ui:not(#_) .us-auth__card {
    width: min(100%, var(--_w));
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.us-ui:not(#_) .us-auth__legal {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: min(100%, var(--_w));
    margin-top: auto;
    padding-top: 48px;
    color: var(--us-text-3);
    font-size: var(--us-fs-xs);
    line-height: 1.7;
}

.us-ui:not(#_) .us-auth__legal .us-icon {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    color: inherit;
}

/* Views: only the active panel is visible. */
.us-ui:not(#_) .us-auth-panel {
    display: none;
    flex-direction: column;
    gap: 24px;
}

.us-ui:not(#_)[data-view="mobile"] [data-panel="mobile"],
.us-ui:not(#_)[data-view="otp"] [data-panel="otp"],
.us-ui:not(#_)[data-view="login"] [data-panel="login"],
.us-ui:not(#_)[data-view="choice"] [data-panel="choice"],
.us-ui:not(#_)[data-view="buyer-info"] [data-panel="buyer-info"],
.us-ui:not(#_)[data-view="vendor-identity"] [data-panel="vendor-identity"],
.us-ui:not(#_)[data-view="vendor-business"] [data-panel="vendor-business"] {
    display: flex;
    animation: us-auth-in var(--us-dur-2) var(--us-ease) both;
}

@keyframes us-auth-in {
    from {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .us-ui:not(#_) .us-auth-panel,
    .us-ui:not(#_) .us-auth-message {
        animation: none !important;
    }
}

.us-ui:not(#_) .us-auth-conditional {
    display: none;
}

.us-ui:not(#_)[data-business-type="haghighi"] [data-business-group="haghighi"],
.us-ui:not(#_)[data-business-type="hoghughi"] [data-business-group="hoghughi"] {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Spacing rhythm inside the column. */
.us-ui:not(#_).us-auth .us-stack {
    gap: 24px;
}

.us-ui:not(#_).us-auth .us-stack--sm {
    gap: 12px;
}

.us-ui:not(#_).us-auth .us-grid {
    gap: 24px 16px;
}

.us-ui:not(#_).us-auth .us-label {
    color: var(--us-text-2);
    font-weight: 400;
}

/* Heading: brand mark, title, supporting line. */
.us-ui:not(#_) .us-auth__head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 8px;
    text-align: start;
}

.us-ui:not(#_) .us-auth__icon {
    width: 48px;
    height: 48px;
    margin-bottom: 20px;
    border-radius: var(--us-r-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--us-primary);
    color: var(--us-on-primary);
}

.us-ui:not(#_) .us-auth__icon .us-icon {
    width: 24px;
    height: 24px;
}

.us-ui:not(#_) .us-auth__title {
    margin: 0;
    font-size: var(--us-fs-2xl);
    font-weight: 500;
    line-height: 1.6667;
}

.us-ui:not(#_) .us-auth__sub {
    margin: 0;
    color: var(--us-text-2);
    font-size: var(--us-fs-base);
    line-height: 1.7;
}

.us-ui:not(#_) .us-auth__sub strong {
    color: var(--us-text);
    font-weight: 500;
}

.us-ui:not(#_) .us-auth__fine {
    margin: 0;
    color: var(--us-text-2);
    font-size: var(--us-fs-xs);
    text-align: start;
}

/* Primary action: the single filled button of each view, full width. */
.us-ui:not(#_).us-auth .us-btn--lg {
    height: var(--us-control-h-lg);
    border-radius: var(--us-r-sm);
    font-weight: 500;
}

.us-ui:not(#_) .us-auth__actions {
    display: flex;
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 8px;
    margin-top: 8px;
}

.us-ui:not(#_) .us-auth__actions > .us-btn--primary {
    width: 100%;
}

/* Inlined secondary actions (back, edit number, switch method, resend). */
.us-ui:not(#_) .us-btn.us-auth__link {
    height: var(--us-control-h);
    min-height: 40px;
    padding: 0 12px;
    border-color: transparent;
    border-radius: var(--us-r-sm);
    background: transparent;
    color: var(--us-primary-text);
    font-weight: 500;
    box-shadow: none;
}

.us-ui:not(#_) .us-btn.us-auth__link:hover {
    border-color: transparent;
    background: var(--us-primary-50);
    color: var(--us-primary-text);
}

.us-ui:not(#_) .us-btn.us-auth__link:focus-visible {
    box-shadow: var(--us-ring);
}

.us-ui:not(#_) .us-btn.us-auth__link:disabled {
    background: transparent;
    color: var(--us-primary-text);
    opacity: 0.4;
    cursor: default;
}

.us-ui:not(#_) .us-auth__alt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.us-ui:not(#_) .us-auth__switch {
    display: flex;
    justify-content: center;
}

.us-ui:not(#_) .us-auth__switch[hidden],
.us-ui:not(#_) .us-steps__item[hidden],
.us-ui:not(#_) .us-auth-pending[hidden] {
    display: none;
}

.us-ui:not(#_) .us-auth__switch .us-btn span[hidden] {
    display: none;
}

/* Mobile number with +98 prefix. */
.us-ui:not(#_) .us-phone {
    position: relative;
    display: flex;
    align-items: center;
}

.us-ui:not(#_) .us-phone__input {
    height: var(--us-control-h-lg);
    padding-left: 52px;
    font-size: var(--us-fs-lg);
    font-weight: 400;
    letter-spacing: normal;
}

.us-ui:not(#_) .us-phone__prefix {
    position: absolute;
    left: 12px;
    display: inline-flex;
    align-items: center;
    color: var(--us-text-2);
    font-size: var(--us-fs-lg);
    direction: ltr;
    pointer-events: none;
}

/* OTP: filled boxes, a 2px primary indicator on the active one. */
.us-ui:not(#_) .us-auth__otp {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.us-ui:not(#_) .us-otp {
    display: flex;
    justify-content: stretch;
    gap: 8px;
}

.us-ui:not(#_) .us-otp__box {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    height: var(--us-control-h-lg);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--us-r-sm);
    background: var(--us-field);
    color: var(--us-text);
    font: inherit;
    font-size: var(--us-fs-xl);
    font-weight: 500;
    text-align: center;
    caret-color: var(--us-primary-text);
    box-shadow: none;
    outline: none;
    transition: background-color var(--us-dur-1) ease, box-shadow var(--us-dur-1) ease;
}

.us-ui:not(#_) .us-otp__box:hover {
    background: var(--us-field-h);
}

.us-ui:not(#_) .us-otp__box:focus {
    background: var(--us-field);
    box-shadow: inset 0 -2px 0 var(--us-primary-text);
}

.us-ui:not(#_) .us-auth-field.has-error .us-otp__box {
    box-shadow: inset 0 -2px 0 var(--us-danger);
}

.us-ui:not(#_) .us-otp-timer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 40px;
    color: var(--us-text-2);
    font-size: var(--us-fs-base);
}

.us-ui:not(#_) .us-otp-timer .us-auth__link {
    margin-inline-end: -12px;
    font-size: var(--us-fs-base);
}

.us-ui:not(#_) .us-otp-timer-display {
    color: var(--us-text);
    font-weight: 500;
    font-feature-settings: "tnum";
}

/* Password eye + strength. */
.us-ui:not(#_) .us-auth-field .us-affix .us-input {
    padding-left: 52px;
}

.us-ui:not(#_) .us-auth-field .us-affix__end {
    left: 4px;
}

.us-ui:not(#_) .us-auth-eye {
    width: 40px;
    height: 40px;
    color: var(--us-text-2);
}

.us-ui:not(#_) .us-auth-eye[aria-pressed="true"] {
    color: var(--us-primary-text);
}

.us-ui:not(#_) .us-auth-strength {
    display: flex;
    align-items: center;
    gap: 12px;
}

.us-ui:not(#_) .us-auth-strength__bar {
    flex: 1 1 auto;
    height: 3px;
    border-radius: var(--us-r-pill);
    background: var(--us-field-h);
    overflow: hidden;
}

.us-ui:not(#_) .us-auth-strength__bar span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--us-gray-300);
    transition: width var(--us-dur-3) var(--us-ease), background-color var(--us-dur-2) ease;
}

.us-ui:not(#_) .us-auth-strength__label {
    min-width: 56px;
    color: var(--us-text-2);
    font-size: var(--us-fs-xs);
    font-weight: 400;
    text-align: end;
}

.us-ui:not(#_) .us-auth-strength.is-very-weak span { width: 20%; background: var(--us-danger); }
.us-ui:not(#_) .us-auth-strength.is-weak span { width: 45%; background: var(--us-warning); }
.us-ui:not(#_) .us-auth-strength.is-medium span { width: 72%; background: var(--us-info); }
.us-ui:not(#_) .us-auth-strength.is-strong span { width: 100%; background: var(--us-success); }

/* Step indicator (sign-up): a thin segmented bar. Dots and labels stay for screen readers. */
.us-ui:not(#_) .us-steps {
    display: flex;
    gap: 4px;
    margin: 0 0 32px;
    padding: 0;
    list-style: none;
}

.us-ui:not(#_) .us-steps[hidden] {
    display: none;
}

.us-ui:not(#_) .us-steps__item {
    flex: 1 1 0;
    display: block;
    height: 3px;
    border-radius: var(--us-r-pill);
    background: var(--us-field-h);
    transition: background-color var(--us-dur-3) ease;
}

.us-ui:not(#_) .us-steps__item.is-complete,
.us-ui:not(#_) .us-steps__item.is-active {
    background: var(--us-primary);
}

.us-ui:not(#_) .us-steps__dot,
.us-ui:not(#_) .us-steps__label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Pending RFQ banner: a flat tile, no outline. */
.us-ui:not(#_) .us-auth-pending {
    margin-bottom: 32px;
    border: 0;
    border-radius: var(--us-r-lg);
    background: var(--us-tile);
    color: var(--us-text);
}

.us-ui:not(#_) .us-auth-pending .us-icon {
    color: var(--us-text-2);
}

.us-ui:not(#_) .us-auth-pending__body {
    min-width: 0;
}

.us-ui:not(#_) .us-auth-pending__title {
    display: block;
    font-size: var(--us-fs-base);
    font-weight: 500;
}

.us-ui:not(#_) .us-auth-pending__text {
    margin: 2px 0 0;
    color: var(--us-text-2);
    font-weight: 400;
}

.us-ui:not(#_) .us-auth-pending__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
}

.us-ui:not(#_) .us-auth-pending__cancel {
    color: var(--us-text-2);
}

/* Messages. */
.us-ui:not(#_) .us-auth-message {
    margin-top: 24px;
    animation: us-fade-up 220ms var(--us-ease);
}

/* Account type: flat tiles, tint + primary text when selected. */
.us-ui:not(#_).us-auth .us-choice__box {
    gap: 16px;
    padding: 16px;
    border: 0;
    border-radius: var(--us-r-lg);
    background: var(--us-tile);
    box-shadow: none;
}

.us-ui:not(#_).us-auth .us-choice:hover .us-choice__box {
    background: var(--us-field);
}

.us-ui:not(#_).us-auth .us-choice__icon {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 0;
    background: transparent;
    color: var(--us-text-2);
}

.us-ui:not(#_).us-auth .us-choice__icon .us-icon {
    width: 24px;
    height: 24px;
}

.us-ui:not(#_).us-auth .us-choice__text {
    flex: 1 1 auto;
    min-width: 0;
    text-align: start;
}

.us-ui:not(#_).us-auth .us-choice__text strong {
    font-size: var(--us-fs-lg);
    font-weight: 500;
}

.us-ui:not(#_).us-auth .us-choice__text small {
    margin-top: 2px;
    color: var(--us-text-2);
    font-size: var(--us-fs-xs);
    line-height: 1.7;
}

.us-ui:not(#_).us-auth .us-choice__check {
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--us-gray-300);
    background: transparent;
}

.us-ui:not(#_).us-auth .us-choice input:checked + .us-choice__box {
    background: var(--us-primary-50);
    box-shadow: none;
}

.us-ui:not(#_).us-auth .us-choice input:checked + .us-choice__box .us-choice__icon,
.us-ui:not(#_).us-auth .us-choice input:checked + .us-choice__box .us-choice__text strong {
    background: transparent;
    color: var(--us-primary-text);
}

.us-ui:not(#_).us-auth .us-choice input:checked + .us-choice__box .us-choice__check {
    border: 6px solid var(--us-primary-text);
}

.us-ui:not(#_).us-auth .us-choice input:focus-visible + .us-choice__box {
    box-shadow: var(--us-ring);
}

/* Legal / natural person: two flat tiles. */
.us-ui:not(#_) .us-auth__segmented {
    display: flex;
    gap: 8px;
    padding: 0;
    background: transparent;
}

.us-ui:not(#_) .us-auth__segmented > label {
    flex: 1 1 0;
}

.us-ui:not(#_) .us-auth__segmented span {
    justify-content: center;
    width: 100%;
    height: var(--us-control-h);
    border-radius: var(--us-r-sm);
    background: var(--us-tile);
    color: var(--us-text-2);
    font-weight: 400;
    box-shadow: none;
}

.us-ui:not(#_) .us-auth__segmented input:checked + span {
    background: var(--us-primary-50);
    color: var(--us-primary-text);
    font-weight: 500;
    box-shadow: none;
}

.us-ui:not(#_) .us-auth__segmented input:focus-visible + span {
    box-shadow: var(--us-ring);
}

.us-ui:not(#_) .us-auth__segmented .us-icon {
    width: 16px;
    height: 16px;
}

/* Activity categories: small flat chips. */
.us-ui:not(#_) .us-auth__fieldset {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.us-ui:not(#_) .us-auth__fieldset .us-label {
    margin-bottom: 8px;
}

.us-ui:not(#_) .us-auth__fieldset .us-chip span {
    height: 32px;
    border: 0;
    border-radius: var(--us-r-xs);
    background: var(--us-tile);
    color: var(--us-text-2);
    font-weight: 400;
}

.us-ui:not(#_) .us-auth__fieldset .us-chip:hover span {
    background: var(--us-field);
}

.us-ui:not(#_) .us-auth__fieldset .us-chip input:checked + span {
    background: var(--us-primary-50);
    color: var(--us-primary-text);
    font-weight: 500;
}

.us-ui:not(#_) .us-auth__fieldset .us-chip input:focus-visible + span {
    box-shadow: var(--us-ring);
}

/* Logo picker: a flat tile, no dashed outline. */
.us-ui:not(#_) .us-auth-logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.us-ui:not(#_) .us-auth-logo__pic {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    overflow: hidden;
    border: 0;
    border-radius: var(--us-r-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--us-tile);
    color: var(--us-text-2);
    cursor: pointer;
    transition: background-color var(--us-dur-1) ease;
}

.us-ui:not(#_) .us-auth-logo__pic:hover {
    background: var(--us-field);
}

.us-ui:not(#_) .us-auth-logo__pic:focus-visible {
    outline: none;
    box-shadow: var(--us-ring);
}

.us-ui:not(#_) .us-auth-logo__pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.us-ui:not(#_) .us-auth-logo__title {
    display: block;
    font-size: var(--us-fs-base);
    font-weight: 500;
}

.us-ui:not(#_) .us-auth-logo .us-auth__link {
    margin-inline-start: -12px;
}

.us-ui:not(#_) .us-auth-cropper__stage {
    max-height: 60dvh;
    overflow: hidden;
    border-radius: var(--us-r-lg);
    background: var(--us-tile);
}

.us-ui:not(#_) .us-auth-cropper__stage img {
    display: block;
    max-width: 100%;
}

/* Phones: same column, tighter top spacing. */
@media (max-width: 640px) {
    .us-ui:not(#_) .us-auth__stage {
        padding: 32px 16px calc(32px + env(safe-area-inset-bottom));
    }

    .us-ui:not(#_) .us-otp {
        gap: 6px;
    }
}
