/* Auth pages: one surface colour on html, body, hero column, and form column. */
html.auth-layout {
    /* Sampled from hero-light.png / hero-dark.png top-left pixel */
    --auth-surface-light: #e5e7e7;
    --auth-surface-dark: #101318;
    --auth-surface: var(--auth-surface-light);
    --root-bg: var(--auth-surface);
    --color-base-100: var(--auth-surface);
    background-color: var(--auth-surface) !important;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: 100svh;
}

html.auth-layout[data-theme="dark"],
html.auth-layout[data-theme="dim"],
html.auth-layout[data-theme="material-dark"],
html.auth-layout[data-theme="night"],
html.auth-layout[data-theme="black"] {
    --auth-surface: var(--auth-surface-dark);
}

/* Mixed: dark form only; hero stays light (set in app.js on #auth-form-panel). */
html.auth-layout[data-theme="mixed"] {
    --auth-surface: var(--auth-surface-light);
}

body.auth-layout {
    background-color: var(--auth-surface) !important;
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    height: 100%;
}

@media (min-width: 1024px) {
    html.auth-layout,
    body.auth-layout {
        height: 100vh;
        height: 100svh;
        min-height: 100vh;
        min-height: 100svh;
        overflow: hidden;
    }
}

@media (prefers-color-scheme: dark) {
    html.auth-layout:not([data-theme]) {
        --auth-surface: var(--auth-surface-dark);
    }
}

.auth-page-grid {
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    background-color: var(--auth-surface);
}

@media (min-width: 1024px) {
    .auth-page-grid {
        height: 100vh;
        height: 100svh;
        min-height: 100vh;
        min-height: 100svh;
    }
}

#auth-form-panel {
    background-color: var(--auth-surface);
}

#auth-form-panel .auth-theme-toggle {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
}

@media (min-width: 768px) {
    #auth-form-panel .auth-theme-toggle {
        top: 1rem;
        right: 1rem;
    }
}

/* Mixed / full dark: login column matches dark theme (hero stays light in mixed). */
html.auth-layout[data-theme="mixed"] #auth-form-panel[data-theme="dark"],
html.auth-layout[data-theme="dark"] #auth-form-panel,
html.auth-layout[data-theme="dim"] #auth-form-panel,
html.auth-layout[data-theme="material-dark"] #auth-form-panel,
html.auth-layout[data-theme="night"] #auth-form-panel,
html.auth-layout[data-theme="black"] #auth-form-panel {
    background-color: var(--auth-surface-dark) !important;
}

/* Logo: light variant on light form; dark variant on dark form (incl. mixed split). */
#auth-form-panel img[alt="logo-dark"] {
    display: none;
}

#auth-form-panel img[alt="logo-light"] {
    display: block;
}

html.auth-layout[data-theme="mixed"] #auth-form-panel[data-theme="dark"] img[alt="logo-dark"],
html.auth-layout[data-theme="dark"] #auth-form-panel img[alt="logo-dark"],
html.auth-layout[data-theme="dim"] #auth-form-panel img[alt="logo-dark"],
html.auth-layout[data-theme="material-dark"] #auth-form-panel img[alt="logo-dark"],
html.auth-layout[data-theme="night"] #auth-form-panel img[alt="logo-dark"],
html.auth-layout[data-theme="black"] #auth-form-panel img[alt="logo-dark"] {
    display: block !important;
}

html.auth-layout[data-theme="mixed"] #auth-form-panel[data-theme="dark"] img[alt="logo-light"],
html.auth-layout[data-theme="dark"] #auth-form-panel img[alt="logo-light"],
html.auth-layout[data-theme="dim"] #auth-form-panel img[alt="logo-light"],
html.auth-layout[data-theme="material-dark"] #auth-form-panel img[alt="logo-light"],
html.auth-layout[data-theme="night"] #auth-form-panel img[alt="logo-light"],
html.auth-layout[data-theme="black"] #auth-form-panel img[alt="logo-light"] {
    display: none !important;
}

.auth-hero-panel {
    background-color: var(--auth-surface);
    position: relative;
    overflow: hidden;
}

.auth-hero-panel .auth-hero-stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--auth-surface);
}

@media (min-width: 1024px) {
    .auth-hero-panel {
        height: 100%;
        min-height: 100%;
    }
}

.auth-hero-panel .auth-hero-img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
}

.auth-hero-panel .auth-hero-img--dark {
    display: none;
}

html.auth-layout[data-theme="dark"] .auth-hero-panel .auth-hero-img--light,
html.auth-layout[data-theme="dim"] .auth-hero-panel .auth-hero-img--light,
html.auth-layout[data-theme="material-dark"] .auth-hero-panel .auth-hero-img--light,
html.auth-layout[data-theme="night"] .auth-hero-panel .auth-hero-img--light,
html.auth-layout[data-theme="black"] .auth-hero-panel .auth-hero-img--light {
    display: none;
}

html.auth-layout[data-theme="dark"] .auth-hero-panel .auth-hero-img--dark,
html.auth-layout[data-theme="dim"] .auth-hero-panel .auth-hero-img--dark,
html.auth-layout[data-theme="material-dark"] .auth-hero-panel .auth-hero-img--dark,
html.auth-layout[data-theme="night"] .auth-hero-panel .auth-hero-img--dark,
html.auth-layout[data-theme="black"] .auth-hero-panel .auth-hero-img--dark {
    display: block;
}

@media (prefers-color-scheme: dark) {
    html.auth-layout:not([data-theme]) .auth-hero-panel .auth-hero-img--light {
        display: none;
    }

    html.auth-layout:not([data-theme]) .auth-hero-panel .auth-hero-img--dark {
        display: block;
    }
}

html.auth-layout[data-theme="mixed"] .auth-hero-panel .auth-hero-img--light {
    display: block;
}

html.auth-layout[data-theme="mixed"] .auth-hero-panel .auth-hero-img--dark {
    display: none;
}
