/* =====================================================================
   renet.DOCS · Страницы входа (catalog/templates/base_auth.html, префикс au-)
   Тёмная объёмная сеть во весь экран (canvas, js/auth_nodes.js), знак портала
   собирается из узлов, затем загорается РЕНЕТ КОМ и запускается пульс;
   форма — матовое стекло. Палитра — фирменная РЕНЕТ КОМ: индиго + красный.
   Шрифты: Geologica / Golos Text (fonts-2.css), JetBrainsMono (fonts.css).

   Классы состояния на <html> (ставит инлайн-скрипт base_auth.html и auth_nodes.js):
     au-intro  — играет интро (первый заход за сессию вкладки);
     au-landed — узлы сели в знак: рисуются знак и логотип;
     au-wait   — ждём шрифты: содержимое прозрачно (не дольше 1,5 с).
   ===================================================================== */

.au {
    --au-bg: #221C62;
    --au-bg-glow: #4D43AE;
    --au-indigo: #3A3286;
    --au-red: #E3242B;
    --au-red-hot: #FF4148;
    --au-red-soft: #FF8A8E;
    --au-lilac: #CFCAFF;
    --au-text: #FFFFFF;
    --au-text-2: rgba(255, 255, 255, .78);
    --au-text-3: rgba(255, 255, 255, .55);
    --au-line: rgba(255, 255, 255, .2);
    --au-glass: rgba(255, 255, 255, .09);
    --au-f-display: "Geologica", "Golos Text", "Segoe UI", sans-serif;
    --au-f-body: "Golos Text", "Segoe UI", system-ui, sans-serif;
    --au-f-mono: "JetBrainsMono", Consolas, "Courier New", monospace;
    --au-gutter: clamp(16px, 4vw, 48px);
    --au-ease: cubic-bezier(.2, .8, .2, 1);

    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    color: var(--au-text);
    font: 400 15px/1.45 var(--au-f-body);
    -webkit-font-smoothing: antialiased;
    background:
        radial-gradient(900px 700px at 20% 30%, var(--au-bg-glow), rgba(77, 67, 174, 0) 65%),
        radial-gradient(800px 600px at 95% 105%, rgba(227, 36, 43, .36), rgba(227, 36, 43, 0) 60%),
        var(--au-bg);
    background-attachment: fixed;
}
.au-body { margin: 0; background: #221C62; }
/* сброс — через :where(), с нулевой специфичностью: не перебивает классы компонентов */
:where(.au) *, :where(.au) *::before, :where(.au) *::after { box-sizing: border-box; margin: 0; }
:where(.au) ul { padding: 0; list-style: none; }
:where(.au) :is(button, input) { font: inherit; color: inherit; }
:where(.au) :is(a, button, input) { -webkit-tap-highlight-color: transparent; }
:where(.au) :focus { outline: none; }

/* поле узлов — неподвижный слой во весь экран: при прокрутке не обрывается */
.au__nodes { position: fixed; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
.au__top, .au__wrap, .au__foot { position: relative; z-index: 1; }

/* ---------------- шапка: РЕНЕТ КОМ и статус ---------------- */
.au__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: max(24px, env(safe-area-inset-top)) var(--au-gutter) 0;
}
.au-renet { display: flex; align-items: center; gap: 16px; }
.au-renet__logo { position: relative; display: block; flex: none; width: 104px; }
.au-renet__cap {
    padding-left: 16px;
    border-left: 1px solid var(--au-line);
    font: 400 10.5px/1.4 var(--au-f-mono);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--au-text-3);
}
/* светлая подвспышка под молнией — играет один раз в интро */
.au-renet__logo::before {
    content: "";
    position: absolute;
    left: 46%;
    top: 52%;
    width: 210%;
    height: 190%;
    transform: translate(-50%, -50%);
    background: radial-gradient(closest-side, rgba(255, 255, 255, .6), rgba(255, 65, 72, .28) 42%, transparent 72%);
    opacity: 0;
    pointer-events: none;
}
.au-logo { position: relative; display: block; width: 100%; height: auto; overflow: visible; shape-rendering: geometricPrecision; --rn-ink: #FFFFFF; --rn-bolt: var(--au-red-hot); }
.au-logo .rn-ring path,
.au-logo .rn-txt > * { fill: var(--rn-ink); stroke: var(--rn-ink); stroke-linejoin: round; }
.au-logo .rn-ring path { stroke-width: 25.39; }
.au-logo .rn-txt > * { stroke-width: 7.62; }
.au-logo .rn-bolt { fill: var(--rn-bolt); }
.au-logo .rn-ring { transform-box: view-box; transform-origin: 50% 50%; }
.au-status {
    font: 400 10.5px/1 var(--au-f-mono);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--au-text-3);
    white-space: nowrap;
}
.au-status b { color: var(--au-text); font-weight: 500; }
.au-status i { display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--au-red-hot); vertical-align: 1px; animation: au-beat 1.6s ease-out infinite; }
@keyframes au-beat { 0%, 30%, 100% { transform: scale(1); } 18% { transform: scale(1.7); } }

/* ---------------- сцена: знак + текст слева, форма справа ---------------- */
.au__wrap {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    grid-template-areas: "hub card" "hero card";
    align-content: center;
    column-gap: clamp(32px, 5vw, 80px);
    row-gap: clamp(20px, 4.5vh, 44px);
    padding: 24px clamp(16px, 6vw, 104px) 56px;
}
.au__hub { grid-area: hub; align-self: end; width: clamp(170px, 18vw, 260px); }
.au__hero { grid-area: hero; align-self: start; min-width: 0; max-width: 680px; }
.au__card { grid-area: card; align-self: center; min-width: 0; }

.au-mark { display: block; width: 100%; height: auto; overflow: visible; --renet-ink: #FFFFFF; --renet-accent: var(--au-red-hot); }
.au-mark .mk-frame, .au-mark .mk-node { transform-box: fill-box; transform-origin: center; }

.au-hero__eyebrow { font: 500 11px/1.3 var(--au-f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--au-red-soft); }
.au-hero__title {
    margin-top: 14px;
    font: 200 clamp(38px, 4.5vw, 66px)/1 var(--au-f-display);
    letter-spacing: -.035em;
    color: var(--au-text);
    text-wrap: balance;
}
.au-hero__title b { font-weight: 500; letter-spacing: -.03em; color: var(--au-lilac); }
.au-hero__title em { font-style: normal; font-weight: 500; color: var(--au-red-hot); }
.au-mods { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 22px; font: 400 11px/1.2 var(--au-f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--au-text-3); }
.au-mods li { position: relative; padding-left: 12px; transition: color .4s ease; }
.au-mods li::before { content: ""; position: absolute; left: 0; top: 50%; width: 5px; height: 5px; margin-top: -3px; border-radius: 50%; background: rgba(255, 255, 255, .22); transition: background-color .4s ease, transform .4s ease; }
.au-mods li.is-live { color: var(--au-text); }
.au-mods li.is-live::before { background: var(--au-red-hot); transform: scale(1.4); }

/* ---------------- стеклянная карточка ---------------- */
.au__card {
    width: 100%;
    padding: 30px 30px 26px;
    border-radius: 26px;
    background: var(--au-glass);
    border: 1px solid var(--au-line);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
            backdrop-filter: blur(22px) saturate(150%);
    box-shadow: 0 40px 90px -30px rgba(8, 5, 40, .7), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.au-card__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; font: 400 10.5px/1 var(--au-f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--au-text-3); }
.au-card__bar b { color: var(--au-text); font-weight: 500; }
.au-card__port { display: flex; gap: 4px; }
.au-card__port i { width: 7px; height: 7px; border-radius: 2px; background: rgba(255, 255, 255, .18); }
.au-card__port i.on { background: rgba(255, 255, 255, .75); }
.au-card__port i.hot { background: var(--au-red-hot); animation: au-beat 1.6s ease-out infinite; }
.au-card__title { margin-bottom: 20px; font: 300 30px/1.08 var(--au-f-display); letter-spacing: -.02em; text-wrap: balance; }

/* ---------------- форма ---------------- */
.au-form { display: grid; gap: 18px; }
.au-field { display: grid; gap: 7px; }
.au-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.au-label { font: 500 12.5px/1.2 var(--au-f-body); letter-spacing: .01em; color: var(--au-text-2); }
.au-link {
    font-size: 12.5px;
    color: var(--au-text);
    opacity: .8;
    text-decoration: none;
    background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
    transition: background-size .25s ease, opacity .18s ease;
}
.au-link:hover { opacity: 1; background-size: 100% 1px; }
.au-link:focus-visible { opacity: 1; outline: 2px solid currentColor; outline-offset: 3px; border-radius: 3px; }
.au-link:active { opacity: .6; }
.au-control { position: relative; display: flex; }
.au-input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 10px;
    background: rgba(255, 255, 255, .08);
    color: var(--au-text);
    font-size: 16px;   /* не меньше 16px — iOS не масштабирует страницу при фокусе */
    -webkit-appearance: none;
            appearance: none;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.au-input--pass { padding-right: 50px; letter-spacing: .04em; }
.au-input:hover { border-color: rgba(255, 255, 255, .4); }
.au-input:focus-visible { border-color: #fff; background: rgba(255, 255, 255, .14); box-shadow: 0 0 0 4px rgba(255, 255, 255, .14); }

/* автозаполнение браузера (сохранённый логин): цвет текста, фон и шрифт поля остаются нашими.
   Chromium/Safari красят фон UA-стилем — откладываем его «вечным» transition, поле остаётся стеклом. */
.au .au-input:is(:autofill, :-webkit-autofill) {
    -webkit-text-fill-color: var(--au-text);
    caret-color: var(--au-text);
    filter: none;
    transition: background-color 0s 600000s, color 0s 600000s, border-color .2s ease, box-shadow .2s ease;
}
.au .au-input:-webkit-autofill::first-line { font-family: var(--au-f-body); font-size: 16px; }

.au-eye {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--au-text);
    cursor: pointer;
    opacity: .6;
    transition: opacity .18s ease, background-color .18s ease, transform .12s ease;
}
.au-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.au-eye .au-eye__slash { opacity: 0; transition: opacity .18s ease; }
.au-eye[aria-pressed="true"] .au-eye__slash { opacity: 1; }
.au-eye:hover { opacity: 1; background: rgba(255, 255, 255, .08); }
.au-eye:focus-visible { opacity: 1; box-shadow: 0 0 0 2px var(--au-text); }
.au-eye:active { transform: scale(.92); }

.au-caps { margin-top: -8px; font: 500 11px/1.2 var(--au-f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--au-red-soft); }
.au-alert { padding: 11px 14px; border-radius: 10px; border: 1px solid rgba(255, 65, 72, .55); background: rgba(227, 36, 43, .22); font-size: 13.5px; line-height: 1.4; }
.au-alert b { font-weight: 600; }
.au-alert--info { border-color: var(--au-line); background: rgba(255, 255, 255, .08); }

.au-submit {
    position: relative;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 10px;
    background: #fff;
    color: var(--au-indigo);
    font: 500 15px/1 var(--au-f-display);
    letter-spacing: .02em;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, box-shadow .25s ease, transform .12s ease, opacity .2s ease;
}
.au-submit svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s ease; }
.au-submit:hover { background: var(--au-red); color: #fff; box-shadow: 0 14px 30px -12px rgba(227, 36, 43, .8); }
.au-submit:hover svg { transform: translateX(4px); }
.au-submit:focus-visible { box-shadow: 0 0 0 3px var(--au-bg), 0 0 0 5px #fff; }
.au-submit:active { transform: translateY(1px) scale(.995); }
.au-submit[aria-busy="true"] { opacity: .7; cursor: progress; }

/* =====================================================================
   Цепочка пароля: восстановление, смена, выход
   (include/_auth_card_bar · _auth_field · _auth_action · _auth_glyph)
   ===================================================================== */
/* строка карточки: шаг цепочки рядом с «портом» */
.au-card__meta { display: flex; align-items: center; gap: 10px; }
.au-card__step b { color: var(--au-text); font-weight: 500; }

/* пояснение под заголовком карточки */
.au-lead { margin: -8px 0 20px; font-size: 14px; line-height: 1.5; color: var(--au-text-2); text-wrap: pretty; }
.au-lead b { color: var(--au-text); font-weight: 600; }
.au-lead + .au-lead { margin-top: -12px; }

/* поле с ошибкой: красная рамка, список ошибок под полем */
.au-field--invalid .au-input { border-color: rgba(255, 65, 72, .75); background: rgba(227, 36, 43, .12); }
.au-field--invalid .au-input:hover { border-color: var(--au-red-soft); }
.au-field--invalid .au-input:focus-visible { border-color: var(--au-red-soft); background: rgba(227, 36, 43, .16); box-shadow: 0 0 0 4px rgba(255, 65, 72, .22); }
.au-errors { display: grid; gap: 3px; font-size: 12.5px; line-height: 1.35; color: var(--au-red-soft); }
.au-errors li, .au-help__body li { position: relative; padding-left: 14px; }
.au-errors li::before, .au-help__body li::before { content: ""; position: absolute; left: 2px; top: .52em; width: 5px; height: 5px; border-radius: 50%; background: var(--au-red-hot); }

/* требования Django к паролю (help_text — HTML-список валидаторов): свёрнуты, раскрыты при ошибке */
.au-help { font-size: 12.5px; }
.au-help summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 4px;
    list-style: none;
    font: 500 11px/1.2 var(--au-f-mono);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--au-text-3);
    cursor: pointer;
    transition: color .18s ease, opacity .18s ease;
}
.au-help summary::-webkit-details-marker { display: none; }
.au-help summary::before { content: ""; width: 5px; height: 5px; margin-top: -2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .2s ease, margin .2s ease; }
.au-help[open] summary::before { margin-top: -4px; transform: rotate(45deg); }
.au-help summary:hover { color: var(--au-text); }
.au-help summary:focus-visible { color: var(--au-text); outline: 2px solid currentColor; outline-offset: 3px; }
.au-help summary:active { opacity: .6; }
.au-help__body ul { display: grid; gap: 4px; margin-top: 8px; padding: 10px 12px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 10px; background: rgba(255, 255, 255, .06); line-height: 1.4; color: var(--au-text-2); }
.au-help__body li::before { background: var(--au-lilac); opacity: .7; }

/* совпадение нового пароля и повтора (auth_nodes.js, data-auth-match) */
.au-match { margin-top: -8px; font: 500 11px/1.2 var(--au-f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--au-red-soft); transition: color .2s ease; }
.au-match.is-ok { color: var(--au-lilac); }

/* кнопка-ссылка и второстепенная кнопка */
.au-submit { text-decoration: none; }
.au-submit--ghost { background: transparent; color: var(--au-text); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.au-submit--ghost:hover { background: rgba(255, 255, 255, .1); color: var(--au-text); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7); }
.au-submit--ghost:focus-visible { box-shadow: inset 0 0 0 1px #fff, 0 0 0 3px var(--au-bg), 0 0 0 5px #fff; }
.au-actions { display: grid; gap: 10px; }

/* нижняя строка карточки: «ко входу», «запросить снова» */
.au-card__foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .12); }
.au-link--back::before { content: "← "; }

/* итоговая карточка: пиктограмма + заголовок в строку */
.au-state { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.au-state .au-card__title { margin-bottom: 0; }

/* пиктограмма состояния (include/_auth_glyph.html): белые линии, красный узел с пульсом, расходящееся кольцо */
.au-glyph {
    position: relative;
    flex: none;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border: 1px solid var(--au-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16);
}
.au-glyph::after { content: ""; position: absolute; inset: -1px; border: 1px solid var(--au-red-hot); border-radius: inherit; opacity: 0; pointer-events: none; animation: au-ping 3.2s ease-out 1s infinite; }
.au-glyph svg { width: 34px; height: 34px; overflow: visible; }
.au-glyph__line, .au-glyph__mark { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.au-glyph__line { stroke: #fff; stroke-width: 2.2; }
.au-glyph__mark { stroke: var(--au-red-hot); stroke-width: 2.8; stroke-dasharray: 1; stroke-dashoffset: 0; }
.au-glyph__node { fill: var(--au-red-hot); transform-box: fill-box; transform-origin: center; animation: au-beat 1.6s ease-out infinite; }
/* отметка «рисуется» после загрузки шрифтов (au-wait снят) */
:where(html:not(.au-wait)) .au-glyph__mark { animation: au-draw-in .6s var(--au-ease) .25s both; }
@keyframes au-draw-in { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes au-ping { 0% { opacity: .65; transform: scale(1); } 55%, 100% { opacity: 0; transform: scale(1.32); } }

/* ---------------- подвал ---------------- */
.au__foot {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 0 var(--au-gutter) max(20px, env(safe-area-inset-bottom));
    font: 400 10.5px/1.3 var(--au-f-mono);
    letter-spacing: .06em;
    color: var(--au-text-3);
}

/* =====================================================================
   Состояния
   ===================================================================== */
/* ошибка входа: интро нет, форма один раз вздрагивает */
.au--error .au-form { animation: au-shake .42s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes au-shake {
    15%, 85% { transform: translateX(-2px); }
    30%, 70% { transform: translateX(4px); }
    45%, 55% { transform: translateX(-6px); }
}
/* ждём шрифты (не дольше 1,5 с): текст не перескакивает с запасного шрифта; поля уже принимают ввод */
.au-wait .au__top, .au-wait .au__wrap, .au-wait .au__foot { opacity: 0; }

/* интро: 0–1.6 с сеть наводит резкость и собирает знак (canvas); после посадки — рамка и связи
   знака, затем РЕНЕТ КОМ: кольцо, буквы, молния с подвспышкой; затем пульс (canvas) */
.au-intro .au__card { animation: au-focus 1.6s cubic-bezier(.3, 0, .2, 1) .1s both; }
.au-intro .au-renet__cap,
.au-intro .au-status,
.au-intro .au__foot { animation: au-focus-soft 1.2s cubic-bezier(.3, 0, .2, 1) .3s both; }
.au-intro .au__hero > * { animation: au-rise .7s var(--au-ease) both; animation-delay: calc(1.05s + var(--i, 0) * 90ms); }
.au-intro:not(.au-landed) .au__hub .mk-node,
.au-intro:not(.au-landed) .au__hub .mk-spoke,
.au-intro:not(.au-landed) .au__hub .mk-frame,
.au-intro:not(.au-landed) .au-renet__logo .au-logo { opacity: 0; }
.au-intro.au-landed .au__hub .mk-frame { animation: au-frame .5s var(--au-ease) both; }
.au-intro.au-landed .au__hub .mk-spoke { stroke-dasharray: 1; stroke-dashoffset: 1; animation: au-draw .3s ease-out both; animation-delay: calc(var(--i) * 40ms); }
.au-intro.au-landed .au-renet__logo .rn-ring { animation: au-ring .7s var(--au-ease) .25s both; }
.au-intro.au-landed .au-renet__logo .rn-txt > * { animation: au-letter .45s var(--au-ease) both; animation-delay: calc(.45s + var(--i) * 60ms); }
.au-intro.au-landed .au-renet__logo .rn-bolt { animation: au-bolt .3s cubic-bezier(.7, 0, .9, .4) .85s both; }
.au-intro.au-landed .au-renet__logo::before { animation: au-flash .9s ease-out 1.08s both; }

@keyframes au-focus { from { opacity: 0; filter: blur(16px); transform: scale(1.04); } 35% { opacity: 1; } }
@keyframes au-focus-soft { from { opacity: 0; filter: blur(8px); } }
@keyframes au-rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes au-frame { from { opacity: 0; transform: scale(.7) rotate(-8deg); } }
@keyframes au-draw { to { stroke-dashoffset: 0; } }
@keyframes au-ring { from { opacity: 0; transform: rotate(-90deg) scale(.7); } }
@keyframes au-letter { from { opacity: 0; transform: translateY(900px); } }
@keyframes au-bolt { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes au-flash { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: 0; } }

/* =====================================================================
   Размеры экрана
   ===================================================================== */
/* ноутбук: карточка уже, текст мельче */
@media (max-width: 1180px) {
    .au__wrap { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); column-gap: clamp(28px, 4vw, 56px); padding-inline: clamp(16px, 5vw, 64px); }
    .au-hero__title { font-size: clamp(34px, 4.4vw, 54px); }
}

/* до 960: логотипа РЕНЕТ КОМ нет (бренд — в подвале), шапка не нужна; две колонки плотнее */
@media (max-width: 960px) {
    .au__top { display: none; }
    .au__wrap { grid-template-columns: minmax(0, 1fr) minmax(290px, 360px); column-gap: 28px; padding-top: max(32px, env(safe-area-inset-top)); }
    .au__hub { width: clamp(130px, 17vw, 180px); }
    .au-hero__title { font-size: clamp(28px, 4.4vw, 42px); }
    .au-mods { gap: 5px 14px; font-size: 10px; }
}

/* до 780: левая колонка узкая — подпись и список разделов убираем, остаются знак и заголовок */
@media (max-width: 780px) {
    .au-hero__eyebrow, .au-mods { display: none; }
    .au-hero__title { margin-top: 0; font-size: clamp(26px, 4.4vw, 32px); }
}

/* низкий экран рядом с формой (ноутбук 1366×768, окно браузера с панелями) */
@media (min-width: 647px) and (max-height: 780px) {
    .au__top { padding-top: 16px; }
    .au-renet__logo { width: 84px; }
    .au__wrap { row-gap: 18px; padding-block: 12px 32px; }
    .au__hub { width: clamp(130px, 14vw, 200px); }
    .au-hero__title { font-size: clamp(28px, 3.8vw, 50px); }
    .au-mods { margin-top: 16px; }
    .au__card { padding: 24px 26px 22px; }
    .au-card__title { margin-bottom: 16px; font-size: 26px; }
    .au-form { gap: 14px; }
}
/* совсем низкий: только суть */
@media (min-width: 647px) and (max-height: 600px) {
    .au__hub { width: 120px; }
    .au-hero__eyebrow, .au-mods { display: none; }
    .au-hero__title { margin-top: 0; font-size: clamp(26px, 3.4vw, 40px); }
    .au__foot { display: none; }
}

/* до 646: одна колонка по центру — знак портала, под ним форма, ниже заголовок;
   подпись «renet.DOCS · портал сотрудников» и список разделов убраны */
@media (max-width: 646px) {
    .au__wrap {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "hub" "card" "hero";
        justify-items: center;
        align-content: start;
        row-gap: 22px;
        padding: max(28px, env(safe-area-inset-top)) var(--au-gutter) 32px;
    }
    /* знак, форма и заголовок — одна колонка ширины формы, всё по её левому краю;
       пульс идёт от знака до правого края формы (auth_nodes.js) */
    .au__hub, .au__card, .au__hero { width: 100%; max-width: 440px; }
    .au__hub { align-self: auto; }
    .au__hub .au-mark { width: 112px; }
    .au__hero { padding-top: 4px; }
    .au-hero__eyebrow, .au-mods { display: none; }
    .au-hero__title { margin-top: 0; font-size: clamp(26px, 7vw, 36px); }
    .au__foot { justify-content: center; }
    .au__foot > span:first-child { display: none; }
}
@media (max-width: 400px) {
    .au__wrap { row-gap: 18px; padding-top: max(20px, env(safe-area-inset-top)); }
    .au__hub .au-mark { width: 92px; }
    .au__card { padding: 22px 18px 20px; border-radius: 20px; }
    .au-card__title { font-size: 25px; margin-bottom: 16px; }
    .au-form { gap: 15px; }
}

/* телефон боком: снова две колонки, всё сжато — форма целиком в экране.
   Только от 647px: уже двум колонкам не хватает места (форма ≥300px), там всегда одна колонка */
@media (min-width: 647px) and (max-width: 960px) and (max-height: 520px) and (orientation: landscape) {
    .au-hero__eyebrow, .au-mods, .au__foot, .au-card__bar { display: none; }
    .au__wrap {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
        grid-template-areas: "hub card" "hero card";
        justify-items: stretch;
        align-content: center;
        row-gap: 12px;
        padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
    }
    .au__hub { align-self: end; width: 84px; max-width: none; }
    .au__hub .au-mark { width: 100%; }
    .au__card, .au__hero { max-width: none; }
    .au__hero { padding-top: 0; }
    .au-hero__title { margin-top: 0; font-size: 26px; }
    .au__card { padding: 16px 18px; border-radius: 18px; }
    .au-card__title { margin-bottom: 10px; font-size: 20px; }
    .au-form { gap: 10px; }
    .au-input { height: 42px; }
    .au-eye { top: 2px; }
    .au-submit { height: 44px; }
}

/* цепочка пароля на тех же размерах экрана */
@media (min-width: 647px) and (max-height: 780px) {
    .au-lead { margin-bottom: 16px; }
    .au-state { margin-bottom: 16px; }
    .au-card__foot { margin-top: 16px; padding-top: 12px; }
}
@media (max-width: 400px) {
    .au-card__step { display: none; }       /* шаг виден по «порту» */
    .au-lead { margin-bottom: 16px; font-size: 13.5px; }
    .au-state { gap: 14px; margin-bottom: 16px; }
    .au-glyph { width: 50px; height: 50px; border-radius: 14px; }
    .au-glyph svg { width: 30px; height: 30px; }
    .au-card__foot { margin-top: 16px; padding-top: 14px; }
}
@media (min-width: 647px) and (max-width: 960px) and (max-height: 520px) and (orientation: landscape) {
    .au-lead { display: none; }
    .au-state { gap: 12px; margin-bottom: 12px; }
    .au-glyph { width: 42px; height: 42px; border-radius: 12px; }
    .au-glyph svg { width: 26px; height: 26px; }
    .au-actions { gap: 8px; }
    .au-card__foot { margin-top: 10px; padding-top: 0; border-top: 0; }
    .au-match, .au-caps { margin-top: -4px; }
}

@media (prefers-reduced-motion: reduce) {
    .au *, .au *::before, .au *::after { animation: none !important; transition-duration: .01ms !important; }
}
