:root {
    color-scheme: dark;
    --auth-bg: #101214;
    --auth-panel: #181c20;
    --auth-panel-soft: #20262c;
    --auth-text: #f6f2ea;
    --auth-muted: #aab1b8;
    --auth-line: rgba(255, 255, 255, 0.12);
    --auth-accent: #e6b35a;
    --auth-accent-strong: #f1c66f;
    --auth-error: #ff7c7c;
    --auth-success: #86dfa8;
}

* {
    box-sizing: border-box;
}

body.auth-page {
    min-height: 100vh;
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--auth-text);
    background:
        radial-gradient(circle at 18% 18%, rgba(230, 179, 90, 0.12), transparent 28%),
        linear-gradient(135deg, #101214 0%, #17191b 48%, #111417 100%);
}

.auth-shell {
    width: min(100%, 1120px);
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    place-items: center;
    padding: 92px 18px 32px;
    position: relative;
}

.auth-site-logo {
    position: absolute;
    top: 24px;
    left: 18px;
    display: inline-flex;
    align-items: center;
}

.auth-site-logo img {
    width: 44px;
    height: 44px;
    display: block;
    object-fit: contain;
}

.auth-card {
    width: min(100%, 430px);
    position: relative;
    padding: 34px;
    border: 1px solid var(--auth-line);
    border-radius: 8px;
    background: rgba(24, 28, 32, 0.92);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.auth-back {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--auth-line);
    border-radius: 999px;
    color: var(--auth-muted);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 700;
    transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.auth-back:hover,
.auth-back:focus-visible {
    color: var(--auth-text);
    border-color: rgba(230, 179, 90, 0.55);
    background: rgba(230, 179, 90, 0.08);
}

.auth-heading {
    margin: 24px 0 24px;
}

.auth-kicker {
    margin: 0 0 8px;
    color: var(--auth-accent-strong);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.auth-heading h1 {
    margin: 0;
    font-size: 2.75rem;
    line-height: 1;
    letter-spacing: 0;
}

.auth-heading p,
.auth-switch {
    margin: 12px 0 0;
    color: var(--auth-muted);
    line-height: 1.55;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-form label {
    display: grid;
    gap: 8px;
}

.auth-form label span {
    color: var(--auth-muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    height: 48px;
    border: 1px solid var(--auth-line);
    border-radius: 8px;
    outline: none;
    padding: 0 14px;
    color: var(--auth-text);
    background: var(--auth-panel-soft);
    font: inherit;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-form input:focus {
    border-color: rgba(230, 179, 90, 0.85);
    box-shadow: 0 0 0 4px rgba(230, 179, 90, 0.12);
    background: #242a30;
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    color: var(--auth-muted);
    font-size: 0.9rem;
}

.auth-check {
    display: inline-flex !important;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 9px !important;
    cursor: pointer;
}

.auth-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--auth-accent);
}

.auth-row a,
.auth-switch a {
    color: var(--auth-accent-strong);
    text-decoration: none;
    font-weight: 800;
}

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

.auth-form button {
    width: 100%;
    min-height: 50px;
    border: 0;
    border-radius: 8px;
    padding: 0 18px;
    color: #15120b;
    background: linear-gradient(180deg, var(--auth-accent-strong), var(--auth-accent));
    font: inherit;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(230, 179, 90, 0.18);
    transition: transform 160ms ease, filter 160ms ease;
}

.auth-form button:hover,
.auth-form button:focus-visible {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.auth-form button:active {
    transform: translateY(0);
}

.auth-alert {
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid var(--auth-line);
    border-radius: 8px;
    line-height: 1.45;
    font-weight: 700;
}

.auth-alert-error {
    color: #ffe7e7;
    border-color: rgba(255, 124, 124, 0.38);
    background: rgba(255, 124, 124, 0.12);
}

.auth-alert-success {
    color: #e8fff0;
    border-color: rgba(134, 223, 168, 0.38);
    background: rgba(134, 223, 168, 0.12);
}

.auth-switch {
    text-align: center;
    font-size: 0.94rem;
}

@media (max-width: 520px) {
    .auth-shell {
        align-items: stretch;
        padding: 76px 16px 16px;
    }

    .auth-site-logo {
        top: 14px;
        left: 16px;
    }

    .auth-card {
        padding: 24px 18px;
    }

    .auth-heading {
        margin-top: 20px;
    }

    .auth-heading h1 {
        font-size: 2.25rem;
    }

    .auth-row {
        align-items: flex-start;
    }
}
