:root {
    color-scheme: dark;
    --bg: #080c12;
    --panel: #101720;
    --line: #273341;
    --text: #edf3f8;
    --muted: #9aabba;
    --ice: #a4deff;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html.light {
    color-scheme: light;
    --bg: #f8fafc;
    --panel: #ffffff;
    --line: #e2e8f0;
    --text: #0f172a;
    --muted: #64748b;
    --ice: #0284c7;
}

* {
    box-sizing: border-box;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

body {
    margin: 0;
    min-height: 100svh;
    background: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    position: relative;
}

button, input {
    font: inherit;
}

button, a, input {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

.ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at 16% 16%, #24476333, transparent 50%), radial-gradient(ellipse at 90% 90%, #1a3d5726, transparent 45%);
    z-index: -1;
}

html.light .ambient {
    background: radial-gradient(ellipse at 16% 16%, rgba(2, 132, 199, 0.08), transparent 50%), radial-gradient(ellipse at 90% 90%, rgba(124, 58, 237, 0.05), transparent 45%);
}

.theme-toggle-floating {
    position: absolute;
    top: 24px;
    right: 28px;
    z-index: 50;
}

.theme-toggle-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all .2s ease;
}

.theme-toggle-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.sun-icon, .moon-icon {
    width: 18px;
    height: 18px;
    display: none;
}

html.dark .sun-icon, :root:not(.light) .sun-icon {
    display: block;
    color: #f59e0b;
}

html.light .moon-icon {
    display: block;
    color: #475569;
}

.login-shell {
    width: 100%;
    max-width: 1050px;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: linear-gradient(125deg, #131c27, #0b1119 65%);
    box-shadow: 0 30px 100px #0006, 0 1px 0 #ffffff08 inset;
    overflow: hidden;
}

html.light .login-shell {
    background: #ffffff;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08), 0 1px 0 rgba(0, 0, 0, 0.03);
}

.brand-panel {
    padding: 42px 44px;
    display: flex;
    flex-direction: column;
    position: relative;
    border-right: 1px solid var(--line);
    background: radial-gradient(ellipse at 45% 60%, #17334750, transparent 75%);
}

html.light .brand-panel {
    background: radial-gradient(ellipse at 45% 60%, rgba(2, 132, 199, 0.05), transparent 75%);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 23px;
    font-weight: 650;
    letter-spacing: -.7px;
}

.brand img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 12px;
}

.brand small {
    display: block;
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 1.7px;
    color: var(--muted);
    margin-top: 6px;
}

.ice {
    color: var(--ice);
}

.brand-message {
    margin-top: 68px;
}

.eyebrow {
    font-size: 10px;
    letter-spacing: 2px;
    font-weight: 650;
    color: var(--ice);
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    height: 6px;
    width: 6px;
    border-radius: 50%;
    background: #9de1f4;
    box-shadow: 0 0 12px #9de1f477;
}

html.light .status-dot {
    background: #0284c7;
    box-shadow: 0 0 12px rgba(2, 132, 199, 0.5);
}

h1 {
    font-size: 34px;
    line-height: 1.3;
    letter-spacing: -1.5px;
    font-weight: 600;
    margin: 19px 0;
    color: var(--text);
}

h1 span {
    color: #a2b8ca;
}

html.light h1 span {
    color: #64748b;
}

.brand-message p {
    max-width: 310px;
    font-size: 13px;
    line-height: 1.8;
    color: var(--muted);
    margin: 0;
}

.orbit {
    width: 158px;
    height: 158px;
    border: 1px solid #8bc9ec20;
    border-radius: 50%;
    margin: 42px auto;
    display: grid;
    place-items: center;
    position: relative;
    box-shadow: 0 0 60px #4586b20c;
}

html.light .orbit {
    border-color: rgba(2, 132, 199, 0.15);
    box-shadow: 0 0 50px rgba(2, 132, 199, 0.05);
}

.orbit::before {
    content: "";
    position: absolute;
    inset: 14px;
    border: 1px dashed #8bc9ec26;
    border-radius: 50%;
}

html.light .orbit::before {
    border-color: rgba(2, 132, 199, 0.2);
}

.orbit-inner {
    width: 100px;
    height: 100px;
    display: grid;
    place-items: center;
    border: 1px solid #a4deff28;
    border-radius: 24px;
    transform: rotate(-8deg);
    background: linear-gradient(140deg, #2b445877, #0b141c);
    box-shadow: 0 10px 30px #0003, inset 0 1px #b5d8ff16;
}

html.light .orbit-inner {
    background: linear-gradient(140deg, rgba(2, 132, 199, 0.1), #f0f9ff);
    border-color: rgba(2, 132, 199, 0.2);
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.08);
}

.orbit svg {
    height: 62px;
    width: 62px;
    stroke: #a4deff;
    stroke-width: 1.8;
    transform: rotate(8deg);
}

html.light .orbit svg {
    stroke: #0284c7;
}

.orbit-node {
    position: absolute;
    width: 6px;
    height: 6px;
    top: 18px;
    right: 23px;
    background: var(--ice);
    border-radius: 50%;
    box-shadow: 0 0 18px #a4deff88;
}

.brand-footer {
    font-size: 9px;
    letter-spacing: 1.9px;
    color: var(--muted);
    margin-top: auto;
    font-weight: 600;
}

.form-panel {
    padding: 76px 50px 45px;
    align-self: center;
    background: var(--panel);
}

.form-heading h2 {
    font-size: 27px;
    letter-spacing: -1px;
    font-weight: 600;
    margin: 16px 0 10px;
    color: var(--text);
}

.form-heading p {
    font-size: 13px;
    line-height: 1.65;
    color: var(--muted);
    margin: 0 0 32px;
}

label {
    font-size: 12px;
    font-weight: 600;
    display: block;
    margin: 22px 0 9px;
    color: var(--text);
}

html.light label {
    color: #334155;
}

.input-wrap {
    position: relative;
}

.input-wrap > svg {
    width: 17px;
    height: 17px;
    stroke: #8296a9;
    stroke-width: 1.5;
    fill: none;
    position: absolute;
    left: 15px;
    top: 17px;
    pointer-events: none;
}

html.light .input-wrap > svg {
    stroke: #94a3b8;
}

input:not([type=hidden]) {
    background: #0a1018;
    border: 1px solid #2c3948;
    border-radius: 10px;
    width: 100%;
    height: 52px;
    padding: 0 15px 0 44px;
    font-size: 14px;
    color: #edf3f8;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

html.light input:not([type=hidden]) {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

input::placeholder {
    color: #6b7f91;
}

html.light input::placeholder {
    color: #94a3b8;
}

input:focus {
    border-color: #8ac9ee;
    box-shadow: 0 0 0 3px #a4deff12;
}

html.light input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.input-wrap input[type=password],
.input-wrap input[name=password] {
    padding-right: 77px;
}

.reveal {
    position: absolute;
    right: 12px;
    top: 14px;
    height: 25px;
    border: 0;
    background: transparent;
    color: #a4c6dd;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 4px;
}

html.light .reveal {
    color: #0284c7;
}

.submit {
    height: 51px;
    width: 100%;
    margin-top: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    border: 1px solid #c5e9ff;
    border-radius: 10px;
    background: linear-gradient(180deg, #bfe6fc, #8ac9ec);
    color: #112536;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 4px 25px #8ac9ec12;
    cursor: pointer;
    transition: filter .2s, transform .2s;
}

html.light .submit {
    border: 1px solid #0284c7;
    background: linear-gradient(180deg, #38bdf8, #0284c7);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(2, 132, 199, 0.25);
}

.submit:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

button:focus-visible, a:focus-visible {
    outline: 2px solid var(--ice);
    outline-offset: 4px;
}

button:disabled, input:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
}

.session-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 10px;
    color: var(--muted);
    margin: 16px 0 0;
    line-height: 1.5;
}

.session-note svg {
    width: 13px;
    height: 16px;
    fill: none;
    stroke: var(--muted);
    stroke-width: 1.5;
    flex-shrink: 0;
}

.help {
    border-top: 1px solid var(--line);
    margin-top: 35px;
    padding-top: 24px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.8;
}

.help span {
    color: var(--text);
}

.page-footer {
    font-size: 10px;
    color: var(--muted);
    margin-top: 25px;
}

.page-footer span {
    padding: 0 9px;
}

.error, .notice {
    padding: 13px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.6;
    margin: 0 0 20px;
    border: 1px solid #6a3641;
    background: #321a2380;
    color: #ffc1cc;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

html.light .error {
    border-color: #fecdd3;
    background: #fff1f2;
    color: #e11d48;
}

.error > span {
    border: 1px solid #dc8b9e;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    text-align: center;
    line-height: 14px;
    margin-top: 2px;
}

.error p {
    margin: 0;
}

.notice {
    border-color: #36546a;
    background: #172a3980;
    color: #b1d9f3;
}

html.light .notice {
    border-color: #bae6fd;
    background: #f0f9ff;
    color: #0369a1;
}

@media(max-width: 760px) {
    body {
        padding: 24px 16px;
    }
    .theme-toggle-floating {
        top: 14px;
        right: 16px;
    }
    .login-shell {
        max-width: 460px;
        grid-template-columns: 1fr;
        border-radius: 20px;
    }
    .brand-panel {
        padding: 26px 28px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .brand-message, .brand-footer {
        display: none;
    }
    .brand {
        font-size: 21px;
    }
    .brand img {
        width: 46px;
        height: 46px;
    }
    .form-panel {
        padding: 32px 28px;
    }
    .form-heading h2 {
        font-size: 26px;
    }
    .form-heading p {
        margin-bottom: 26px;
    }
    .help {
        margin-top: 28px;
    }
    .page-footer {
        margin-top: 20px;
    }
}

@media(prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
