body {
    min-height: 100vh;
    margin: 0;
    background: var(--surface-sunken);
    color: var(--text);
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

.auth-box {
    width: 100%;
    max-width: 420px;
}

.auth-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.auth-brand .brand {
    width: 168px;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px 32px;
    box-shadow: var(--shadow-menu);
}

.auth-title {
    font-size: 23px;
    font-weight: 600;
    letter-spacing: -.01em;
    margin: 0 0 6px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 26px;
}

.auth-field {
    margin-bottom: 18px;
}

.auth-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 7px;
}

.auth-input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    font-size: 15px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.auth-input::placeholder {
    color: var(--text-faint);
}

.auth-input:focus {
    border-color: var(--emerald-400);
    box-shadow: 0 0 0 3px var(--emerald-50);
}

.auth-input.is-invalid {
    border-color: var(--danger);
}

.auth-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(240, 82, 75, .12);
}

.auth-error {
    display: block;
    font-size: 13px;
    color: var(--danger);
    margin-top: 6px;
}

.auth-password {
    position: relative;
}

.auth-password .auth-input {
    padding-right: 44px;
}

.auth-password-toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-faint);
    background: none;
    border: 0;
    cursor: pointer;
}

.auth-password-toggle:hover {
    color: var(--text-muted);
}

.auth-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.auth-remember input {
    width: 16px;
    height: 16px;
    accent-color: var(--emerald-700);
    cursor: pointer;
}

.auth-link {
    font-size: 14px;
    color: var(--accent-text);
    text-decoration: none;
}

.auth-link:hover {
    color: var(--emerald-900);
    text-decoration: underline;
}

.auth-submit {
    width: 100%;
    height: 48px;
    font-size: 15px;
    font-weight: 600;
    color: var(--surface);
    background: var(--text);
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s;
}

.auth-submit:hover {
    background: var(--gray-600);
}

.auth-submit:focus-visible {
    outline: 3px solid var(--emerald-200);
    outline-offset: 2px;
}

.auth-alert {
    display: flex;
    gap: 10px;
    font-size: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 22px;
    background: var(--alert-bg);
    color: var(--alert-text);
}

.auth-alert i {
    margin-top: 2px;
}

.auth-switch {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    margin: 22px 0 0;
}

.auth-switch a {
    color: var(--accent-text);
    font-weight: 500;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-version {
    text-align: center;
    font-size: 12px;
    color: var(--text-faint);
    font-variant-numeric: tabular-nums;
    margin: 18px 0 0;
}

.auth-hint {
    font-size: 12.5px;
    color: var(--text-faint);
    margin-top: 6px;
}

@media (max-width: 480px) {
    .auth-card {
        padding: 28px 22px;
    }
}

/* Кнопка-ссылка на заглушке: выглядит как submit, но ведёт на вход. */
.auth-submit.is-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

/*
 * На входе подпись стоит отдельной строкой под версией. Центрируем саму
 * ссылку через margin: она инлайн-флекс, и justify-content на ней
 * управляет содержимым, а не положением в строке.
 */
a.made-by.auth-made-by {
    display: inline-flex;
    margin: 10px auto 0;
}

/* Обёртка нужна, чтобы auto-margin было от чего отсчитывать. */
.auth-version + a.made-by {
    display: flex;
    width: fit-content;
}

/*
 * Кнопка-ссылка в подписи под карточкой: выход со страницы «подтвердите
 * почту» — это POST скрытой формы (кнопка привязана атрибутом form),
 * но выглядеть должна как соседние ссылки.
 */
.auth-link-button {
    border: 0;
    padding: 0;
    background: none;
    color: var(--accent-text);
    font-size: inherit;
    font-weight: 500;
    cursor: pointer;
}

.auth-link-button:hover {
    text-decoration: underline;
}

/* «Забыли пароль?» в строке с чекбоксом входа. */
.auth-forgot {
    font-size: 14px;
    font-weight: 500;
    color: var(--accent-text);
    text-decoration: none;
}

.auth-forgot:hover {
    text-decoration: underline;
}
