/*
 * Окно единой аутентификации в стиле job-ui.
 *
 * Токены скопированы из frontend/modules/company/modules/job/assets/src/css/job-ui.css
 * под собственный префикс: страница живёт в «чистом» шаблоне и не должна тянуть за собой
 * ни job-ui.css, ни AdminLTE.
 */
.job-ui-auth {
    --job-ui-auth-bg: #f5f6fb;
    --job-ui-auth-surface: #ffffff;
    --job-ui-auth-border: #e4e7f0;
    --job-ui-auth-border-strong: #d5d9e6;
    --job-ui-auth-muted: #f3f4f8;
    --job-ui-auth-text: #171c27;
    --job-ui-auth-text-muted: #6f7688;
    --job-ui-auth-text-soft: #8d95a6;
    --job-ui-auth-primary: #7c5cff;
    --job-ui-auth-primary-dark: #6a4af2;
    --job-ui-auth-primary-soft: rgba(124, 92, 255, 0.1);
    --job-ui-auth-primary-soft-strong: rgba(124, 92, 255, 0.16);
    --job-ui-auth-danger: #df5c7a;
    --job-ui-auth-shadow: 0 22px 48px rgba(22, 29, 45, 0.08);
    --job-ui-auth-card-width: 420px;
    --job-ui-auth-anim: 220ms;

    margin: 0;
    background: var(--job-ui-auth-bg);
    color: var(--job-ui-auth-text);
    font-family: "Inter", "Source Sans Pro", system-ui, sans-serif;
    font-size: 16px;
}

.job-ui-auth *,
.job-ui-auth *::before,
.job-ui-auth *::after {
    box-sizing: border-box;
}

.job-ui-auth [hidden] {
    display: none !important;
}

.job-ui-auth__screen {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px 16px;
}

.job-ui-auth__viewport {
    display: grid;
    gap: 16px;
    width: 100%;
    max-width: var(--job-ui-auth-card-width);
}

.job-ui-auth__card {
    width: 100%;
    padding: 32px;
    background: var(--job-ui-auth-surface);
    border: 1px solid var(--job-ui-auth-border);
    border-radius: 24px;
    box-shadow: var(--job-ui-auth-shadow);
}

/* ─────────────── Шапка ─────────────── */

.job-ui-auth__brand {
    margin-bottom: 24px;
    text-align: center;
}

.job-ui-auth__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--job-ui-auth-primary) 0%, var(--job-ui-auth-primary-dark) 100%);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(110, 83, 245, 0.24);
}

.job-ui-auth__title {
    margin: 0 0 6px;
    font-size: 1.5em;
    font-weight: 700;
    line-height: 1.3;
}

.job-ui-auth__subtitle {
    margin: 0;
    color: var(--job-ui-auth-text-muted);
    font-size: 0.9em;
    line-height: 1.45;
}

/* ─────────────── Сообщения ─────────────── */

.job-ui-auth__alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 14px;
    font-size: 1em;
    line-height: 1.45;
}

.job-ui-auth__alert--danger {
    color: #a63f59;
    background: #fff3f6;
    border-color: #f6d4dd;
}

.job-ui-auth__alert--info {
    color: var(--job-ui-auth-primary-dark);
    background: var(--job-ui-auth-primary-soft);
    border-color: rgba(124, 92, 255, 0.18);
}

/* ─────────────── Блоки сценария ─────────────── */

/*
 * Все блоки лежат в одной ячейке грида, поэтому высота карточки равна высоте самого
 * большого блока и при переключении окно не «прыгает».
 */
.job-ui-auth__stack {
    display: grid;
    grid-template-columns: 1fr;
}

.job-ui-auth__block {
    grid-area: 1 / 1;
    opacity: 1;
    transform: translateX(0);
    transition: transform var(--job-ui-auth-anim) cubic-bezier(0.2, 0.7, 0.3, 1),
        opacity var(--job-ui-auth-anim) ease;
}

/* Входящий блок появляется справа, уходящий смещается влево. */
.job-ui-auth__block.is-entering {
    opacity: 0;
    transform: translateX(28px);
}

.job-ui-auth__block.is-leaving {
    opacity: 0;
    transform: translateX(-20px);
    pointer-events: none;
}

/* ─────────────── Поля ─────────────── */

.job-ui-auth__field {
    margin-bottom: 18px;
}

.job-ui-auth__label {
    display: block;
    margin-bottom: 8px;
    color: #3c4457;
    font-size: 0.9em;
    font-weight: 600;
    line-height: 1.4;
}

.job-ui-auth__control {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--job-ui-auth-border);
    border-radius: 14px;
    background: #ffffff;
    color: var(--job-ui-auth-text);
    font-family: inherit;
    font-size: 1em;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.job-ui-auth__control::placeholder {
    color: #9aa1b1;
}

.job-ui-auth__control:hover {
    border-color: #cdd2df;
}

.job-ui-auth__control:focus {
    outline: none;
    border-color: rgba(124, 92, 255, 0.52);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.14);
}

.job-ui-auth__control.is-invalid {
    border-color: var(--job-ui-auth-danger);
}

.job-ui-auth__hint {
    display: block;
    margin-top: 6px;
    color: var(--job-ui-auth-text-soft);
    font-size: 0.9em;
    line-height: 1.4;
    min-height: 17px;
}

.job-ui-auth__error {
    display: block;
    margin-top: 6px;
    color: var(--job-ui-auth-danger);
    font-size: 0.9em;
    line-height: 1.4;
}

/*
 * Сообщение сервиса под виджетом ввода кода и контейнер кнопки повторной отправки.
 * Высота обоих зарезервирована: кнопка появляется в разметке только через минуту,
 * и без резерва её появление дёргало бы содержимое окна.
 */
.job-ui-auth__status {
    margin: 4px 0 0;
    min-height: 18px;
    color: var(--job-ui-auth-text-soft);
    font-size: 1em;
    line-height: 1.4;
    text-align: center;
}

.job-ui-auth__resend {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    min-height: 20px;
    margin-top: 8px;
    font-size: 1em;
    color: var(--job-ui-auth-text-soft);
}

.job-ui-auth__link--action {
    color: var(--job-ui-auth-primary-dark);
    text-decoration: underline;
}

/* Отсчёт до повторной отправки: цифры заметнее подписи, но без мигания. */
.job-ui-auth__countdown {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--job-ui-auth-text);
}

/*
 * Плашка под таймером: почему СМС может задержаться и что делать. Текст мелкий, чтобы не
 * спорить с виджетом кода, но с фоном — его должны заметить до нажатия «ещё раз».
 */
.job-ui-auth__notice {
    margin: 14px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--job-ui-auth-surface-muted, rgba(0, 0, 0, 0.04));
    color: var(--job-ui-auth-text-soft);
    font-size: 0.85em;
    line-height: 1.45;
    text-align: center;
}

/* Кнопки друг под другом: способы подтвердить номер идут в заданном порядке. */
.job-ui-auth__actions--stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.job-ui-auth__hint--center {
    text-align: center;
}

/* Блок ожидания мессенджера: QR по центру, ссылка текстом под ним. */
.job-ui-auth__messenger {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.job-ui-auth__qr {
    width: 180px;
    height: 180px;
    border-radius: 12px;
    background: #fff;
}

.job-ui-auth__messenger-link {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    color: var(--job-ui-auth-primary-dark);
    font-size: 0.85em;
    text-align: center;
    text-decoration: underline;
}

.job-ui-auth__block-title {
    margin: 0 0 16px;
    font-size: 1.4em;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
}

.job-ui-auth__phone-label {
    display: block;
    margin-bottom: 18px;
    color: var(--job-ui-auth-text-muted);
    font-size: 0.9em;
    text-align: center;
}

/* ─────────────── Кнопки и ссылки ─────────────── */

.job-ui-auth__actions {
    display: grid;
    gap: 12px;
    margin-top: 4px;
}

.job-ui-auth__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 14px;
    font-family: inherit;
    font-size: 1em;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease,
        color 0.18s ease, border-color 0.18s ease;
}

.job-ui-auth__button:hover,
.job-ui-auth__button:focus {
    text-decoration: none;
    outline: none;
}

.job-ui-auth__button:focus-visible {
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}

.job-ui-auth__button[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.job-ui-auth__button--primary {
    color: #ffffff;
    background: linear-gradient(135deg, var(--job-ui-auth-primary) 0%, var(--job-ui-auth-primary-dark) 100%);
    border-color: rgba(109, 88, 243, 0.98);
    box-shadow: 0 16px 30px rgba(110, 83, 245, 0.26);
}

.job-ui-auth__button--primary:hover,
.job-ui-auth__button--primary:focus {
    color: #ffffff;
    background: linear-gradient(135deg, #7252f8 0%, #6241ef 100%);
}

.job-ui-auth__links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 18px;
}

.job-ui-auth__link {
    color: var(--job-ui-auth-text-muted);
    font-size: 1em;
    font-weight: 600;
    text-decoration: none;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.job-ui-auth__link:hover,
.job-ui-auth__link:focus {
    color: var(--job-ui-auth-primary-dark);
    text-decoration: none;
}

/* ─────────────── Выбор кабинета ─────────────── */

.job-ui-auth__cabinets {
    display: grid;
    gap: 12px;
}

.job-ui-auth__cabinet {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    min-height: 84px;
    padding: 18px 20px;
    border: 1px solid var(--job-ui-auth-border);
    border-radius: 18px;
    background: #ffffff;
    color: var(--job-ui-auth-text);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease,
        box-shadow 0.18s ease;
}

.job-ui-auth__cabinet:hover,
.job-ui-auth__cabinet:focus {
    outline: none;
    transform: translateY(-1px);
    border-color: rgba(124, 92, 255, 0.4);
    background: var(--job-ui-auth-primary-soft);
    box-shadow: 0 12px 28px rgba(22, 29, 45, 0.06);
}

.job-ui-auth__cabinet-title {
    font-size: 1.3em;
    font-weight: 600;
}

.job-ui-auth__cabinet-subtitle {
    color: var(--job-ui-auth-text-muted);
    font-size: 1.2em;
    line-height: 1.35;
}

/* ─────────────── Виджет кода в окне ─────────────── */

.job-ui-auth__code {
    margin-bottom: 18px;
}

.job-ui-auth__code .job-ui-auth__error {
    text-align: center;
    margin-top: 0.8em;
}

/* ─────────────── Оферта при регистрации по ссылке ─────────────── */

.job-ui-auth__footnote {
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid rgba(124, 92, 255, 0.18);
    border-radius: 14px;
    background: var(--job-ui-auth-primary-soft);
    color: var(--job-ui-auth-primary-dark);
    font-size: 0.8em;
    line-height: 1.45;
}

.job-ui-auth__footnote a {
    color: inherit;
    text-decoration: underline;
}

/* ─────────────── Состояние отправки ─────────────── */

.job-ui-auth__card.is-busy {
    cursor: progress;
}

/* ─────────────── Страница до старта скрипта ───────────────
 * `is-ready` ставит auth.js в конце инициализации. До него элементы «только со скриптом»
 * спрятаны, а запасные формы `data-auth-nojs` видны: упавший скрипт иначе оставлял бы
 * ссылки на ботов, которые открывают чат, не заведя ожидания на сервере (DEV-1596). */

.job-ui-auth__card[data-auth-root]:not(.is-ready) [data-auth-js-only] {
    display: none !important;
}

.job-ui-auth__card[data-auth-root].is-ready [data-auth-nojs] {
    display: none !important;
}

/* ─────────────── Мелкие экраны ─────────────── */

@media (max-width: 480px) {
    .job-ui-auth__card {
        padding: 24px 20px;
        border-radius: 20px;
    }
}

/* ─────────────── Уважение к настройкам движения ─────────────── */

@media (prefers-reduced-motion: reduce) {
    .job-ui-auth__block,
    .job-ui-auth__button,
    .job-ui-auth__cabinet {
        transition: opacity var(--job-ui-auth-anim) ease;
    }

    .job-ui-auth__block.is-entering,
    .job-ui-auth__block.is-leaving {
        transform: none;
    }

    .job-ui-auth__button:hover,
    .job-ui-auth__button:focus,
    .job-ui-auth__cabinet:hover,
    .job-ui-auth__cabinet:focus {
        transform: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════════════
 * Шаг 2 регистрации по прототипу `documents/prompts/reg/1596-additional.html`.
 *
 * Значения перенесены из прототипа один в один (палитра, типографика, размеры кнопок, ячеек,
 * шторок); имена классов получили префикс `job-ui-auth__`, а токены — `--job-ui-auth-p-`,
 * чтобы не задеть ни форму компании, ни карточку входа. На телефоне (до 768px, как у регистрации)
 * экраны шага 2 раскрываются во весь экран (`body.job-ui-auth--shell`): шапка, прокручиваемое
 * тело, футер с кнопками. На десктопе те же блоки живут внутри карточки, шапки спрятаны.
 * ═══════════════════════════════════════════════════════════════════════════════════════ */

.job-ui-auth {
    --job-ui-auth-p-purple: #7C5CFC;
    --job-ui-auth-p-purple-dark: #6B4EE6;
    --job-ui-auth-p-purple-soft: #EDE9FE;
    --job-ui-auth-p-purple-soft2: #F3F0FF;
    --job-ui-auth-p-bg: #F4F5F9;
    --job-ui-auth-p-card: #FFFFFF;
    --job-ui-auth-p-ink: #171932;
    --job-ui-auth-p-ink-2: #3B3E58;
    --job-ui-auth-p-muted: #7B8194;
    --job-ui-auth-p-muted-2: #9AA0B2;
    --job-ui-auth-p-line: #ECEEF4;
    --job-ui-auth-p-line-2: #E3E6EF;
    --job-ui-auth-p-gray-bg: #EEF0F5;
    --job-ui-auth-p-green-bg: #E6F6EC;
    --job-ui-auth-p-green-tx: #28A05A;
    --job-ui-auth-p-red-bg: #FDEBEC;
    --job-ui-auth-p-red-tx: #D64550;
    --job-ui-auth-p-field-bg: #FAFBFD;
    --job-ui-auth-p-max-1: #3E6BFF;
    --job-ui-auth-p-max-2: #8B45FF;
    --job-ui-auth-p-tg: #2AABEE;
    --job-ui-auth-p-tg-dark: #1E96D4;
    --job-ui-auth-p-radius: 16px;
    --job-ui-auth-p-radius-sm: 12px;
    --job-ui-auth-p-radius-xs: 10px;
    --job-ui-auth-p-radius-pill: 999px;
    --job-ui-auth-p-ring: 0 0 0 3px rgba(124, 92, 252, 0.12);
    --job-ui-auth-p-ring-err: 0 0 0 3px rgba(214, 69, 80, 0.12);
    --job-ui-auth-p-shadow-card: 0 1px 2px rgba(20, 24, 50, 0.04);
    --job-ui-auth-p-shadow-up: 0 -6px 20px rgba(20, 24, 50, 0.06);
    --job-ui-auth-p-shadow-pop: 0 12px 32px rgba(20, 24, 50, 0.16);
    /* мобильная типографика прототипа */
    --job-ui-auth-p-fs-h1: 24px;
    --job-ui-auth-p-fs-h2: 19px;
    --job-ui-auth-p-fs-body: 16px;
    --job-ui-auth-p-fs-input: 17px;
    --job-ui-auth-p-fs-small: 13.5px;
    --job-ui-auth-p-fs-fine: 12.5px;
    --job-ui-auth-p-ctl-h: 52px;
    --job-ui-auth-p-tap: 44px;
    --job-ui-auth-p-pad: 16px;
    --job-ui-auth-p-sat: env(safe-area-inset-top, 0px);
    --job-ui-auth-p-sab: env(safe-area-inset-bottom, 0px);
}

/* ── типографика экранов ── */

.job-ui-auth__h1 {
    margin: 18px 0 0;
    color: var(--job-ui-auth-p-ink);
    font-size: var(--job-ui-auth-p-fs-h1);
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.24;
    overflow-wrap: anywhere;
}

.job-ui-auth__sub {
    margin: 8px 0 0;
    color: var(--job-ui-auth-p-ink-2);
    font-size: var(--job-ui-auth-p-fs-body);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.job-ui-auth__fine {
    margin: 0;
    color: var(--job-ui-auth-p-muted);
    font-size: var(--job-ui-auth-p-fs-fine);
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.job-ui-auth__fine--center {
    text-align: center;
}

/* Подпись под ссылкой повтора: в прототипе она подтянута к ссылке отрицательным отступом. */
.job-ui-auth__fine--under-timer {
    margin-top: -6px;
}

.job-ui-auth__inline-link {
    display: inline;
    padding: 2px 0;
    border: 0;
    background: none;
    color: var(--job-ui-auth-p-purple-dark);
    font-family: inherit;
    font-size: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.job-ui-auth__flabel {
    display: block;
    margin-bottom: 6px;
    color: var(--job-ui-auth-p-ink-2);
    font-size: var(--job-ui-auth-p-fs-small);
    font-weight: 700;
}

.job-ui-auth__mt8 {
    margin-top: 8px;
}

.job-ui-auth__mt12 {
    margin-top: 12px;
}

.job-ui-auth__mt16 {
    margin-top: 16px;
}

/* ── кнопки прототипа ── */

.job-ui-auth__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: var(--job-ui-auth-p-ctl-h);
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: var(--job-ui-auth-p-radius-sm);
    font-family: inherit;
    font-size: var(--job-ui-auth-p-fs-body);
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: 0.15s;
}

.job-ui-auth__btn:hover,
.job-ui-auth__btn:focus {
    text-decoration: none;
    outline: none;
}

.job-ui-auth__btn:focus-visible {
    box-shadow: var(--job-ui-auth-p-ring);
}

.job-ui-auth__btn--primary {
    background: var(--job-ui-auth-p-purple);
    color: #ffffff;
}

.job-ui-auth__btn--primary:hover,
.job-ui-auth__btn--primary:focus {
    background: var(--job-ui-auth-p-purple-dark);
    color: #ffffff;
}

.job-ui-auth__btn--primary[disabled] {
    background: var(--job-ui-auth-p-gray-bg);
    color: var(--job-ui-auth-p-muted-2);
    cursor: default;
}

.job-ui-auth__btn--ghost {
    background: var(--job-ui-auth-p-card);
    border-color: var(--job-ui-auth-p-line-2);
    color: var(--job-ui-auth-p-ink-2);
}

.job-ui-auth__btn--ghost:hover,
.job-ui-auth__btn--ghost:focus {
    border-color: var(--job-ui-auth-p-muted-2);
    color: var(--job-ui-auth-p-ink-2);
}

/* Фирменные цвета мессенджеров — из прототипа, значков на кнопках нет. */
.job-ui-auth__btn--max {
    background: linear-gradient(100deg, var(--job-ui-auth-p-max-1), var(--job-ui-auth-p-max-2));
    color: #ffffff;
}

.job-ui-auth__btn--max:hover,
.job-ui-auth__btn--max:focus {
    filter: brightness(0.95);
    color: #ffffff;
}

.job-ui-auth__btn--tg {
    background: var(--job-ui-auth-p-tg);
    color: #ffffff;
}

.job-ui-auth__btn--tg:hover,
.job-ui-auth__btn--tg:focus {
    background: var(--job-ui-auth-p-tg-dark);
    color: #ffffff;
}

.job-ui-auth__btn--max[disabled],
.job-ui-auth__btn--tg[disabled] {
    background: var(--job-ui-auth-p-gray-bg);
    color: var(--job-ui-auth-p-muted-2);
    filter: none;
    cursor: default;
    /* Кнопки мессенджеров — ссылки на ботов: запертую ссылку нельзя открыть и нажатием */
    pointer-events: none;
}

.job-ui-auth__btngap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── кнопки мессенджеров по макету reg-v31 ──
   На экране «Вы новый пользователь» кнопки фирменного цвета без значков, «Открыть …» на экране
   ожидания и малые кнопки на экране кода — со значками мессенджеров. Значок добавляет отдельный
   класс `job-ui-auth__btn--icon` псевдоэлементом, так что разметка кнопок не меняется и значки
   при желании включаются на любой кнопке мессенджера одним классом. */

/* главная кнопка экрана — чуть ниже обычной, как `btn-main` макета */
.job-ui-auth__btn--main {
    min-height: 50px;
}

/* малая кнопка в ряду из двух, как `btn-sm` макета */
.job-ui-auth__btn--sm {
    min-height: 44px;
    padding: 9px 10px;
    gap: 7px;
    font-size: var(--job-ui-auth-p-fs-body);
}

/* значок: полупрозрачная плашка слева от текста, у MAX — буква «M», у Telegram — самолётик в круге */
.job-ui-auth__btn--icon.job-ui-auth__btn--max::before,
.job-ui-auth__btn--icon.job-ui-auth__btn--tg::before {
    content: '';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background-color: rgba(255, 255, 255, 0.24);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 15px 15px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
}

.job-ui-auth__btn--icon.job-ui-auth__btn--max::before {
    content: 'M';
}

.job-ui-auth__btn--icon.job-ui-auth__btn--tg::before {
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M3 11.5 20 4.5l-3 15-5.2-4.3-2.8 2.6.4-4.2L17 7.8 8 13.2z'/%3E%3C/svg%3E");
}

/* запертая кнопка серая — значок тоже гаснет */
.job-ui-auth__btn--icon.job-ui-auth__btn--max[disabled]::before,
.job-ui-auth__btn--icon.job-ui-auth__btn--tg[disabled]::before {
    background-color: var(--job-ui-auth-p-line-2);
    color: var(--job-ui-auth-p-muted-2);
}

.job-ui-auth__btn--icon.job-ui-auth__btn--tg[disabled]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%239AA0B2'%3E%3Cpath d='M3 11.5 20 4.5l-3 15-5.2-4.3-2.8 2.6.4-4.2L17 7.8 8 13.2z'/%3E%3C/svg%3E");
}

/* на малой кнопке значок меньше */
.job-ui-auth__btn--sm.job-ui-auth__btn--icon.job-ui-auth__btn--max::before,
.job-ui-auth__btn--sm.job-ui-auth__btn--icon.job-ui-auth__btn--tg::before {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background-size: 12px 12px;
    font-size: 11px;
}

.job-ui-auth__btn--sm.job-ui-auth__btn--icon.job-ui-auth__btn--tg::before {
    border-radius: 50%;
}

.job-ui-auth__linkbtn {
    display: block;
    width: 100%;
    min-height: var(--job-ui-auth-p-tap);
    padding: 10px 4px;
    border: 0;
    background: none;
    color: var(--job-ui-auth-p-purple-dark);
    font-family: inherit;
    font-size: var(--job-ui-auth-p-fs-body);
    font-weight: 700;
    text-align: center;
    cursor: pointer;
}

.job-ui-auth__linkbtn:hover {
    text-decoration: underline;
}

.job-ui-auth__linkbtn--sm {
    font-size: var(--job-ui-auth-p-fs-small);
    font-weight: 600;
}

/* ── инструкция, ожидание, карточка номеров ── */

.job-ui-auth__steps-list {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: st;
}

.job-ui-auth__steps-list li {
    counter-increment: st;
    position: relative;
    padding: 0 0 12px 34px;
    color: var(--job-ui-auth-p-ink-2);
    font-size: var(--job-ui-auth-p-fs-body);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.job-ui-auth__steps-list li::before {
    content: counter(st);
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--job-ui-auth-p-gray-bg);
    color: var(--job-ui-auth-p-muted);
    font-size: 13px;
    font-weight: 700;
}

.job-ui-auth__spinrow {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 18px;
    color: var(--job-ui-auth-p-ink-2);
    font-size: var(--job-ui-auth-p-fs-body);
}

.job-ui-auth__spinner {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border: 2.5px solid var(--job-ui-auth-p-purple-soft);
    border-top-color: var(--job-ui-auth-p-purple);
    border-radius: 50%;
    animation: job-ui-auth-spin 0.8s linear infinite;
}

@keyframes job-ui-auth-spin {
    to {
        transform: rotate(360deg);
    }
}

.job-ui-auth__kv-card {
    margin-top: 12px;
    padding: 16px;
    border: 1px solid var(--job-ui-auth-p-line);
    border-radius: var(--job-ui-auth-p-radius);
    background: var(--job-ui-auth-p-card);
    box-shadow: var(--job-ui-auth-p-shadow-card);
}

.job-ui-auth__kv {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-top: 1px solid var(--job-ui-auth-p-line);
    font-size: var(--job-ui-auth-p-fs-body);
}

.job-ui-auth__kv:first-child {
    border-top: none;
}

.job-ui-auth__kv span {
    flex: 0 0 auto;
    color: var(--job-ui-auth-p-muted);
}

.job-ui-auth__kv b {
    min-width: 0;
    color: var(--job-ui-auth-p-ink);
    font-weight: 700;
    text-align: right;
    overflow-wrap: anywhere;
}

/* ── ошибки, таймер, подсказки ── */

.job-ui-auth__errmsg {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-top: 8px;
    color: var(--job-ui-auth-p-red-tx);
    font-size: var(--job-ui-auth-p-fs-small);
    font-weight: 600;
    text-align: left;
    overflow-wrap: anywhere;
}

.job-ui-auth__errmsg svg {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 1px;
}

/* Текст ошибки внутри строки прототипа: базовый стиль `job-ui-auth__error` ему не нужен. */
.job-ui-auth__errmsg [data-auth-error] {
    display: inline;
    margin: 0;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

.job-ui-auth__erract {
    margin-top: 8px;
}

.job-ui-auth__timer {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--job-ui-auth-p-tap);
    margin-top: 14px;
    color: var(--job-ui-auth-p-muted);
    font-size: var(--job-ui-auth-p-fs-small);
    text-align: center;
}

.job-ui-auth__timer .job-ui-auth__countdown {
    color: var(--job-ui-auth-p-muted);
    font-weight: 400;
}

.job-ui-auth__ordiv {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0 8px;
    color: var(--job-ui-auth-p-muted-2);
    font-size: var(--job-ui-auth-p-fs-fine);
    font-weight: 600;
}

.job-ui-auth__ordiv::before,
.job-ui-auth__ordiv::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--job-ui-auth-p-line-2);
}

.job-ui-auth__rowtwo {
    display: flex;
    gap: 8px;
}

.job-ui-auth__rowtwo .job-ui-auth__btn {
    flex: 1 1 0;
    min-width: 0;
}

.job-ui-auth__hintline {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    padding: 0 2px;
    color: var(--job-ui-auth-p-ink-2);
    font-size: var(--job-ui-auth-p-fs-small);
    text-align: left;
    overflow-wrap: anywhere;
}

.job-ui-auth__hintline svg {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin-top: 1px;
    color: var(--job-ui-auth-p-purple-dark);
}

/* ── ячейки кода в блоках шага 2 ── */

.job-ui-auth__block--shell .code-input {
    --code-input-gap: clamp(6px, 2.4vw, 12px);
    --code-input-radius: var(--job-ui-auth-p-radius-sm);
    --code-input-font-size: 28px;
    --code-input-border: var(--job-ui-auth-p-line-2);
    --code-input-border-hover: var(--job-ui-auth-p-line-2);
    --code-input-accent: var(--job-ui-auth-p-purple);
    --code-input-accent-soft: rgba(124, 92, 252, 0.12);
    --code-input-text: var(--job-ui-auth-p-ink);
    --code-input-bg: var(--job-ui-auth-p-field-bg);
    --code-input-disabled-bg: var(--job-ui-auth-p-field-bg);
    --code-input-error: var(--job-ui-auth-p-red-tx);
    --code-input-error-soft: rgba(214, 69, 80, 0.12);

    justify-content: flex-start;
    margin-top: 18px;
}

.job-ui-auth__block--shell .code-input__cell {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    height: auto;
    max-height: 74px;
    aspect-ratio: 1 / 1.15;
    border-width: 1.5px;
    font-weight: 800;
}

.job-ui-auth__block--shell .code-input__cell:focus,
.job-ui-auth__block--shell .code-input--focused .code-input__cell.is-active,
.job-ui-auth__block--shell .code-input__cell.is-filled {
    border-color: var(--job-ui-auth-p-purple);
    background: var(--job-ui-auth-p-card);
}

.job-ui-auth__block--shell .code-input--error .code-input__cell {
    border-color: var(--job-ui-auth-p-red-tx);
    background: var(--job-ui-auth-p-red-bg);
}

.job-ui-auth__block--shell .job-ui-auth__code {
    margin-bottom: 0;
}

/* Подписи «Новый код» и «Повторите код» прижаты к своим ячейкам. */
.job-ui-auth__code--row .code-input {
    margin-top: 0;
}

/* ── шторки ── */

.job-ui-auth__sheet-wrap {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.job-ui-auth__sheet-bg {
    position: absolute;
    inset: 0;
    background: rgba(23, 25, 50, 0.42);
}

.job-ui-auth__sheet {
    position: relative;
    max-height: 88%;
    padding: 8px var(--job-ui-auth-p-pad) calc(16px + var(--job-ui-auth-p-sab));
    border-radius: 20px 20px 0 0;
    background: var(--job-ui-auth-p-card);
    overflow-y: auto;
    animation: job-ui-auth-up 0.22s ease;
}

@keyframes job-ui-auth-up {
    from {
        transform: translateY(30px);
        opacity: 0.4;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

@keyframes job-ui-auth-pop {
    from {
        transform: scale(0.97);
        opacity: 0.5;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

.job-ui-auth__sheet-grip {
    width: 40px;
    height: 4px;
    margin: 6px auto 14px;
    border-radius: var(--job-ui-auth-p-radius-pill);
    background: var(--job-ui-auth-p-line-2);
}

.job-ui-auth__sheet h3 {
    margin: 0;
    color: var(--job-ui-auth-p-ink);
    font-size: var(--job-ui-auth-p-fs-h2);
    font-weight: 800;
    letter-spacing: -0.3px;
    overflow-wrap: anywhere;
}

.job-ui-auth__sheet p {
    margin: 10px 0 0;
    color: var(--job-ui-auth-p-ink-2);
    font-size: var(--job-ui-auth-p-fs-body);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

/* ── шапка экрана: видна только в мобильной оболочке ── */

.job-ui-auth__appbar {
    display: none;
}

.job-ui-auth__abrow {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: var(--job-ui-auth-p-tap);
}

.job-ui-auth__abtitle {
    flex: 1;
    min-width: 0;
    color: var(--job-ui-auth-p-ink-2);
    font-size: var(--job-ui-auth-p-fs-small);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.job-ui-auth__iconbtn {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: var(--job-ui-auth-p-tap);
    min-height: var(--job-ui-auth-p-tap);
    margin-left: -10px;
    border: none;
    border-radius: var(--job-ui-auth-p-radius-xs);
    background: none;
    color: var(--job-ui-auth-p-ink-2);
    cursor: pointer;
}

.job-ui-auth__iconbtn:hover {
    background: var(--job-ui-auth-p-gray-bg);
}

.job-ui-auth__iconbtn svg {
    width: 22px;
    height: 22px;
}

.job-ui-auth__steps {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 0 8px;
    color: var(--job-ui-auth-p-muted);
    font-size: var(--job-ui-auth-p-fs-fine);
    font-weight: 700;
}

.job-ui-auth__pline {
    height: 4px;
    margin-bottom: 10px;
    border-radius: var(--job-ui-auth-p-radius-pill);
    background: var(--job-ui-auth-p-gray-bg);
    overflow: hidden;
}

.job-ui-auth__pline > span {
    display: block;
    height: 100%;
    border-radius: var(--job-ui-auth-p-radius-pill);
    background: var(--job-ui-auth-p-purple);
    transition: width 0.25s;
}

/* ── десктоп: блоки шага 2 внутри карточки ── */

.job-ui-auth__block--shell .job-ui-auth__h1 {
    margin-top: 0;
}

.job-ui-auth__foot {
    margin-top: 18px;
}

/* QR и ссылка текстом — только на компьютере: с телефона бот открывается кнопкой. */
.job-ui-auth__messenger-desktop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.job-ui-auth__messenger-desktop:not(:has(:not([hidden]))) {
    display: none;
}

@media (min-width: 768px) {
    /* десктопная типографика прототипа — те же компоненты, другие размеры */
    .job-ui-auth {
        --job-ui-auth-p-fs-h1: 28px;
        --job-ui-auth-p-fs-h2: 20px;
        --job-ui-auth-p-fs-small: 14px;
        --job-ui-auth-p-fs-fine: 13px;
        --job-ui-auth-p-ctl-h: 48px;
        --job-ui-auth-p-tap: 40px;
    }

    .job-ui-auth__block--shell .code-input {
        gap: 12px;
        max-width: 320px;
    }

    .job-ui-auth__block--shell .code-input__cell {
        max-height: 64px;
        font-size: 26px;
    }

    /* шторки становятся окнами по центру */
    .job-ui-auth__sheet-wrap {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        padding: 24px;
    }

    .job-ui-auth__sheet {
        width: 100%;
        max-width: 520px;
        max-height: 84%;
        padding: 26px 30px 30px;
        border-radius: var(--job-ui-auth-p-radius);
        box-shadow: var(--job-ui-auth-p-shadow-pop);
        animation: job-ui-auth-pop 0.18s ease;
    }

    .job-ui-auth__sheet-grip {
        display: none;
    }
}

/* ── мобильная оболочка прототипа ── */

@media (max-width: 767px) {
    .job-ui-auth__messenger-desktop {
        display: none !important;
    }

    body.job-ui-auth--shell {
        overflow: hidden;
    }

    body.job-ui-auth--shell .job-ui-auth__screen {
        display: block;
        min-height: 0;
        padding: 0;
    }

    body.job-ui-auth--shell .job-ui-auth__viewport {
        display: block;
        max-width: none;
    }

    /* карточка становится приложением: высота по видимой части окна, без рамки и тени */
    body.job-ui-auth--shell .job-ui-auth__card {
        display: flex;
        flex-direction: column;
        height: var(--job-ui-auth-vvh, 100dvh);
        padding: 0;
        border: 0;
        border-radius: 0;
        background: var(--job-ui-auth-p-bg);
        box-shadow: none;
        overflow: hidden;
    }

    body.job-ui-auth--shell .job-ui-auth__brand,
    body.job-ui-auth--shell .job-ui-auth__footnote {
        display: none;
    }

    body.job-ui-auth--shell .job-ui-auth__alert {
        margin: 12px var(--job-ui-auth-p-pad) 0;
    }

    body.job-ui-auth--shell .job-ui-auth__stack {
        flex: 1 1 auto;
        min-height: 0;
        grid-template-rows: minmax(0, 1fr);
    }

    body.job-ui-auth--shell .job-ui-auth__block--shell {
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 0;
    }

    body.job-ui-auth--shell .job-ui-auth__appbar {
        display: block;
        flex: 0 0 auto;
        padding: var(--job-ui-auth-p-sat) var(--job-ui-auth-p-pad) 0;
        border-bottom: 1px solid var(--job-ui-auth-p-line);
        background: var(--job-ui-auth-p-card);
    }

    body.job-ui-auth--shell .job-ui-auth__body {
        flex: 1 1 auto;
        min-height: 0;
        padding: 0 var(--job-ui-auth-p-pad) 18px;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.job-ui-auth--shell .job-ui-auth__block--shell .job-ui-auth__h1 {
        margin-top: 18px;
    }

    body.job-ui-auth--shell .job-ui-auth__foot {
        flex: 0 0 auto;
        margin-top: 0;
        padding: 12px var(--job-ui-auth-p-pad) calc(12px + var(--job-ui-auth-p-sab));
        border-top: 1px solid var(--job-ui-auth-p-line);
        background: var(--job-ui-auth-p-card);
        box-shadow: var(--job-ui-auth-p-shadow-up);
    }

    /* ссылки «Войти по паролю» в оболочке — по центру под таймером, как остальные */
    body.job-ui-auth--shell .job-ui-auth__block--shell .job-ui-auth__links {
        margin-top: 8px;
    }

    body.job-ui-auth--shell .job-ui-auth__block--shell .job-ui-auth__links:not(:has(:not([hidden]))) {
        display: none;
    }
}

/* Узкие телефоны: в прототипе это `.device.narrow`, здесь — ширина окна. */
@media (max-width: 360px) {
    .job-ui-auth {
        --job-ui-auth-p-pad: 12px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════════════
 * Вход Исполнителя по прототипу регистрации (правки 25.10–02.11): первый экран «Войдите или
 * зарегистрируйтесь», номер с карандашом, подписи под ячейками, карточка «Не хотите ждать SMS?».
 *
 * Всё ниже относится только к странице входа Исполнителя: новые классы есть лишь в её разметке,
 * а правила для общих классов формы заключены в карточку `[data-auth-shell]` — её у входа
 * заказчика нет, и его вид не меняется.
 * ═══════════════════════════════════════════════════════════════════════════════════════ */

/* межстрочный интервал прототипа (1.45 у всего приложения): строки ошибок, подписей, шапки */
.job-ui-auth__card[data-auth-shell] {
    line-height: 1.45;
}

/* логотип в шапке первого экрана; на компьютере и на экранах шага 2 шапки нет */
.job-ui-auth__wordmark {
    flex: 1;
    min-width: 0;
    color: var(--job-ui-auth-p-ink);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.4px;
    line-height: 1.45;
}

.job-ui-auth__wordmark b {
    color: var(--job-ui-auth-p-purple-dark);
    font-weight: 900;
}

/* заголовок первого экрана — только на телефоне, на компьютере над формой остаётся название */
.job-ui-auth__entry-title {
    display: none;
}

/* поле номера во всю ширину: обёртка intl-tel-input — inline-block и на широком экране
   сжималась по полю ввода, оставляя пустоту справа */
.job-ui-auth__card[data-auth-shell] .job-ui-auth__field > .iti {
    display: block;
    width: 100%;
}

/* номер с карандашом: нажатие возвращает к вводу номера */
.job-ui-auth__phedit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    border: none;
    background: none;
    color: var(--job-ui-auth-p-ink);
    font-family: inherit;
    font-size: inherit;
    font-weight: 700;
    white-space: nowrap;
    text-align: left;
    cursor: pointer;
}

.job-ui-auth__phedit svg {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    color: var(--job-ui-auth-p-purple-dark);
}

.job-ui-auth__phedit:hover svg {
    color: var(--job-ui-auth-p-purple);
}

.job-ui-auth__sub.job-ui-auth__phline {
    margin-top: 6px;
}

/* подпись под ячейками кода */
.job-ui-auth__smsnote {
    margin: 12px 0 0;
    color: var(--job-ui-auth-p-muted);
    font-size: var(--job-ui-auth-p-fs-fine);
    line-height: 1.4;
    overflow-wrap: anywhere;
}

/* при ошибке и после второй отправки подпись о задержке SMS не нужна */
.job-ui-auth__block--shell:has([data-auth-errmsg]:not([hidden])) [data-auth-otp-smsnote],
.job-ui-auth__block--shell:has([data-auth-otp-nosms]:not([hidden])) [data-auth-otp-smsnote] {
    display: none;
}

.job-ui-auth__timer--tight {
    min-height: 40px;
    margin-top: 4px;
}

/* Пустой держатель повтора (код истёк, отправка ещё не доступна) не оставляет дыры. */
.job-ui-auth__timer--tight:empty {
    display: none;
}

.job-ui-auth__linkbtn--tight {
    min-height: 36px;
    padding: 7px 4px;
}

/* ячейки на экранах кода — ближе к строке с номером */
.job-ui-auth__block--shell[data-auth-block="code"] .code-input,
.job-ui-auth__block--shell[data-auth-block="otp"] .code-input {
    margin-top: 14px;
}

/* ожидание мессенджера: короткая инструкция и строка ожидания поменьше */
.job-ui-auth__steps-list--compact {
    margin-top: 12px;
}

.job-ui-auth__steps-list--compact li {
    padding-bottom: 7px;
    line-height: 1.35;
}

.job-ui-auth__steps-list--compact li::before {
    width: 22px;
    height: 22px;
    font-size: 12px;
}

.job-ui-auth__spinrow--sm {
    gap: 9px;
    margin-top: 6px;
    color: var(--job-ui-auth-p-muted);
    font-size: var(--job-ui-auth-p-fs-small);
}

.job-ui-auth__spinrow--sm .job-ui-auth__spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* кнопки экрана ожидания: «Открыть …», другой мессенджер и SMS — подчёркнутыми ссылками;
   `:where` ограничивает правило страницей Исполнителя, не меняя его веса */
:where(.job-ui-auth__card[data-auth-shell]) [data-auth-messenger-foot="waiting"] {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

:where(.job-ui-auth__card[data-auth-shell]) [data-auth-messenger-foot="waiting"] .job-ui-auth__linkbtn {
    min-height: 36px;
    padding: 7px 4px;
    font-size: var(--job-ui-auth-p-fs-body);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

:where(.job-ui-auth__card[data-auth-shell]) [data-auth-confirm-sms] {
    min-height: 36px;
    padding: 7px 4px;
}

/* сервер не ответил — код не виноват: ячейки без красной рамки, как в прототипе */
.job-ui-auth__block--shell:has([data-auth-otp-action="timeout"]:not([hidden])) .code-input--error .code-input__cell {
    border-color: var(--job-ui-auth-p-line-2);
    background: var(--job-ui-auth-p-field-bg);
}

.job-ui-auth__block--shell:has([data-auth-otp-action="timeout"]:not([hidden])) .code-input--error .code-input__cell.is-filled {
    border-color: var(--job-ui-auth-p-purple);
    background: var(--job-ui-auth-p-card);
}

/* «Не хотите ждать SMS?» — карточка с кнопками мессенджеров под кодом из SMS */
.job-ui-auth__msgalt {
    padding: 11px 12px 12px;
    border-radius: var(--job-ui-auth-p-radius);
    background: var(--job-ui-auth-p-purple-soft2);
}

.job-ui-auth__msgalt-title {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--job-ui-auth-p-ink);
    font-size: var(--job-ui-auth-p-fs-body);
    font-weight: 800;
}

.job-ui-auth__msgalt-title svg {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    color: var(--job-ui-auth-p-purple);
}

.job-ui-auth__msgalt-sub {
    margin: 2px 0 10px;
    color: var(--job-ui-auth-p-muted);
    font-size: var(--job-ui-auth-p-fs-fine);
}

/* на входе карточки нет — пустой низ экрана не показываем */
.job-ui-auth__foot--otp:not(:has(> :not([hidden]))) {
    display: none;
}

@media (max-width: 767px) {
    /* страница Исполнителя на телефоне — приложение прототипа и на шагах без своей шапки */
    .job-ui-auth:has(.job-ui-auth__card[data-auth-shell]) .job-ui-auth__screen {
        display: block;
        min-height: 0;
        padding: 0;
    }

    .job-ui-auth:has(.job-ui-auth__card[data-auth-shell]) .job-ui-auth__viewport {
        display: block;
        max-width: none;
    }

    .job-ui-auth__card[data-auth-shell] {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: var(--job-ui-auth-p-bg);
        box-shadow: none;
    }

    /* в оболочке шага 2 высоту задаёт видимая часть окна: клавиатура не выталкивает низ */
    body.job-ui-auth--shell .job-ui-auth__card[data-auth-shell] {
        min-height: 0;
    }

    .job-ui-auth__card[data-auth-shell] > .job-ui-auth__brand {
        display: none;
    }

    .job-ui-auth__card[data-auth-shell] > .job-ui-auth__appbar--entry {
        display: block;
        flex: 0 0 auto;
        padding: var(--job-ui-auth-p-sat) var(--job-ui-auth-p-pad) 0;
        border-bottom: 1px solid var(--job-ui-auth-p-line);
        background: var(--job-ui-auth-p-card);
    }

    body.job-ui-auth--shell .job-ui-auth__card[data-auth-shell] > .job-ui-auth__appbar--entry {
        display: none;
    }

    .job-ui-auth__card[data-auth-shell] > .job-ui-auth__alert {
        margin: 12px var(--job-ui-auth-p-pad) 0;
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block:not(.job-ui-auth__block--shell) {
        padding: 0 var(--job-ui-auth-p-pad);
    }

    /* ── первый экран: заголовок, номер одной строкой с кодом страны, «Продолжить» ── */

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__entry-title {
        display: block;
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--entry .job-ui-auth__field {
        margin: 16px 0 0;
    }

    /* подпись поля остаётся для программ чтения с экрана, в прототипе её не видно */
    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--entry .job-ui-auth__label {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        border: 0;
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--entry .job-ui-auth__hint {
        display: none;
    }

    /* «Войти по паролю» и «Восстановление доступа» — экранов нет в прототипе,
       оформлены тем же языком, что и первый экран */
    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form .job-ui-auth__block-title {
        margin: 18px 0 0;
        color: var(--job-ui-auth-p-ink);
        font-size: var(--job-ui-auth-p-fs-h1);
        font-weight: 800;
        letter-spacing: -0.5px;
        line-height: 1.24;
        text-align: left;
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form:not(.job-ui-auth__block--entry) .job-ui-auth__field {
        margin: 16px 0 0;
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form:not(.job-ui-auth__block--entry) .job-ui-auth__label {
        margin-bottom: 6px;
        color: var(--job-ui-auth-p-ink-2);
        font-size: var(--job-ui-auth-p-fs-small);
        font-weight: 700;
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form:not(.job-ui-auth__block--entry) .job-ui-auth__hint {
        color: var(--job-ui-auth-p-muted);
        font-size: var(--job-ui-auth-p-fs-fine);
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form .job-ui-auth__hint:empty {
        display: none;
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form .job-ui-auth__link {
        color: var(--job-ui-auth-p-purple-dark);
        font-size: var(--job-ui-auth-p-fs-small);
        font-weight: 700;
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form .job-ui-auth__error {
        position: relative;
        margin-top: 8px;
        padding-left: 23px;
        color: var(--job-ui-auth-p-red-tx);
        font-size: var(--job-ui-auth-p-fs-small);
        font-weight: 600;
        line-height: 1.45;
        overflow-wrap: anywhere;
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form .job-ui-auth__error::before {
        content: '';
        position: absolute;
        top: 1px;
        left: 0;
        width: 16px;
        height: 16px;
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D64550' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.2M12 16.4h.01'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form .job-ui-auth__control {
        /* высота поля прототипа и две рамки по 1,5px: строка номера там — рамка вокруг поля */
        height: calc(var(--job-ui-auth-p-ctl-h) + 3px);
        min-height: 0;
        padding-right: 14px;
        border: 1.5px solid var(--job-ui-auth-p-line);
        border-radius: var(--job-ui-auth-p-radius);
        background: var(--job-ui-auth-p-field-bg);
        color: var(--job-ui-auth-p-ink);
        font-size: var(--job-ui-auth-p-fs-input);
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form .job-ui-auth__control::placeholder {
        color: var(--job-ui-auth-p-muted-2);
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form .job-ui-auth__control:hover {
        border-color: var(--job-ui-auth-p-line);
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form .job-ui-auth__control:focus {
        border-color: var(--job-ui-auth-p-purple);
        background: var(--job-ui-auth-p-card);
        box-shadow: none;
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form .job-ui-auth__control.is-invalid {
        border-color: var(--job-ui-auth-p-red-tx);
    }

    /* код страны: флаг, «+7» и стрелка, справа — разделитель, как кнопка `dialbtn` прототипа */
    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form .iti__country-container {
        padding: 1.5px;
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form .iti__selected-country {
        gap: 5px;
        padding: 0 18px 0 13px;
        cursor: pointer;
        border-radius: 14.5px 0 0 14.5px;
        background: linear-gradient(to right, var(--job-ui-auth-p-card) calc(100% - 8px), transparent calc(100% - 8px));
        color: var(--job-ui-auth-p-ink);
        font-size: var(--job-ui-auth-p-fs-body);
        font-weight: 600;
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form .iti__selected-country::after {
        content: '';
        position: absolute;
        top: 0;
        right: 8px;
        bottom: 0;
        width: 1.5px;
        background: var(--job-ui-auth-p-line);
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form .iti__selected-country-primary {
        display: contents;
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form .iti__selected-dial-code {
        order: 1;
        margin: 0;
        color: var(--job-ui-auth-p-ink);
        font-weight: 600;
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form .iti__arrow {
        order: 2;
        width: 15px;
        height: 15px;
        margin: 0;
        border: 0;
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237B8194' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / 15px 15px no-repeat;
        transform: none;
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form .iti__arrow--up {
        margin-top: 0;
        transform: rotate(180deg);
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form .job-ui-auth__actions {
        margin-top: 14px;
    }

    /* «Продолжить» — кнопка прототипа: без градиента и тени, запертая — серая */
    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form .job-ui-auth__button--primary {
        gap: 9px;
        min-height: var(--job-ui-auth-p-ctl-h);
        padding: 12px 18px;
        border: 1px solid transparent;
        border-radius: var(--job-ui-auth-p-radius-sm);
        background: var(--job-ui-auth-p-purple);
        box-shadow: none;
        color: #ffffff;
        font-size: var(--job-ui-auth-p-fs-body);
        font-weight: 700;
        line-height: 1.25;
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form .job-ui-auth__button--primary:hover,
    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form .job-ui-auth__button--primary:focus {
        background: var(--job-ui-auth-p-purple-dark);
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form .job-ui-auth__button--primary[disabled] {
        background: var(--job-ui-auth-p-gray-bg);
        color: var(--job-ui-auth-p-muted-2);
        opacity: 1;
    }

    /* согласие с офертой — мелкой строкой под кнопкой */
    .job-ui-auth__card[data-auth-shell] > .job-ui-auth__footnote {
        margin: 2px var(--job-ui-auth-p-pad) 0;
        padding: 0 0 16px;
        border: 0;
        border-radius: 0;
        background: none;
        color: var(--job-ui-auth-p-muted);
        font-size: 11.5px;
        line-height: 1.35;
        text-align: center;
    }

    .job-ui-auth__card[data-auth-shell] > .job-ui-auth__footnote a {
        color: var(--job-ui-auth-p-purple-dark);
    }

    /* ── экраны шага 2: кнопки сразу под содержимым, а не прижаты к низу экрана ──
       Когда содержимое выше экрана, тело прокручивается, а низ с кнопками остаётся на месте. */
    body.job-ui-auth--shell .job-ui-auth__block--shell::after {
        content: '';
        flex: 1 1 0;
        min-height: 0;
    }

    body.job-ui-auth--shell .job-ui-auth__body {
        flex: 0 1 auto;
        padding-bottom: 12px;
    }

    body.job-ui-auth--shell .job-ui-auth__foot {
        padding-top: 2px;
        padding-bottom: 16px;
        border-top: none;
        background: transparent;
        box-shadow: none;
    }
}

/* узкие телефоны (до 360): шрифты на ступень меньше, как `.device.narrow` прототипа */
@media (max-width: 360px) {
    .job-ui-auth {
        --job-ui-auth-p-fs-h1: 21px;
        --job-ui-auth-p-fs-h2: 18px;
        --job-ui-auth-p-fs-body: 15px;
        --job-ui-auth-p-fs-input: 16px;
        --job-ui-auth-p-fs-small: 13px;
        --job-ui-auth-p-fs-fine: 12px;
        --job-ui-auth-p-ctl-h: 48px;
    }

    .job-ui-auth__h1,
    body.job-ui-auth--shell .job-ui-auth__block--shell .job-ui-auth__h1 {
        margin-top: 14px;
    }

    .job-ui-auth__block--shell .code-input__cell {
        aspect-ratio: 1 / 1;
    }

    .job-ui-auth__block--shell .code-input,
    .job-ui-auth__block--shell[data-auth-block="code"] .code-input,
    .job-ui-auth__block--shell[data-auth-block="otp"] .code-input {
        margin-top: 12px;
    }
}

/* ── Проверка на телефонах от 320 до 440 точек (03.11) ──
   Только страница Исполнителя (`[data-auth-shell]`) и только телефон: вход заказчика и десктоп
   не меняются. */
@media (max-width: 767px) {
    /* Колонка блоков не шире экрана. Ячейка грида по умолчанию не уже самого широкого содержимого,
       а ряд ячеек кода (у каждой `aspect-ratio` и `max-height: 74px`) просит 4 × 74px: на 320 и 344
       экраны с кодом выходили за правый край, а при фокусе на ячейке весь экран уезжал влево. */
    .job-ui-auth__card[data-auth-shell] .job-ui-auth__stack {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Последнее слово абзаца, ошибки или подсказки не остаётся на строке одно
       («Осталось попыток: / 3», «Попробуйте / завтра», «до 5 / минут.») */
    .job-ui-auth__card[data-auth-shell] {
        text-wrap: pretty;
    }

    /* «Войти по паролю», «Забыли пароль?», «Вернуться ко входу»: шрифт страницы вместо системного
       шрифта кнопки и строка нажатия 40px */
    .job-ui-auth__card[data-auth-shell] .job-ui-auth__link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 40px;
        padding: 0 8px;
        font-family: inherit;
    }

    /* на формах пароля и восстановления текст ссылки остаётся на прежнем месте: 7 + 40 / 2 = 18 + 9 */
    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--form .job-ui-auth__links {
        margin-top: 7px;
    }

    /* на экране кода «Войти по паролю» — тем же видом и той же строкой, что «Забыли код?» над ней */
    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--shell .job-ui-auth__links {
        margin-top: 0;
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__block--shell .job-ui-auth__link {
        color: var(--job-ui-auth-p-purple-dark);
        font-size: var(--job-ui-auth-p-fs-small);
        font-weight: 600;
    }

    /* «Забыли код?», «Отправить код ещё раз»: кнопка во всю строку высотой 40px, строка та же */
    .job-ui-auth__card[data-auth-shell] .job-ui-auth__timer--tight .job-ui-auth__linkbtn--tight {
        min-height: 40px;
    }

    /* Номер с карандашом и ссылки под кнопками мессенджеров: зона нажатия больше видимой,
       а расстояния прототипа не меняются */
    .job-ui-auth__card[data-auth-shell] .job-ui-auth__phedit,
    .job-ui-auth__card[data-auth-shell] [data-auth-messenger-foot="waiting"] .job-ui-auth__linkbtn,
    .job-ui-auth__card[data-auth-shell] [data-auth-confirm-sms] {
        position: relative;
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__phedit::after,
    .job-ui-auth__card[data-auth-shell] [data-auth-messenger-foot="waiting"] .job-ui-auth__linkbtn::after,
    .job-ui-auth__card[data-auth-shell] [data-auth-confirm-sms]::after {
        content: '';
        position: absolute;
        inset: -2px 0;
    }

    .job-ui-auth__card[data-auth-shell] .job-ui-auth__phedit::after {
        inset: -9px -4px;
    }

    /* под «Получить код по SMS» на экране выбора — только поле футера, над ней кнопка Telegram */
    .job-ui-auth__card[data-auth-shell] [data-auth-confirm-sms]::after {
        inset: 0 0 -4px;
    }
}

/* ── Решения владельца 03.11, только страница исполнителя (`[data-auth-shell]`) ── */

/* Экран пароля как экран кода: заголовок «Введите пароль» и номер с карандашом над полем.
   Подпись «Пароль» не видна (её дублирует заголовок), но остаётся для программ чтения с экрана. */
.job-ui-auth__card[data-auth-shell] .job-ui-auth__pw-title {
    margin-top: 0;
}

.job-ui-auth__card[data-auth-shell] [data-auth-block="password"] .job-ui-auth__phline {
    margin-bottom: 16px;
}

.job-ui-auth__card[data-auth-shell] [data-auth-block="password"] .job-ui-auth__label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Общие ошибки над формой («Код заблокирован…», «Приглашение недействительно…») — красной
   строкой со значком, как ошибки полей и экранов регистрации, а не розовой плашкой.
   Сообщения-подсказки (`--info`) остаются плашкой. */
.job-ui-auth__card[data-auth-shell] > .job-ui-auth__alert--danger {
    position: relative;
    padding: 0 0 0 23px;
    border: none;
    border-radius: 0;
    background: none;
    color: var(--job-ui-auth-p-red-tx);
    font-size: var(--job-ui-auth-p-fs-small);
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.job-ui-auth__card[data-auth-shell] > .job-ui-auth__alert--danger::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 0;
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D64550' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.2M12 16.4h.01'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
}

@media (max-width: 767px) {
    .job-ui-auth__card[data-auth-shell] .job-ui-auth__pw-title {
        margin-top: 18px;
    }

    .job-ui-auth__card[data-auth-shell] [data-auth-block="password"] .job-ui-auth__phline {
        margin-bottom: 0;
    }

    .job-ui-auth__card[data-auth-shell] > .job-ui-auth__alert--danger {
        margin: 16px var(--job-ui-auth-p-pad) 0;
    }
}

/* Виджет чата поддержки (UseDesk) на телефоне поднимается над сноской об оферте, иначе закрывает её. */
@media (max-width: 767px) {
    body.job-ui-auth--shell:has([data-auth-footnote]:not([hidden])) .uw__buttons-list {
        transform: translateY(-96px);
    }
}
