/* =========================================================================
   СЕКИРА — экран авторизации (Приложение Г.2 / Г.3).
   Двухколоночная раскладка: брендинг слева, карточка входа справа.
   ========================================================================= */

.auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(420px, 44%) 1fr;
}

/* ---------- Левая колонка: брендинг ---------- */
.auth__brand {
    position: relative;
    z-index: 1;
    overflow: hidden;
    padding: 64px 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(155deg, #fcfcfd 0%, #f1f3f6 60%, #eceff3 100%);
    box-shadow: 24px 0 60px -28px rgba(20, 28, 46, .18);
}
[data-theme="dark"] .auth__brand { box-shadow: 24px 0 60px -24px rgba(0, 0, 0, .55); }
[data-theme="dark"] .auth__brand {
    background:
        radial-gradient(85% 65% at 30% 115%, rgba(40, 88, 199, .20), transparent 55%),
        radial-gradient(70% 60% at 92% -12%, rgba(80, 120, 255, .10), transparent 55%),
        linear-gradient(155deg, #131f30 0%, #0a1019 70%);
}

/* Гранёный «кристалл» сверху-слева (светлая) / светящаяся секира снизу (тёмная) */
.auth__brand::before {
    content: ""; position: absolute; top: 0; left: 0; width: 68%; height: 78%; pointer-events: none;
    background: url("../img/brand-facets.svg") no-repeat top left / contain;
    opacity: .9;
}
[data-theme="dark"] .auth__brand::before {
    top: auto; bottom: -40px; left: 50%; transform: translateX(-50%);
    width: 300px; height: 300px;
    background: url("../img/logo-mark.svg") no-repeat center / contain;
    opacity: .16; filter: drop-shadow(0 0 55px rgba(40, 88, 199, .35));
}

/* Точечный полутон (halftone) снизу-слева */
.auth__brand::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(circle, rgba(24, 33, 54, .10) 1.1px, transparent 1.7px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(115% 80% at 18% 118%, #000 0%, transparent 62%);
    mask-image: radial-gradient(115% 80% at 18% 118%, #000 0%, transparent 62%);
}
[data-theme="dark"] .auth__brand::after {
    background-image: radial-gradient(circle, rgba(255, 255, 255, .06) 1.1px, transparent 1.7px);
}

/* Тлеющие «искры» — только тёмная тема */
.auth__embers { position: absolute; inset: 0; pointer-events: none; display: none; }
[data-theme="dark"] .auth__embers { display: block; }
.auth__embers span {
    position: absolute; width: 4px; height: 4px; border-radius: 50%;
    background: #ff5a3c; box-shadow: 0 0 8px 2px rgba(255, 90, 60, .7);
    opacity: .8; animation: ember 4s var(--ease) infinite;
}
.auth__embers span:nth-child(1) { left: 10%; bottom: 18%; animation-delay: 0s; }
.auth__embers span:nth-child(2) { left: 20%; bottom: 30%; width: 3px; height: 3px; animation-delay: .8s; }
.auth__embers span:nth-child(3) { left: 28%; bottom: 12%; animation-delay: 1.6s; }
.auth__embers span:nth-child(4) { left: 15%; bottom: 40%; width: 2px; height: 2px; animation-delay: 2.4s; }
.auth__embers span:nth-child(5) { left: 33%; bottom: 26%; width: 3px; height: 3px; animation-delay: 3.1s; }
@keyframes ember { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: .9; } 100% { transform: translateY(-70px); opacity: 0; } }

.auth__brand-inner { position: relative; z-index: 1; width: 100%; max-width: 380px; }
.auth__logo { margin-bottom: 22px; text-align: center; }
.auth__logo .sk-logo-mark { height: 86px; width: auto; margin: 0 auto; }
.auth__logo-name { font-size: 46px; font-weight: 800; letter-spacing: .14em; color: var(--text); margin-top: 18px; text-transform: uppercase; }
.auth__logo-tagline { font-size: 12.5px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--text-muted); margin-top: 6px; }
[data-theme="dark"] .auth__logo-name { color: #fff; }

.auth__slogan { max-width: 340px; font-size: 17px; line-height: 1.55; color: var(--text-2); margin-top: 30px; }
.auth__rule { width: 48px; height: 4px; border-radius: 2px; background: var(--brand); margin: 28px 0; }

.auth__features { display: flex; flex-direction: column; gap: 22px; position: relative; z-index: 1; }
.auth__feature { display: flex; align-items: flex-start; gap: 16px; }
.auth__feature-ic {
    flex: none; width: 48px; height: 48px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #fff; color: var(--brand);
    border: 1px solid rgba(20, 28, 46, .05);
    box-shadow: 0 10px 22px -8px rgba(20, 28, 46, .20), 0 3px 6px -2px rgba(20, 28, 46, .10);
}
[data-theme="dark"] .auth__feature-ic {
    background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .09);
    box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .55);
}
.auth__feature-title { font-weight: 700; font-size: 15.5px; color: var(--text); }
.auth__feature-desc { font-size: 13.5px; color: var(--text-muted); margin-top: 2px; }

.auth__copyright { position: absolute; left: 56px; bottom: 40px; z-index: 1; font-size: 13px; color: var(--text-muted); }

/* ---------- Правая колонка: форма ---------- */
.auth__main {
    position: relative; display: flex; flex-direction: column; padding: 28px 40px 32px;
    background: linear-gradient(180deg, #ffffff 0%, #f4f6f9 100%);
}
[data-theme="dark"] .auth__main {
    background:
        radial-gradient(58% 48% at 88% 10%, rgba(40, 88, 199, .16), transparent 62%),
        radial-gradient(52% 52% at 8% 92%, rgba(90, 130, 255, .10), transparent 62%),
        linear-gradient(180deg, #0d1420, #0b111b);
}
.auth__topbar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }

/* Переключатель языка */
.lang { }
.lang__btn {
    display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
    color: var(--text); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-sm);
    transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.lang__btn:hover { border-color: var(--border-strong); }
.lang__btn .chev { transition: transform var(--dur) var(--ease); color: var(--text-muted); }
.lang.open .lang__btn .chev { transform: rotate(180deg); }
.lang__panel { min-width: 160px; }
.lang__opt { justify-content: space-between; }
.lang__opt .sk-icon { color: var(--brand); }

.auth__center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 0; }

.auth-card {
    position: relative;
    width: 100%; max-width: 520px;
    padding: 48px 48px 44px;
    border-radius: 24px;
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    backdrop-filter: blur(16px) saturate(1.2);
    border: 1px solid #ECEFF3;
    box-shadow:
        0 32px 64px -30px rgba(20, 28, 46, .30),
        0 14px 30px -20px rgba(20, 28, 46, .14),
        0 1px 3px rgba(20, 28, 46, .05);
}
/* Красный акцент-ореол — только в тёмной теме */
.auth-card::before {
    content: ""; position: absolute; inset: -3px; z-index: -1; border-radius: inherit;
    background: radial-gradient(120% 90% at 92% 2%, rgba(40, 88, 199, .28), transparent 52%);
    filter: blur(28px); opacity: 0; pointer-events: none;
}
[data-theme="dark"] .auth-card {
    background: linear-gradient(158deg, rgba(28, 38, 56, .80) 0%, rgba(17, 25, 39, .66) 100%);
    border-color: rgba(255, 255, 255, .10);
    box-shadow:
        0 48px 96px -26px rgba(0, 0, 0, .68),
        0 22px 44px -20px rgba(0, 0, 0, .5),
        0 2px 6px rgba(0, 0, 0, .3),
        inset 0 1px 0 rgba(255, 255, 255, .10);
}
[data-theme="dark"] .auth-card::before { opacity: .55; }
.auth-card__title { font-size: 30px; font-weight: 800; text-align: center; letter-spacing: -.01em; }
.auth-card__subtitle { text-align: center; color: var(--text-muted); margin-top: 8px; font-size: 14.5px; }
.auth-form { margin-top: 32px; }

/* Поля ввода */
.field { margin-bottom: 20px; }
.field__label { display: block; font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.field__control { position: relative; display: flex; align-items: center; }
.field__icon { position: absolute; left: 16px; color: var(--field-icon); pointer-events: none; }
.field__input {
    width: 100%; height: 54px; padding: 0 16px 0 48px;
    background: var(--field-bg); border: 1.5px solid var(--field-border); border-radius: var(--r-md);
    color: var(--text); font-size: 15px; font-family: inherit;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.field__input::placeholder { color: var(--placeholder); }
.field__input:hover { border-color: var(--border-strong); }
.field__input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
[data-theme="light"] .auth-card .field__input { background: #F6F7FA; border-color: #E7EAF0; }
[data-theme="light"] .auth-card .field__input:focus { background: #fff; border-color: var(--brand); }
.field__input.has-toggle { padding-right: 52px; }
.field__toggle {
    position: absolute; right: 10px; width: 36px; height: 36px; border: none; background: transparent;
    display: flex; align-items: center; justify-content: center; color: var(--field-icon); border-radius: var(--r-sm);
    transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.field__toggle:hover { color: var(--text-2); background: var(--surface-2); }
.field__toggle .icon-eye-off { display: none; }
.field__error { display: none; margin-top: 7px; font-size: 13px; color: var(--brand); }
.field.is-invalid .field__input { border-color: var(--brand); }
.field.is-invalid .field__error { display: block; }

/* Строка «запомнить / забыли пароль» */
.auth-form__row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 26px; }
.checkbox { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 14px; color: var(--text-2); }
.checkbox input { position: absolute; opacity: 0; width: 0; height: 0; }
.checkbox__box {
    width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--border-strong);
    background: var(--field-bg); display: inline-flex; align-items: center; justify-content: center;
    color: #fff; transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.checkbox__box .sk-icon { opacity: 0; transform: scale(.6); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.checkbox input:checked + .checkbox__box { background: var(--brand); border-color: var(--brand); }
.checkbox input:checked + .checkbox__box .sk-icon { opacity: 1; transform: scale(1); }
.checkbox input:focus-visible + .checkbox__box { box-shadow: var(--ring); }
.auth-form__forgot { font-size: 14px; font-weight: 500; }

.auth-form__submit { height: 56px; font-size: 16px; }

/* Разделитель «или войдите с помощью» */
.auth-divider { display: flex; align-items: center; gap: 16px; margin: 26px 0; color: var(--text-muted); font-size: 13.5px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Футер внизу правой части (вне карточки) */
.auth__foot { display: flex; align-items: center; justify-content: center; gap: 30px; flex-wrap: wrap; padding-top: 20px; }
.auth__foot .footer__link { font-size: 13.5px; }

/* ---------- Адаптив ---------- */
@media (max-width: 980px) {
    .auth { grid-template-columns: 1fr; }
    .auth__brand { display: none; }
    .auth__main { padding: 20px; }
}
@media (max-width: 520px) {
    .auth-card { padding: 30px 22px 28px; border-radius: var(--r-lg); }
    .auth-card__title { font-size: 26px; }
    .auth-footer { gap: 16px; }
}

/* Плашка ошибки авторизации (сервер) */
.auth-alert {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 18px; padding: 11px 14px;
    border-radius: var(--r-md, 10px);
    background: color-mix(in srgb, var(--danger, #2858C7) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--danger, #2858C7) 40%, transparent);
    color: var(--danger, #2858C7);
    font-size: 14px; line-height: 1.35;
}
.auth-alert .sk-icon { flex: none; }
