/* OneStory login — the same night sky as the chat, in miniature. */
:root {
    --bg-page: #1a1a1a;
    --bg-card: #232323;
    --line: #3d3d3d;
    --input-bg: #1b1b1b;
    --ink: #362a20;
    --accent: #ff9642;
    --accent-bright: #ffaf6b;
    --cream: #e8e6e3;
    --muted: #9a9a9a;
    --error: #ff9b7a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Karla", "Segoe UI", system-ui, sans-serif;
    background:
        radial-gradient(900px 600px at 50% -10%, #2a2a2a, transparent 65%),
        var(--bg-page);
    color: var(--cream);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 360px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
    padding: 0 28px 28px;
    text-align: center;
    overflow: hidden;
}

/* Yasmin in the moonlight, stars overhead. */
.lamp {
    position: relative;
    margin: 0 -28px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding: 30px 0 14px;
    background:
        radial-gradient(ellipse 190px 120px at 50% 88%,
            rgba(255, 255, 255, .13),
            rgba(255, 255, 255, .05) 50%,
            transparent 75%),
        linear-gradient(180deg,
            #171717 0%,
            #1b1b1b 40%,
            #212121 100%);
}

.lamp::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 2px;
    background: #fff;
    box-shadow:
        14px 58px 0 #b9c2cf,
        24px 20px 0 #fff,
        46px 72px 0 #ffd9a0,
        62px 46px 0 #b9c2cf,
        84px 28px 0 #fff,
        104px 12px 0 #ffd9a0,
        126px 62px 0 #fff,
        150px 38px 0 #fff,
        176px 16px 0 #b9c2cf,
        202px 70px 0 #ffd9a0,
        236px 30px 0 #b9c2cf,
        260px 54px 0 #fff,
        282px 14px 0 #ffd9a0,
        304px 68px 0 #b9c2cf,
        322px 44px 0 #fff,
        344px 24px 0 #b9c2cf;
    animation: twinkle 4s ease-in-out infinite;
}

@keyframes twinkle {
    50% {
        opacity: .45;
    }
}

.lamp img {
    position: relative;
    width: 140px;
    height: 140px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 10px 10px rgba(0, 0, 0, .5));
}

.name {
    margin: 18px 0 2px;
    font-family: "Pixelify Sans", monospace;
    font-size: 29px;
    font-weight: 600;
    letter-spacing: .06em;
    color: var(--accent-bright);
}

.sub {
    margin: 0 0 20px;
    font-size: 16px;
    color: var(--muted);
}

form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
}

form p {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
}

input {
    padding: 11px 14px;
    background: var(--input-bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    font: 17px "Karla", sans-serif;
    color: var(--cream);
    transition: border-color .15s ease;
}

input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 150, 66, .25);
}

.errorlist {
    list-style: none;
    margin: 0;
    padding: 0;
    color: var(--error);
    font-size: 15px;
}

form button {
    margin-top: 4px;
    background: var(--accent);
    color: #3d2000;
    border: none;
    border-radius: 999px;
    padding: 12px;
    font: 700 17px "Karla", sans-serif;
    cursor: pointer;
    transition: background .15s ease;
}

form button:hover {
    background: var(--accent-bright);
}

.theme-toggle {
    position: fixed;
    top: 18px;
    right: 18px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    color: var(--cream);
    border: 1px solid var(--line);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent-bright);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Day theme: warm paper card, flat page background, clean noon sky. */
html[data-theme="light"] {
    --bg-page: #f0ede6;
    --bg-card: #fbfaf7;
    --line: #d6d2c6;
    --input-bg: #ffffff;
    --cream: #33302b;
    --muted: #857f72;
}

html[data-theme="light"] body {
    background: var(--bg-page);
}

html[data-theme="light"] .login-card {
    box-shadow: 0 18px 44px rgba(90, 80, 60, .22);
}

html[data-theme="light"] .lamp {
    background:
        radial-gradient(circle at 80% 26px,
            rgba(255, 247, 214, .95),
            rgba(255, 240, 190, .4) 44px,
            transparent 82px),
        radial-gradient(ellipse 90px 20px at 20% 62px, rgba(255, 255, 255, .85), transparent 70%),
        radial-gradient(ellipse 55px 15px at 24% 52px, rgba(255, 255, 255, .7), transparent 70%),
        linear-gradient(180deg,
            #9cc3ec 0%,
            #bcd7f2 55%,
            #ddeaf7 100%);
}

html[data-theme="light"] .lamp::before {
    display: none;
}

html[data-theme="light"] .lamp img {
    filter: drop-shadow(0 10px 10px rgba(100, 95, 85, .28));
}

html[data-theme="light"] .name {
    color: #c96a12;
}

html[data-theme="light"] .errorlist {
    color: #c4451f;
}

html[data-theme="light"] .theme-toggle {
    background: rgba(255, 255, 255, .6);
    color: #4c463c;
    border-color: #cfc9bc;
}

html[data-theme="light"] .theme-toggle:hover {
    border-color: #c96a12;
    color: #b95f0f;
}

@media (prefers-reduced-motion: reduce) {
    .lamp::before {
        animation: none;
    }
}
