/* --- Global Styles & Variables --- */
:root {
    --bg-primary: #07080a;
    --bg-secondary: #0d0f12;
    --bg-elevated: #14171c;
    --bg-tertiary: rgba(20, 23, 28, 0.72);
    --text-primary: #f3f5f7;
    --text-secondary: #9aa3ad;
    --text-muted: #6b7380;
    --border-primary: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --accent: #4f7cff;
    --accent-soft: rgba(79, 124, 255, 0.16);
    --glass-bg: rgba(18, 21, 26, 0.55);
    --radius-sm: 10px;
    --radius-md: 16px;
    --font-display: "Syne", sans-serif;
    --font-body: "DM Sans", sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    position: relative;
}

.ambient {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(900px 520px at 12% -10%, rgba(79, 124, 255, 0.18), transparent 60%),
        radial-gradient(700px 480px at 88% 8%, rgba(120, 150, 190, 0.1), transparent 55%),
        linear-gradient(160deg, #060708 0%, #0b0d11 45%, #090a0d 100%);
}

.ambient::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(circle at 50% 30%, black 20%, transparent 75%);
    opacity: 0.5;
    animation: grid-drift 28s linear infinite;
}

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 22px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(14px);
    background: linear-gradient(to bottom, rgba(7, 8, 10, 0.75), rgba(7, 8, 10, 0));
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.03em;
    font-size: 1.05rem;
}

.logo {
    height: 28px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.35));
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.brand-mark:hover .logo {
    transform: scale(1.08) rotate(-4deg);
}

.top-bar nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease;
    cursor: pointer;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
    color: var(--text-primary);
    background: var(--accent-soft);
    border-color: rgba(79, 124, 255, 0.35);
}

.page-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: none;
}

.page-container::-webkit-scrollbar {
    display: none;
}

.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    opacity: 1;
}

.hidden {
    display: none !important;
}

.login-message {
    margin: 0 0 8px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    text-align: center;
    width: min(380px, 90vw);
}

.login-message.success {
    background: rgba(52, 211, 153, 0.12);
    color: #86efac;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.login-message.error {
    background: rgba(248, 113, 113, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.login-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@keyframes grid-drift {
    from { background-position: 0 0; }
    to { background-position: 56px 56px; }
}
