/* ── Design Tokens ────────────────────────────────────────────────── */
:root {
    --bg:          #080d1a;
    --surface:     rgba(15, 25, 50, 0.75);
    --border:      rgba(99, 155, 255, 0.18);
    --text:        #e8f0ff;
    --muted:       #6b7fa8;
    --accent:      #3b82f6;
    --accent-h:    #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.35);
    --danger:      #ef4444;
    --success:     #22c55e;
    --radius:      14px;
    --trans:       0.2s ease;
}

/* ── Reset ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 70% 50% at 15% 10%,  rgba(59,130,246,.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 85% 90%,  rgba(139,92,246,.10) 0%, transparent 60%),
        radial-gradient(ellipse 40% 30% at 50% 50%,  rgba(20,40,90,.5)    0%, transparent 70%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* ── Glass Panel ──────────────────────────────────────────────────── */
.glass-panel {
    background: var(--surface);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 44px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow:
        0 32px 64px -16px rgba(0,0,0,.6),
        0 0 0 1px rgba(255,255,255,.04) inset;
    display: none;
    opacity: 0;
    transform: translateY(18px) scale(0.98);
    transition: opacity .45s ease, transform .45s ease;
}

.glass-panel.active {
    display: block;
    animation: fadeUp .45s ease forwards;
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Logo / Header ────────────────────────────────────────────────── */
.logo-area {
    text-align: center;
    margin-bottom: 36px;
}

.icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(59,130,246,.25), rgba(139,92,246,.2));
    border: 1px solid rgba(99,155,255,.25);
    box-shadow: 0 0 32px var(--accent-glow);
    margin-bottom: 18px;
}

.monitor-icon { width: 32px; height: 32px; color: #7eb8ff; }

.logo-area h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.3px;
    margin-bottom: 6px;
}

.logo-area p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

/* ── Form ─────────────────────────────────────────────────────────── */
.input-group {
    margin-bottom: 20px;
}

label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 8px;
}

/* password wrapper */
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 46px; }
.eye-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    width: auto;
    padding: 4px;
    cursor: pointer;
    color: var(--muted);
    display: flex;
    align-items: center;
}
.eye-btn:hover { color: var(--text); }
.eye-btn svg { width: 18px; height: 18px; stroke: currentColor; }

/* QR link inside label */
.qr-link {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent);
    text-decoration: none;
    font-size: 11px;
    text-transform: none;
    letter-spacing: 0;
    transition: color var(--trans);
}
.qr-link:hover { color: #93c5fd; text-decoration: underline; }
.qr-link svg { width: 12px; height: 12px; }

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 13px 16px;
    background: rgba(8, 14, 30, 0.7);
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 10px;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    transition: border-color var(--trans), box-shadow var(--trans);
    outline: none;
}

input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder { color: rgba(107,127,168,.5); }

/* MFA hint */
.hint {
    margin-top: 6px;
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.5;
}

/* ── Submit Button ────────────────────────────────────────────────── */
button[type="submit"] {
    width: 100%;
    margin-top: 8px;
    padding: 14px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(59,130,246,.35);
    transition: transform var(--trans), box-shadow var(--trans), opacity var(--trans);
}

button[type="submit"]:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 28px rgba(59,130,246,.5);
}
button[type="submit"]:active:not(:disabled) { transform: translateY(0); }
button[type="submit"]:disabled { opacity: .65; cursor: not-allowed; }

/* ── Spinner ──────────────────────────────────────────────────────── */
.loader {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
    flex-shrink: 0;
}
button[type="submit"].loading .loader { display: block; }
button[type="submit"].loading span   { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error / Status ───────────────────────────────────────────────── */
.error-msg {
    margin-top: 16px;
    min-height: 18px;
    font-size: 13px;
    text-align: center;
    color: var(--danger);
    line-height: 1.5;
}

/* ── Session Toolbar ──────────────────────────────────────────────── */
#session-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(8, 14, 30, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 20px;
    font-size: 13px;
}

#session-toolbar.hidden { display: none; }

.toolbar-label {
    flex: 1;
    color: var(--success);
    font-weight: 500;
}

.toolbar-btn {
    padding: 6px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(59,130,246,.15);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--trans);
    width: auto;
}
.toolbar-btn:hover { background: rgba(59,130,246,.3); }
.toolbar-btn.danger { border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.15); }
.toolbar-btn.danger:hover { background: rgba(239,68,68,.3); }

/* ── Desktop Canvas ───────────────────────────────────────────────── */
#desktop-container {
    position: fixed;
    inset: 0;
    top: 38px;    /* below toolbar */
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

#desktop-container.hidden { display: none; }

#desktop-canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: default;
}
