:root {
    color-scheme: dark;
    font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
    background: #070a0f;
    color: #eef4ff;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
button, input, select { font: inherit; }
.hidden { display: none !important; }

.login-shell {
    min-height: 100%;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(circle at 50% 35%, #152440 0, #090d15 38%, #05070b 72%);
}

.login-card {
    width: min(360px, 100%);
    display: grid;
    gap: 12px;
    padding: 30px;
    border: 1px solid #263a5a;
    border-radius: 18px;
    background: rgba(10, 15, 24, .92);
    box-shadow: 0 20px 80px #000a;
}

.mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #07101f;
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(145deg, #86c7ff, #387cff 60%, #7758ff);
}

h1, p { margin: 0; }
.login-card h1 { margin-top: 4px; font-size: 28px; }
.login-card p { margin-bottom: 10px; color: #91a2bb; }
label { color: #b9c7da; font-size: 13px; }
input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #354965;
    border-radius: 8px;
    outline: none;
    background: #090d14;
    color: #fff;
}
input:focus { border-color: #5798ff; box-shadow: 0 0 0 3px #387cff22; }
button {
    border: 1px solid #3d5678;
    border-radius: 8px;
    padding: 9px 14px;
    background: #172337;
    color: #f4f8ff;
    cursor: pointer;
}
button:hover:not(:disabled) { background: #213453; }
button:disabled { opacity: .45; cursor: default; }
.login-card button { margin-top: 4px; background: #286ce1; border-color: #4f8ef8; }
output { min-height: 20px; color: #ff8585; font-size: 13px; }

.desktop-shell { position: relative; width: 100%; height: 100%; background: #020305; }
#remote-video { width: 100%; height: 100%; object-fit: contain; outline: none; }
.status-panel {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 12px;
    text-align: center;
    padding: 24px;
    background: radial-gradient(circle, #101a2b 0, #06090f 55%);
}
.status-panel p { max-width: 520px; color: #9baac0; }
.status-panel button { margin-top: 8px; min-width: 120px; }
.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #26354c;
    border-top-color: #5b9cff;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.toolbar {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px 7px 13px;
    border: 1px solid #34445b;
    border-radius: 10px;
    background: rgba(8, 12, 18, .88);
    backdrop-filter: blur(12px);
    box-shadow: 0 5px 24px #0008;
    transition: opacity .18s;
}
.toolbar span { color: #a7b7cc; font-size: 13px; white-space: nowrap; }
.toolbar button { padding: 6px 10px; }
.bandwidth-control { display: flex; align-items: center; gap: 7px; }
.bandwidth-control select {
    min-width: 286px;
    padding: 6px 26px 6px 9px;
    border: 1px solid #354965;
    border-radius: 7px;
    background: #0d1624;
    color: #eef4ff;
    cursor: pointer;
}
.bandwidth-control select:focus { outline: 2px solid #4b89ee; outline-offset: 1px; }
#bandwidth-usage { color: #7f91aa; font-size: 12px; }
.desktop-shell.connected .status-panel { display: none; }
.desktop-shell.connected:not(:hover) .toolbar { opacity: .16; }

@media (max-width: 650px) {
    .toolbar { top: 6px; width: calc(100% - 12px); overflow-x: auto; }
    #stream-stats { display: none; }
    #bandwidth-usage { display: none; }
}
