/* Split auth layout — mockups/15-login.html (without Gosuslugi). */
html:has(.auth-layout),
html:has(.auth-layout) body {
    height: 100dvh;
    overflow: hidden;
}

body:has(.auth-layout) {
    margin: 0;
    min-height: 100dvh;
}

html:has(.auth-layout),
.auth-main,
.auth-org-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 23, 42, 0.35) transparent;
}

html.dark:has(.auth-layout),
html.dark .auth-main,
html.dark .auth-org-list {
    scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

html:has(.auth-layout)::-webkit-scrollbar,
.auth-main::-webkit-scrollbar,
.auth-org-list::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

html:has(.auth-layout)::-webkit-scrollbar-track,
.auth-main::-webkit-scrollbar-track,
.auth-org-list::-webkit-scrollbar-track {
    background: transparent;
}

html:has(.auth-layout)::-webkit-scrollbar-thumb,
.auth-main::-webkit-scrollbar-thumb,
.auth-org-list::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.35);
    border-radius: 999px;
}

html.dark:has(.auth-layout)::-webkit-scrollbar-thumb,
html.dark .auth-main::-webkit-scrollbar-thumb,
html.dark .auth-org-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.28);
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
    height: 100dvh;
    background: var(--bg);
}

.auth-side {
    background: var(--gray-900);
    color: #fff;
    padding: 40px 56px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    contain: paint;
}

.auth-side::after {
    content: "";
    position: absolute;
    width: 640px;
    height: 640px;
    border-radius: 50%;
    right: -260px;
    bottom: -300px;
    background: radial-gradient(circle at 30% 30%, rgba(107, 140, 255, 0.55), rgba(107, 140, 255, 0) 65%);
    pointer-events: none;
}

.auth-side .auth-brand {
    color: #fff;
    position: relative;
    z-index: 1;
}

.auth-side .auth-brand-mark {
    background: #fff;
    color: var(--gray-900);
    box-shadow: none;
}

.auth-side-copy {
    margin-top: auto;
    position: relative;
    z-index: 1;
    max-width: 480px;
}

.auth-side-copy h2 {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0;
}

.auth-side-copy > p {
    color: rgba(255, 255, 255, 0.65);
    margin: 14px 0 0;
    max-width: 460px;
    font-size: 15px;
    line-height: 1.5;
}

.auth-side-stats {
    display: flex;
    gap: 32px;
    margin-top: 36px;
}

.auth-side-stats b {
    display: block;
    font-size: 24px;
    letter-spacing: -0.02em;
    font-weight: 700;
}

.auth-side-stats span {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
}

.auth-side-quote {
    margin-top: 48px;
    padding: 18px 20px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    max-width: 460px;
    position: relative;
    z-index: 1;
}

.auth-side-quote cite {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    font-style: normal;
    color: rgba(255, 255, 255, 0.55);
}

.auth-main {
    display: grid;
    place-items: center;
    padding: 40px 24px;
    background: var(--bg);
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.auth-mobile-brand {
    display: none;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 28px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--ui-primary, hsl(var(--primary)));
    color: var(--primary-fg, #fff);
    display: grid;
    place-items: center;
    flex: none;
    padding: 6px;
}

.auth-brand-mark svg {
    width: 100%;
    height: 100%;
}

.auth-brand-name {
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.1;
    font-size: 15px;
}

.auth-brand-name small {
    display: block;
    font-weight: 500;
    font-size: 11px;
    color: var(--text-3);
    letter-spacing: 0.04em;
}

.auth-form {
    width: 100%;
    max-width: 400px;
}

.auth-form > h1,
.auth-form .auth-heading h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0 0 6px;
    color: var(--text, hsl(var(--foreground)));
}

.auth-lead {
    color: var(--text-2, hsl(var(--muted-foreground)));
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.5;
}

.auth-heading {
    margin-bottom: 4px;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--ui-primary, hsl(var(--primary)));
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 18px;
    text-decoration: none;
}

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

.auth-link {
    color: var(--ui-primary, hsl(var(--primary)));
    font-weight: 500;
    font-size: 13px;
    text-decoration: none;
}

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

.auth-org-pick {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--ui-border, hsl(var(--border)));
    border-radius: var(--r-md, 10px);
    background: var(--surface, hsl(var(--card)));
    font-size: 13px;
    margin-bottom: 16px;
}

.auth-org-sq {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--info-500, #7c5cfc);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700;
    flex: none;
}

.auth-org-pick-body {
    flex: 1;
    min-width: 0;
}

.auth-org-pick strong {
    display: block;
    font-weight: 600;
    color: var(--text, hsl(var(--foreground)));
}

.auth-org-pick .auth-org-meta {
    display: block;
    font-size: 12px;
    color: var(--text-3, hsl(var(--muted-foreground)));
}

.auth-org-sq img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.auth-org-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: calc(100dvh - 14rem);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
    margin-right: -2px;
}

.auth-org-choice-form {
    margin: 0;
}

button.auth-org-choice {
    width: 100%;
    margin: 0;
    cursor: pointer;
    font: inherit;
    color: inherit;
    text-align: left;
}

button.auth-org-choice:hover {
    border-color: var(--ui-primary, hsl(var(--primary)));
    background: var(--primary-soft, hsl(var(--accent)));
}

button.auth-org-choice:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.auth-org-choice-go {
    display: grid;
    place-items: center;
    color: var(--text-3, hsl(var(--muted-foreground)));
}

.auth-sso-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 38px;
    padding: 0 14px;
    border-radius: var(--r-md, 10px);
    border: 1px solid var(--ui-border, hsl(var(--border)));
    background: var(--surface, hsl(var(--card)));
    color: var(--text, hsl(var(--foreground)));
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
}

.auth-sso-btn:hover {
    border-color: var(--border-strong, hsl(var(--border)));
    background: var(--surface-muted, hsl(var(--muted)));
}

.auth-sso-btn svg {
    width: 16px;
    height: 16px;
    flex: none;
}

.auth-sso-details {
    width: 100%;
}

.auth-sso-details > summary {
    list-style: none;
}

.auth-sso-details > summary::-webkit-details-marker {
    display: none;
}

.auth-sso-panel {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--ui-border, hsl(var(--border)));
    border-radius: var(--r-md, 10px);
    background: var(--surface, hsl(var(--card)));
}

.auth-sso-panel .auth-lead {
    margin-bottom: 10px;
}

.auth-or {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-3, hsl(var(--muted-foreground)));
    font-size: 12px;
    margin: 20px 0;
}

.auth-or::before,
.auth-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--ui-border, hsl(var(--border)));
}

.auth-form .ui-field {
    margin-bottom: 12px;
}

.auth-form .ui-field-message {
    min-height: 0;
}

.auth-form .ui-field-message:not(:has(.ui-field-message--error)) {
    display: none;
}

.auth-form .ui-label {
    font-size: 13px;
    font-weight: 500;
}

.auth-form .ui-input,
.auth-form .auth-login-form .ui-input {
    height: 40px;
    border-radius: 10px;
    background: var(--surface, hsl(var(--card)));
    box-shadow: none;
    padding-left: 12px;
    padding-right: 12px;
}

.auth-form .ui-input:focus,
.auth-form .ui-input:focus-visible {
    border-color: var(--ui-primary, hsl(var(--primary)));
    box-shadow: var(--focus-ring);
    outline: none;
}

.auth-password-wrap {
    position: relative;
}

.auth-password-wrap .ui-input {
    padding-right: 40px;
}

.auth-password-toggle {
    position: absolute;
    right: 2px;
    top: 1px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--text-2, hsl(var(--muted-foreground)));
    border-radius: 8px;
    cursor: pointer;
}

.auth-password-toggle:hover {
    color: var(--text, hsl(var(--foreground)));
    background: var(--surface-sunken, hsl(var(--muted)));
}

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

.auth-field-row .ui-label {
    margin: 0;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    cursor: pointer;
    margin: 4px 0 16px;
    color: var(--text, hsl(var(--foreground)));
}

.auth-remember input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    accent-color: var(--ui-primary, #3b63f0);
    flex: none;
}

.auth-submit,
.auth-form .ui-btn-primary,
a.auth-submit {
    height: 44px;
    padding: 0 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    width: 100%;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.auth-copy-btn {
    width: auto;
    height: 32px;
    padding: 0 12px;
    font-size: 12px;
}

.auth-sso-follow {
    margin-bottom: 10px;
    text-decoration: none;
}

.auth-login-form > .auth-sso-btn {
    margin-top: 10px;
}

.auth-alert-gap {
    margin-bottom: 16px;
}

.auth-login-form .auth-password-hints {
    margin-bottom: 16px;
}

.auth-help {
    text-align: center;
    font-size: 13px;
    color: var(--text-2, hsl(var(--muted-foreground)));
    margin: 16px 0 0;
    line-height: 1.5;
}

.auth-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 24px;
    font-size: 12px;
    color: var(--text-3, hsl(var(--muted-foreground)));
}

.auth-footer-lang {
    margin: 0;
}

.auth-footer-lang button {
    border: 0;
    background: none;
    padding: 0;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.auth-footer-lang button:hover,
.auth-footer-lang button.is-active {
    color: var(--text-2, hsl(var(--muted-foreground)));
}

.auth-footer #lms-public-theme button {
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    color: var(--text-3, hsl(var(--muted-foreground)));
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.auth-footer #lms-public-theme button:hover {
    background: var(--surface-sunken, hsl(var(--muted)));
    color: var(--text, hsl(var(--foreground)));
}

.auth-switch {
    text-align: center;
    font-size: 13px;
    margin-top: 16px;
}

.auth-debug {
    margin-top: 16px;
    text-align: center;
}

@media (max-width: 900px) {
    html:has(.auth-layout),
    html:has(.auth-layout) body {
        height: auto;
        min-height: 100dvh;
        overflow: auto;
    }

    .auth-layout {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100dvh;
    }

    .auth-side {
        display: none;
    }

    .auth-mobile-brand {
        display: flex;
    }

    .auth-main {
        padding: 32px 20px 48px;
        align-content: start;
        justify-items: center;
        overflow: visible;
    }

    .auth-org-list {
        max-height: min(60vh, 28rem);
    }
}
