/* Единая страница авторизации (/login, /register). Отдельный лист стилей —
   страница не наследует app-shell дашборда (style.css) и не тянет весь
   лендинг (landing.css), только сама тёмная auth-тема. */

:root {
    --au-black: #050505;
    --au-white: #FFFFFF;
    --au-ink: #111111;
    --au-muted: #6B6D6A;
    --au-border: rgba(0, 0, 0, 0.1);
    --au-lime: #A8FF00;
    --au-lime-press: #8FDE00;
    --au-danger: #D0432B;
    --au-success: #2F9E6E;
    --au-tab-bg: #EFEFEC;
    --au-radius-lg: 24px;
    --au-radius-md: 14px;
    --au-radius-sm: 10px;
    --font-sans: 'Golos Text', 'Onest', -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

.au-body {
    margin: 0;
    min-height: 100vh;
    background: var(--au-black);
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px);
    background-size: 22px 22px;
    color: var(--au-white);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 64px 16px 40px;
}

a { color: inherit; }

:focus-visible {
    outline: 2px solid var(--au-lime);
    outline-offset: 2px;
    border-radius: 6px;
}

.au-page {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.au-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 28px;
    font-weight: 800;
    font-size: 19px;
    letter-spacing: -0.01em;
    text-decoration: none;
    color: var(--au-white);
}

/* --- Card --- */
.au-card {
    width: 100%;
    background: var(--au-white);
    color: var(--au-ink);
    border-radius: var(--au-radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    padding: 22px;
}

/* --- Tabs --- */
.au-tabs {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--au-tab-bg);
    border-radius: 999px;
    padding: 4px;
    margin-bottom: 22px;
}

.au-tabs-thumb {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc(50% - 4px);
    background: var(--au-black);
    border-radius: 999px;
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), width 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.au-body[data-mode="register"] .au-tabs-thumb { transform: translateX(100%); }

.au-tab {
    position: relative;
    z-index: 1;
    appearance: none;
    background: transparent;
    border: 0;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--au-ink);
    border-radius: 999px;
    cursor: pointer;
    min-height: 40px;
    transition: color 160ms ease;
}

.au-tab[aria-selected="true"] { color: var(--au-white); }

/* --- Content viewport (height-animated, clips the slide) --- */
.au-viewport {
    overflow: hidden;
    transition: height 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.au-body-inner { position: relative; }

.au-panel {
    animation: au-panel-in 180ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.au-panel[hidden] { display: none; }

.au-panel.au-leaving {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    animation: au-panel-out 130ms ease both;
    pointer-events: none;
}

@keyframes au-panel-in {
    from { opacity: 0; transform: translateX(8px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes au-panel-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-8px); }
}

.au-body[data-mode="login"] #au-panel-register.au-panel:not([hidden]):not(.au-leaving) { animation-name: au-panel-in; }

@media (prefers-reduced-motion: reduce) {
    .au-tabs-thumb { transition: none; }
    .au-viewport { transition: none; }
    .au-panel, .au-panel.au-leaving { animation: none; }
}

/* --- Titles --- */
.au-title { margin: 4px 0 4px; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.au-subtitle { margin: 0 0 18px; font-size: 14px; color: var(--au-muted); }

/* --- Errors (reserved space so the card doesn't jump) --- */
.au-form-error {
    min-height: 0;
    font-size: 13px;
    color: var(--au-danger);
    margin-bottom: 0;
}
.au-form-error:not(:empty) { min-height: 18px; margin-bottom: 12px; }

.au-field-error {
    display: block;
    min-height: 16px;
    font-size: 12px;
    color: var(--au-danger);
    margin-top: 4px;
}

/* --- Fields --- */
.au-field { margin-bottom: 14px; }
.au-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }

.au-field input[type="email"],
.au-field input[type="password"],
.au-field input[type="text"] {
    width: 100%;
    font-family: inherit;
    font-size: 14px;
    padding: 12px 14px;
    border-radius: var(--au-radius-sm);
    border: 1px solid var(--au-border);
    background: var(--au-white);
    color: var(--au-ink);
    min-height: 44px;
    transition: border-color 140ms ease;
}
.au-field input::placeholder { color: #9A9C98; }
.au-field input:focus { outline: none; border-color: var(--au-ink); }
.au-field input:invalid[data-touched] { border-color: var(--au-danger); }

.au-password-field { position: relative; }
.au-password-field input { padding-right: 44px; }
.au-eye {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    color: var(--au-muted);
    cursor: pointer;
}
.au-eye svg { width: 18px; height: 18px; }
.au-eye:hover { color: var(--au-ink); }

.au-hint { display: block; font-size: 12px; color: var(--au-muted); margin-top: 6px; }

/* --- Checkboxes --- */
.au-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    line-height: 1.45;
    cursor: pointer;
    user-select: none;
    min-height: 44px;
    padding: 2px 0;
}
.au-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.au-check-box {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border-radius: 5px;
    border: 1.5px solid var(--au-border);
    background: var(--au-white);
    position: relative;
    transition: background 120ms ease, border-color 120ms ease;
}
.au-check input:checked + .au-check-box {
    background: var(--au-ink);
    border-color: var(--au-ink);
}
.au-check input:checked + .au-check-box::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid var(--au-white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.au-check input:focus-visible + .au-check-box { outline: 2px solid var(--au-lime); outline-offset: 2px; }
.au-check a { color: var(--au-ink); text-decoration: underline; }

.au-legal { display: flex; flex-direction: column; gap: 2px; margin: 6px 0 16px; }
.au-legal-note { font-size: 12px; color: var(--au-muted); margin: 4px 0 0; }
.au-legal-note a { color: var(--au-ink); text-decoration: underline; }

/* --- Row: remember me + forgot --- */
.au-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
.au-row .au-check { min-height: auto; margin-bottom: 0; }
.au-forgot { font-size: 13px; color: var(--au-muted); text-decoration: underline; white-space: nowrap; }
.au-forgot:hover { color: var(--au-ink); }

/* --- Submit --- */
.au-submit {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: var(--au-radius-sm);
    background: var(--au-lime);
    color: var(--au-black);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 140ms ease, opacity 140ms ease;
}
.au-submit:hover:not(:disabled) { background: var(--au-lime-press); }
.au-submit:active:not(:disabled) { background: var(--au-lime-press); }
.au-submit:focus-visible { outline: 2px solid var(--au-ink); outline-offset: 2px; }
.au-submit:disabled { opacity: 0.45; cursor: not-allowed; }

/* --- Trust row --- */
.au-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}
.au-trust-item { display: inline-flex; align-items: center; gap: 6px; }
.au-trust-sep { width: 1px; height: 12px; background: rgba(255, 255, 255, 0.2); }
.au-trust-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--au-success); }

/* --- Footer links --- */
.au-footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 18px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
}
.au-footer-links a:hover { color: var(--au-white); }

/* --- Mobile --- */
@media (max-width: 560px) {
    .au-body { padding: 28px 16px; align-items: flex-start; }
    .au-card { padding: 18px; }
    .au-footer-links { flex-wrap: wrap; row-gap: 8px; }
}
