/* Страницы входа (layout auth): слева тёмная панель с потоками каналов, справа карточка формы */
.auth {
    --auth-ink: #151923;
    --auth-display: "Unbounded", "Arial Black", system-ui, sans-serif;
    --auth-alert: #c2412d;
    --auth-alert-soft: #fbe5e3;
    --auth-shadow: 0 1px 2px rgba(21, 25, 35, .06), 0 18px 40px -18px rgba(21, 25, 35, .28);
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    background: var(--bg);
    color: var(--text);
}

/* ---------- Левая панель ---------- */
.auth__stage {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: var(--auth-ink);
    color: #e6e9f0;
    padding: 40px clamp(28px, 4vw, 56px);
    display: flex;
    flex-direction: column;
}
.auth__stage::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(55% 45% at 72% 52%, rgba(107, 149, 255, .22), transparent 70%);
    pointer-events: none;
}
.auth__streams { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.auth__streams path { fill: none; stroke-width: 1.5; stroke-dasharray: 4 10; opacity: .55; animation: auth-flow 2.4s linear infinite; }
@keyframes auth-flow { to { stroke-dashoffset: -28; } }

.auth-brand { display: inline-flex; align-items: center; gap: 10px; font: 700 17px/1 var(--auth-display); color: #fff; }
.auth-brand__mark { width: 30px; height: 30px; border-radius: 9px; background: var(--primary); display: grid; place-items: center; }
.auth-brand__mark i { width: 12px; height: 12px; border: 2px solid #fff; border-radius: 3px 3px 3px 0; display: block; }

.auth__floats { position: relative; height: 250px; margin: 36px 0 8px; }
.auth-float {
    position: absolute;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 12px;
    color: #c6cdda;
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .6);
    will-change: transform;
    transition: transform .25s ease-out;
}
.auth-float b { color: #fff; font-weight: 500; font-size: 13px; }
.auth-float--ticket { left: 0; top: 18px; width: 260px; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; animation: auth-drift 7s ease-in-out infinite; }
.auth-float--ticket small { font: 500 10px/1 var(--font-mono); color: #8a93a6; margin-left: 4px; }
.auth-float--ticket span:not(.auth-float__av) { display: block; color: #8a93a6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth-float__av { width: 30px; height: 30px; border-radius: 9px; background: #c2412d; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 11px; position: relative; }
.auth-float__av::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 10px; height: 10px; border-radius: 50%; background: #4cc27f; border: 2px solid var(--auth-ink); }
.auth-float--sla { right: 8%; top: 0; text-align: center; animation: auth-drift 8s -2s ease-in-out infinite; }
.auth-float__num { display: block; font: 500 24px var(--font-mono); color: #fff; }
.auth-float--feed { left: 22%; bottom: 0; width: 290px; display: grid; gap: 8px; animation: auth-drift 9s -4s ease-in-out infinite; }
.auth-feed-row { display: flex; align-items: center; gap: 8px; }
.auth-feed-row i { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 25%, transparent); color: var(--c); font-style: normal; font-size: 11px; }
.auth-feed-row time { margin-left: auto; font: 400 10px/1 var(--font-mono); color: #7d8699; }
.auth-live { font: 500 10px/1 var(--font-mono); letter-spacing: .1em; color: #ff8a75; display: inline-flex; gap: 6px; align-items: center; }
.auth-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #ff8a75; animation: auth-pulse 1.4s infinite; }
@keyframes auth-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 138, 117, .6); } 100% { box-shadow: 0 0 0 8px rgba(255, 138, 117, 0); } }
@keyframes auth-drift { 50% { translate: 0 -8px; } }

.auth__copy { margin-top: auto; max-width: 440px; }
.auth__eyebrow { font: 500 11px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: #8fb0ff; display: inline-flex; gap: 10px; align-items: center; }
.auth__eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; }
.auth__copy h2 { font: 800 clamp(28px, 3vw, 40px)/1.08 var(--auth-display); margin: 16px 0 14px; letter-spacing: -.01em; color: #fff; text-wrap: balance; }
.auth__copy h2 em { font-style: normal; color: #8fb0ff; }
.auth__copy p { margin: 0; color: #a7b0c2; }
.auth__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.auth__chips span { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; border-radius: 99px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .04); font-size: 12px; color: #c6cdda; }
.auth__chips i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }

/* ---------- Карточка формы ---------- */
.auth__panel { display: grid; place-items: center; padding: 40px 24px; position: relative; }
.auth__panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(color-mix(in srgb, var(--text-2) 22%, transparent) 1px, transparent 1px);
    background-size: 20px 20px;
    mask-image: radial-gradient(70% 60% at 50% 50%, #000, transparent);
    pointer-events: none;
}
.auth-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--auth-shadow);
    padding: clamp(24px, 4vw, 36px);
    animation: auth-rise .7s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes auth-rise { from { transform: translateY(18px); opacity: 0; } }
.auth-card__eyebrow { font: 500 11px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--primary); }
.auth-card h1 { font: 700 26px/1.15 var(--auth-display); margin: 12px 0 6px; letter-spacing: -.01em; }
.auth-card__sub { margin: 0 0 26px; color: var(--text-2); font-size: 14px; }
.auth-card__sub b { color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.auth-card__foot { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--border); font-size: 13px; color: var(--text-2); display: flex; gap: 10px; align-items: center; }
.auth-card__shield { width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--success-50); color: var(--success-600); }

.auth-back { display: inline-flex; margin-right: 12px; color: var(--text-2); text-decoration: none; font-size: 13px; margin-bottom: 18px; }
.auth-back:hover { color: var(--text); }
.auth-link { color: var(--primary); text-decoration: none; font-size: 14px; font-weight: 500; }
.auth-link:hover { text-decoration: underline; }
.auth-link--muted { color: var(--text-2); }

/* Поля */
.auth-field { margin-bottom: 16px; }
.auth-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.auth-label { font-size: 13px; font-weight: 500; margin: 0; }
.auth-label-row .auth-link { font-size: 13px; }
.auth-control { position: relative; }
.auth-control > svg { position: absolute; left: 13px; top: 50%; translate: 0 -50%; color: var(--text-2); pointer-events: none; }
.auth-input {
    width: 100%;
    height: 46px;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    padding: 0 14px;
    font: 400 15px var(--font-ui);
    transition: border-color .15s, box-shadow .15s;
}
.auth-control .auth-input { padding-left: 40px; }
.auth-input--pass { padding-right: 46px; }
.auth-input::placeholder { color: var(--text-muted); }
.auth-input:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border-strong)); }
.auth-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); }
.auth-field.is-invalid .auth-input { border-color: var(--auth-alert); }
.auth-field.is-invalid .auth-input:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--auth-alert) 16%, transparent); }
.auth-error { margin-top: 6px; font-size: 12px; color: var(--auth-alert); }
.auth-error:empty { display: none; }
.auth-hint { margin-top: 6px; font-size: 12px; color: var(--text-2); }
.auth-reveal { position: absolute; right: 4px; top: 50%; translate: 0 -50%; width: 38px; height: 38px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.auth-reveal:hover { color: var(--text); background: var(--bg); }

.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 22px; }
.auth-row--end { margin: 18px 0 0; }
.auth-check { margin: 0; }
.auth-check label { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; user-select: none; margin: 0; }
.auth-switch { appearance: none; width: 36px; height: 20px; border-radius: 99px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .2s; margin: 0; flex: none; }
.auth-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: translate .2s; }
.auth-switch:checked { background: var(--primary); }
.auth-switch:checked::after { translate: 16px 0; }
.auth-switch:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.auth-caps { display: none; font: 500 11px/1 var(--font-mono); color: #8a5600; background: #fdf1d8; padding: 5px 8px; border-radius: 6px; }
.auth-caps.is-on { display: inline-block; }

.auth-btn {
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 11px;
    background: var(--primary);
    color: #fff;
    font: 600 15px/1 var(--font-ui);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 10px 24px -12px var(--primary);
    transition: background .2s, transform .2s, box-shadow .2s;
}
.auth-btn:hover { background: var(--primary-600); color: #fff; transform: translateY(-1px); box-shadow: 0 14px 28px -12px var(--primary); }
.auth-btn svg { transition: translate .2s; }
.auth-btn:hover svg { translate: 3px 0; }
.auth-btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--border-strong); box-shadow: none; }
.auth-btn--ghost:hover { background: var(--bg); color: var(--text); transform: none; box-shadow: none; }

/* Код 2FA: JS раскладывает поле на шесть ячеек */
.auth-otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.auth-otp input { width: 100%; min-width: 0; height: 54px; text-align: center; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 500 22px var(--font-mono); transition: border-color .15s, box-shadow .15s; }
.auth-otp input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); }
.auth-otp input:nth-child(3) { margin-right: 6px; }
.auth-field.is-invalid .auth-otp input { border-color: var(--auth-alert); }
[data-otp] { font-family: var(--font-mono); letter-spacing: .08em; }

/* Состояния без формы: письмо отправлено, ссылка устарела */
.auth-state { text-align: center; }
.auth-state__icon { width: 64px; height: 64px; margin: 6px auto 16px; border-radius: 18px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); position: relative; }
.auth-state__icon::after { content: ""; position: absolute; inset: -8px; border-radius: 24px; border: 1px solid color-mix(in srgb, currentColor 35%, transparent); animation: auth-ping 2.4s ease-out infinite; }
.auth-state__icon--alert { background: var(--auth-alert-soft); color: var(--auth-alert); }
@keyframes auth-ping { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
.auth-state__note { margin: 14px 0 0; font-size: 13px; color: var(--text-2); }
.auth-state__note .auth-link { font-size: 13px; }

/* ---------- Адаптив ---------- */
@media (max-width: 960px) {
    .auth { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
    .auth__stage { padding: 20px 16px 28px; }
    .auth__floats, .auth__copy p, .auth__chips { display: none; }
    .auth__copy { margin-top: 18px; }
    .auth__copy h2 { font-size: 22px; margin: 10px 0 0; }
    .auth__panel { padding: 0 16px 32px; align-items: start; }
    .auth-card { margin-top: -14px; }
}
@media (max-width: 420px) {
    .auth-card { border-radius: 16px; }
    .auth-card h1 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
    .auth *, .auth *::before, .auth *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
