:root {
    color-scheme: light;
    font-family: "Manrope", "Segoe UI Variable", "Segoe UI", sans-serif;
    --auth-text: #162033;
    --auth-muted: #68758a;
    --auth-primary: #146bff;
    --auth-primary-dark: #071b49;
    --auth-glass: rgba(255, 255, 255, 0.72);
    --auth-glass-strong: rgba(255, 255, 255, 0.9);
    --auth-line: rgba(255, 255, 255, 0.58);
    --auth-line-dark: rgba(96, 112, 132, 0.22);
    --auth-shadow: 0 36px 110px rgba(16, 29, 47, 0.24);
    --auth-soft-shadow: 0 18px 58px rgba(18, 30, 46, 0.13);
    --auth-radius: 34px;
    --auth-card-radius: 26px;
    --auth-ui-scale: 0.88;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --auth-text: #f3f7fb;
    --auth-muted: #a9b5c6;
    --auth-primary: #2f80ff;
    --auth-primary-dark: #74a9ff;
    --auth-glass: rgba(17, 27, 42, 0.7);
    --auth-glass-strong: rgba(22, 33, 50, 0.88);
    --auth-line: rgba(255, 255, 255, 0.16);
    --auth-line-dark: rgba(255, 255, 255, 0.13);
    --auth-shadow: 0 42px 120px rgba(0, 0, 0, 0.54);
    --auth-soft-shadow: 0 20px 64px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }

html {
    min-height: 100%;
    background: #0b1520;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--auth-text);
    overflow: hidden;
}

button,
input {
    font: inherit;
}

.premium-auth-body {
    position: relative;
    display: grid;
    place-items: center;
    padding: 26px;
    background-position: center;
    background-size: cover;
}

.auth-season-winter { background-image: url("/static/premium/seasons/winter.png"); }
.auth-season-spring { background-image: url("/static/premium/seasons/spring.png"); }
.auth-season-summer { background-image: url("/static/premium/seasons/summer.png"); }
.auth-season-autumn { background-image: url("/static/premium/seasons/autumn.png"); }

.premium-auth-body::before,
.premium-auth-body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.premium-auth-body::before {
    z-index: -2;
    background:
        linear-gradient(110deg, rgba(7, 18, 30, 0.74), rgba(241, 247, 250, 0.22) 42%, rgba(241, 247, 250, 0.04)),
        radial-gradient(circle at 44% 18%, rgba(255, 255, 255, 0.72), transparent 26%),
        radial-gradient(circle at 83% 82%, rgba(8, 86, 82, 0.36), transparent 28%);
}

.premium-auth-body::after {
    z-index: -1;
    margin: 8px;
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 34px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.premium-auth-page {
    display: grid;
    grid-template-columns: minmax(300px, 0.7fr) minmax(720px, 1.45fr);
    gap: 22px;
    width: min(1760px, calc(100vw - 52px));
    height: min(960px, calc(100vh - 52px));
    min-height: 720px;
}

.auth-brand-panel,
.auth-workspace,
.auth-card {
    border: 1px solid var(--auth-line);
    background: var(--auth-glass);
    backdrop-filter: blur(28px) saturate(145%);
    box-shadow: var(--auth-shadow);
}

.auth-brand-panel {
    position: relative;
    display: grid;
    grid-template-rows: auto auto auto 1fr;
    gap: 22px;
    min-height: 0;
    padding: 34px;
    border-radius: var(--auth-radius);
    overflow: hidden;
}

.auth-brand-panel::before {
    content: "";
    position: absolute;
    inset: auto -12% -10% -12%;
    height: 44%;
    background:
        linear-gradient(0deg, rgba(5, 18, 29, 0.76), rgba(5, 18, 29, 0)),
        radial-gradient(circle at 55% 20%, rgba(53, 208, 194, 0.25), transparent 36%);
    pointer-events: none;
}

.auth-logo-card {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 132px;
    height: 132px;
    border: 1px solid var(--auth-line);
    border-radius: 36px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--auth-soft-shadow);
}

.auth-logo-card img {
    width: 82px;
    height: 82px;
    object-fit: contain;
}

.auth-brand-copy {
    position: relative;
    z-index: 1;
}

.auth-brand-copy span,
.auth-card-title span,
.auth-topline span {
    color: var(--auth-muted);
    font-size: 14px;
    font-weight: 850;
}

.auth-brand-copy h1 {
    margin: 12px 0 16px;
    max-width: 520px;
    font-size: clamp(42px, 4.2vw, 72px);
    line-height: 0.96;
    letter-spacing: -0.07em;
}

.auth-brand-copy p {
    margin: 0;
    max-width: 520px;
    color: var(--auth-muted);
    font-size: 19px;
    line-height: 1.55;
}

.auth-feature-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.auth-feature-grid div,
.auth-support-card {
    border: 1px solid var(--auth-line-dark);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.34);
    box-shadow: var(--auth-soft-shadow);
}

.auth-feature-grid div {
    display: grid;
    gap: 4px;
    min-height: 82px;
    padding: 16px;
}

.auth-feature-grid strong {
    font-size: 22px;
    letter-spacing: -0.05em;
}

.auth-feature-grid small,
.auth-support-card span {
    color: var(--auth-muted);
    font-size: 13px;
    line-height: 1.35;
}

.auth-support-card {
    position: relative;
    z-index: 1;
    align-self: end;
    display: grid;
    gap: 6px;
    padding: 18px;
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(7, 28, 40, 0.76), rgba(10, 104, 98, 0.42)),
        rgba(255, 255, 255, 0.12);
}

.auth-support-card strong {
    font-size: 20px;
    letter-spacing: -0.04em;
}

.auth-support-card span {
    color: rgba(255, 255, 255, 0.82);
}

.auth-workspace {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 18px;
    min-height: 0;
    padding: 30px;
    border-radius: var(--auth-radius);
}

.auth-topline {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    min-height: 54px;
    padding: 0 0 18px;
    border-bottom: 1px solid var(--auth-line-dark);
}

.auth-topline nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.auth-topline a {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--auth-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.54);
    color: var(--auth-text);
    font-size: 14px;
    font-weight: 850;
    text-decoration: none;
    box-shadow: var(--auth-soft-shadow);
}

.auth-heading h2 {
    margin: 0;
    font-size: clamp(38px, 4vw, 58px);
    line-height: 0.98;
    letter-spacing: -0.07em;
}

.auth-heading p {
    margin: 10px 0 0;
    color: var(--auth-muted);
    font-size: 18px;
    line-height: 1.45;
}

.auth-panels {
    display: grid;
    grid-template-columns: minmax(310px, 0.82fr) minmax(520px, 1.18fr);
    gap: 18px;
    min-height: 0;
}

.auth-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 26px;
    border-radius: var(--auth-card-radius);
    background: var(--auth-glass-strong);
}

.auth-card-title h3 {
    margin: 6px 0 20px;
    font-size: 30px;
    line-height: 1.04;
    letter-spacing: -0.055em;
}

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

.auth-register-form {
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
}

.auth-field,
.auth-form > label:not(.auth-checkbox) {
    display: grid;
    gap: 7px;
}

.auth-field-wide,
.auth-register-form > button {
    grid-column: 1 / -1;
}

.auth-form label,
.auth-field label {
    color: var(--auth-muted);
    font-size: 13px;
    font-weight: 850;
}

.auth-form input[type="text"],
.auth-form input[type="password"] {
    width: 100%;
    min-height: 52px;
    padding: 0 17px;
    border: 1px solid var(--auth-line-dark);
    border-radius: 18px;
    outline: none;
    background: rgba(255, 255, 255, 0.68);
    color: var(--auth-text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.54);
    transition: 160ms ease;
}

.auth-form input:focus {
    border-color: rgba(10, 104, 98, 0.42);
    box-shadow: 0 0 0 4px rgba(10, 104, 98, 0.1);
}

.auth-form input::placeholder {
    color: rgba(103, 116, 138, 0.72);
}

.auth-form button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 22px;
    border: 0;
    border-radius: 19px;
    background: linear-gradient(135deg, #0a6862, #111d2f);
    color: #ffffff;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 18px 42px rgba(5, 61, 61, 0.24);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.auth-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 52px rgba(5, 61, 61, 0.31);
}

.auth-checkbox {
    display: flex;
    gap: 10px;
    align-items: center;
    min-height: 44px;
    margin-top: 2px;
}

.auth-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--auth-primary);
}

.auth-checkbox a,
.auth-card-footer a {
    color: var(--auth-text);
    font-weight: 900;
}

.auth-card-footer {
    margin: auto 0 0;
    padding-top: 18px;
    color: var(--auth-muted);
    font-size: 15px;
    line-height: 1.45;
}

.alert {
    margin-bottom: 14px;
    padding: 13px 15px;
    border-radius: 18px;
    font-size: 14px;
    font-weight: 850;
    line-height: 1.4;
}

.alert-error {
    background: rgba(192, 68, 68, 0.12);
    color: #a33a2d;
}

.alert-success {
    background: rgba(10, 104, 98, 0.12);
    color: var(--auth-primary-dark);
}

:root[data-theme="dark"] .auth-topline a,
:root[data-theme="dark"] .auth-feature-grid div,
:root[data-theme="dark"] .auth-form input[type="text"],
:root[data-theme="dark"] .auth-form input[type="password"] {
    background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 1280px) {
    body { overflow: auto; }

    .premium-auth-page {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
    }

    .auth-brand-panel {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        align-items: center;
    }

    .auth-feature-grid,
    .auth-support-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 860px) {
    .premium-auth-body {
        padding: 12px;
        overflow: auto;
    }

    .premium-auth-page,
    .auth-panels,
    .auth-register-form {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .auth-brand-panel,
    .auth-workspace,
    .auth-card {
        padding: 20px;
        border-radius: 26px;
    }

    .auth-logo-card {
        width: 92px;
        height: 92px;
        border-radius: 26px;
    }

    .auth-logo-card img {
        width: 58px;
        height: 58px;
    }

    .auth-brand-copy h1 {
        font-size: 36px;
    }

    .auth-brand-copy p,
    .auth-heading p {
        font-size: 16px;
    }

    .auth-feature-grid {
        grid-template-columns: 1fr;
    }
}

/* HiDPI density pass: the auth screen should feel like Premium UI, not a zoomed poster. */
.premium-auth-page {
    width: min(1760px, calc((100vw - 52px) / var(--auth-ui-scale)));
    height: min(900px, calc((100vh - 52px) / var(--auth-ui-scale)));
    min-height: 0;
    zoom: var(--auth-ui-scale);
}

.auth-brand-panel,
.auth-workspace {
    min-height: 0;
}

.auth-logo-card {
    width: 112px;
    height: 112px;
    border-radius: 32px;
}

.auth-logo-card img {
    width: 70px;
    height: 70px;
}

.auth-brand-copy h1 {
    max-width: 470px;
    font-size: clamp(38px, 3.55vw, 58px);
    line-height: 1;
}

.auth-brand-copy p {
    max-width: 500px;
    font-size: 17px;
    line-height: 1.5;
}

.auth-feature-grid div {
    min-height: 70px;
    padding: 14px;
}

.auth-support-card {
    min-height: 78px;
}

.auth-heading h2 {
    font-size: clamp(34px, 3.2vw, 48px);
}

.auth-heading p {
    font-size: 16px;
}

.auth-card {
    padding: 24px;
}

.auth-card-title h3 {
    margin-bottom: 18px;
    font-size: 28px;
}

.auth-form input[type="text"],
.auth-form input[type="password"] {
    min-height: 48px;
}

.auth-form button {
    min-height: 50px;
}

.auth-register-form {
    align-content: start;
}

@media (max-height: 760px) {
    body {
        overflow: auto;
    }

    .premium-auth-page {
        height: auto;
        min-height: calc((100vh - 28px) / var(--auth-ui-scale));
    }

    .auth-brand-panel {
        gap: 14px;
    }

    .auth-brand-copy h1 {
        font-size: clamp(32px, 3.1vw, 48px);
    }

    .auth-feature-grid,
    .auth-support-card {
        display: none;
    }
}

@media (max-width: 860px) {
    .premium-auth-page {
        width: 100%;
        height: auto;
        zoom: 1;
    }
}
