/* Shadowdark Admin Panel — login (scene left, coded panel right) */

:root {
    --sd-login-bg: #080808;
    --sd-login-card: rgba(12, 11, 10, 0.94);
    --sd-login-border: rgba(215, 200, 168, 0.24);
    --sd-login-border-inner: rgba(215, 200, 168, 0.1);
    --sd-login-text: #ece6dc;
    --sd-login-muted: rgba(236, 230, 220, 0.52);
    --sd-login-dim: rgba(236, 230, 220, 0.34);
    --sd-login-red: #5c1a1a;
    --sd-login-red-hover: #6e2222;
    --sd-login-link: #a84848;
    --sd-login-gold: rgba(196, 165, 116, 0.88);
    --sd-login-font: "Inter", system-ui, sans-serif;
    --sd-login-serif: "Cinzel", Georgia, serif;
    --sd-login-welcome: "Crimson Pro", Georgia, serif;
}

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

html.sd-login-html,
html.sd-login-html body {
    margin: 0;
    height: 100%;
    overflow: hidden;
}

.sd-login {
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    display: grid;
    grid-template-columns: 58fr 42fr;
    font-family: var(--sd-login-font);
    color: var(--sd-login-text);
    background: var(--sd-login-bg);
}

/* Left — scene fills column edge-to-edge */
.sd-login__art {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    background-color: #050505;
    background-image: var(--sd-login-scene);
    background-size: cover;
    background-position: center right;
    background-repeat: no-repeat;
}

/* Right — login panel, vertically centered, no page scroll */
.sd-login__main {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: clamp(0.75rem, 2vh, 1.5rem) clamp(1rem, 2.5vw, 2rem);
    background: var(--sd-login-bg);
}

.sd-login__card {
    position: relative;
    width: 100%;
    max-width: 380px;
    max-height: 100%;
    padding: clamp(1.5rem, 3.5vh, 2.6rem) clamp(1.35rem, 2.5vw, 2.2rem) clamp(1.25rem, 2.5vh, 2.1rem);
    background: var(--sd-login-card);
    border: 1px solid var(--sd-login-border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.sd-login__card-frame {
    position: absolute;
    inset: 9px;
    border: 1px solid var(--sd-login-border-inner);
    pointer-events: none;
}

.sd-login__card::before,
.sd-login__card::after,
.sd-login__card-frame::before,
.sd-login__card-frame::after {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    border: 1px solid rgba(196, 165, 116, 0.42);
    pointer-events: none;
}

.sd-login__card::before { top: 3px; left: 3px; border-width: 1px 0 0 1px; }
.sd-login__card::after { bottom: 3px; right: 3px; border-width: 0 1px 1px 0; }
.sd-login__card-frame::before { top: -1px; right: -1px; border-width: 1px 1px 0 0; }
.sd-login__card-frame::after { bottom: -1px; left: -1px; border-width: 0 0 1px 1px; }

.sd-login__brand {
    text-align: center;
    margin-bottom: clamp(0.85rem, 2vh, 1.5rem);
}

.sd-login__logo {
    display: block;
    width: min(200px, 72%);
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.45));
}

.sd-login__welcome {
    margin: 0 0 clamp(0.85rem, 2vh, 1.5rem);
    font-family: var(--sd-login-welcome);
    font-size: clamp(0.82rem, 1.8vh, 0.95rem);
    font-style: italic;
    line-height: 1.55;
    text-align: center;
    color: var(--sd-login-muted);
}

.sd-login__error {
    margin: 0 0 1rem;
    padding: 0.55rem 0.7rem;
    font-size: 0.8rem;
    color: #e8a0a0;
    background: rgba(92, 26, 26, 0.25);
    border: 1px solid rgba(168, 72, 72, 0.35);
}

.sd-login__form {
    margin: 0;
}

.sd-login__field {
    margin-bottom: clamp(0.65rem, 1.5vh, 1rem);
}

.sd-login__label {
    display: block;
    margin-bottom: 0.38rem;
    font-size: 0.56rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sd-login-dim);
}

.sd-login__input {
    position: relative;
}

.sd-login__input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: var(--sd-login-dim);
    pointer-events: none;
}

.sd-login__input input {
    width: 100%;
    padding: clamp(0.55rem, 1.2vh, 0.7rem) 0.8rem clamp(0.55rem, 1.2vh, 0.7rem) 2.3rem;
    font: inherit;
    font-size: clamp(0.8rem, 1.6vh, 0.85rem);
    color: var(--sd-login-text);
    background: rgba(4, 4, 4, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}

.sd-login__input input::placeholder {
    color: var(--sd-login-dim);
}

.sd-login__input input:focus {
    border-color: rgba(196, 165, 116, 0.38);
}

.sd-login__input--pw input {
    padding-right: 2.5rem;
}

.sd-login__pw-toggle {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.15rem;
    color: var(--sd-login-dim);
    background: none;
    border: none;
    cursor: pointer;
}

.sd-login__pw-toggle svg {
    width: 1rem;
    height: 1rem;
    display: block;
}

.sd-login__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.1rem;
    font-size: 0.76rem;
}

.sd-login__remember {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--sd-login-muted);
    cursor: pointer;
}

.sd-login__remember input {
    accent-color: var(--sd-login-red);
}

.sd-login__forgot {
    padding: 0;
    font: inherit;
    font-size: 0.76rem;
    color: var(--sd-login-link);
    background: none;
    border: none;
    cursor: pointer;
}

.sd-login__forgot:hover {
    text-decoration: underline;
}

.sd-login__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: clamp(0.85rem, 1.8vh, 1.25rem);
    padding: clamp(0.65rem, 1.4vh, 0.8rem) 1rem;
    font: inherit;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(180deg, #682020 0%, var(--sd-login-red) 100%);
    border: 1px solid rgba(0, 0, 0, 0.35);
    border-radius: 2px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.sd-login__submit:hover {
    background: linear-gradient(180deg, #782626 0%, var(--sd-login-red-hover) 100%);
}

.sd-login__submit svg {
    width: 15px;
    height: 15px;
}

.sd-login__or {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: clamp(0.85rem, 1.8vh, 1.25rem) 0 clamp(0.65rem, 1.4vh, 1rem);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sd-login-dim);
}

.sd-login__or::before,
.sd-login__or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.sd-login__or span {
    flex-shrink: 0;
}

.sd-login__guest {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--sd-login-muted);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 2px;
}

.sd-login__guest:hover {
    color: var(--sd-login-text);
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.03);
}

.sd-login__guest svg {
    width: 15px;
    height: 15px;
}

.sd-login__meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    margin-top: clamp(1rem, 2.2vh, 1.85rem);
    font-size: 0.58rem;
    line-height: 1.45;
    text-align: center;
    color: var(--sd-login-dim);
}

@media (max-width: 860px) {
    html.sd-login-html,
    html.sd-login-html body {
        overflow: auto;
    }

    .sd-login {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100dvh;
        max-height: none;
        overflow: visible;
    }

    .sd-login__art {
        display: none;
    }

    .sd-login__main {
        height: auto;
        min-height: 100dvh;
        overflow: visible;
        padding: 1.75rem 1.15rem;
    }
}
