@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,700;1,400&family=Cinzel:wght@500;700;800&family=Space+Grotesk:wght@400;500;600;700&family=Syne:wght@500;700;800&family=Outfit:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --font-sans: 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-spacing: 0.02em;

    /* Classical Canvas Light Theme Palette (Museum / Gallery Linen) */
    --bg: #f5f0eb;
    --bg-subtle: #ede5dc;
    --card: #faf7f2;
    --card-glass: rgba(250, 247, 242, 0.95);
    --surface: #f5f0eb;
    --surface-2: #e8dfd5;
    --surface-3: #dcd0c2;

    --text: #291e14;
    --text-2: #443627;
    --muted: #786654;
    --subtle: #a3917f;

    --border: #d8cdbf;
    --border-subtle: #ede5dc;
    --border-strong: #c4b5a3;
    --border-focus: #b45309;

    /* Shadows & Elevation */
    --shadow-xs: 0 1px 2px rgba(41, 30, 20, 0.04);
    --shadow-sm: 0 2px 4px rgba(41, 30, 20, 0.06);
    --shadow-md: 0 6px 16px -2px rgba(41, 30, 20, 0.08), 0 2px 6px -1px rgba(41, 30, 20, 0.04);
    --shadow-lg: 0 16px 36px -4px rgba(41, 30, 20, 0.12), 0 4px 12px -2px rgba(41, 30, 20, 0.06);
    --shadow-glow: 0 0 24px rgba(180, 83, 9, 0.18);

    /* Brand & Semantic Colors */
    --accent: #b45309;
    --accent-hover: #92400e;
    --accent-active: #78350f;
    --accent-soft: rgba(180, 83, 9, 0.10);
    --accent-glow: rgba(180, 83, 9, 0.25);

    --cyan: #0284c7;
    --cyan-soft: rgba(2, 132, 199, 0.10);
    --green: #059669;
    --green-soft: rgba(5, 150, 105, 0.10);
    --green-glow: rgba(5, 150, 105, 0.25);
    --amber: #d97706;
    --amber-soft: rgba(217, 119, 6, 0.10);
    --amber-glow: rgba(217, 119, 6, 0.25);
    --red: #dc2626;
    --red-soft: rgba(220, 38, 38, 0.10);
    --red-glow: rgba(220, 38, 38, 0.25);
    --blue: #2563eb;
    --blue-soft: rgba(37, 99, 235, 0.10);
    --purple: #7c3aed;
    --purple-soft: rgba(124, 58, 237, 0.10);

    --r-xs: 4px;
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 20px;
    --r-pill: 9999px;

    color-scheme: light;
}

body.dark {
    /* Dark Theme Palette (Obsidian / Slate) */
    --bg: #09090b;
    --bg-subtle: #0f0f12;
    --card: #121216;
    --card-glass: rgba(18, 18, 22, 0.75);
    --surface: #18181d;
    --surface-2: #22222a;
    --surface-3: #2e2e38;

    --text: #f8fafc;
    --text-2: #cbd5e1;
    --muted: #94a3b8;
    --subtle: #64748b;

    --border: #272730;
    --border-subtle: #1c1c24;
    --border-strong: #3b3b48;
    --border-focus: #818cf8;

    /* Shadows & Elevation */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 8px 24px -2px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 48px -4px rgba(0, 0, 0, 0.75), 0 6px 16px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.22);

    /* Brand & Semantic Colors */
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-active: #4f46e5;
    --accent-soft: rgba(99, 102, 241, 0.16);
    --accent-glow: rgba(99, 102, 241, 0.35);

    --cyan: #38bdf8;
    --cyan-soft: rgba(56, 189, 248, 0.14);
    --green: #10b981;
    --green-soft: rgba(16, 185, 129, 0.14);
    --green-glow: rgba(16, 185, 129, 0.30);
    --amber: #f59e0b;
    --amber-soft: rgba(245, 158, 11, 0.14);
    --amber-glow: rgba(245, 158, 11, 0.30);
    --red: #ef4444;
    --red-soft: rgba(239, 68, 68, 0.14);
    --red-glow: rgba(239, 68, 68, 0.30);
    --blue: #3b82f6;
    --blue-soft: rgba(59, 130, 246, 0.14);
    --purple: #a855f7;
    --purple-soft: rgba(168, 85, 247, 0.14);

    color-scheme: dark;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    font-size: 14px;
    background-color: var(--bg);
    background-image: radial-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 0);
    background-size: 14px 14px;
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    transition: background-color .2s ease, color .2s ease;
}

body.dark {
    background-image: none;
    background-color: var(--bg);
}

.login-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
    padding: 36px 32px;
    width: 100%;
    max-width: 420px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: authFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-brand-wrap {
    display: flex;
    justify-content: center;
}

.brand-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.auth-title {
    font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
    font-size: 23px;
    font-weight: 700;
    text-align: center;
    color: var(--text);
    margin: 0 0 4px 0;
    letter-spacing: -0.01em;
}

.brand-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--r-md);
    background: linear-gradient(135deg, var(--accent), #d97706);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.brand-text-block {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.brand-sub {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--muted);
}

.auth-sub {
    font-size: 13px;
    color: var(--muted);
    text-align: center;
    margin-bottom: 22px;
}

.tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 24px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
}

.tab {
    flex: 1;
    padding: 8px 12px;
    text-align: center;
    cursor: pointer;
    border-radius: var(--r-md);
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    border: 1px solid transparent;
    background: transparent;
    transition: all .15s ease;
}

.tab.active {
    background: var(--card);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    font-weight: 700;
}
body.dark .tab.active {
    background: var(--accent);
    color: #ffffff;
    border-color: transparent;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    height: 42px;
    margin-bottom: 14px;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
    transition: all .15s ease;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: var(--card);
}

button.submitBtn {
    width: 100%;
    padding: 12px;
    border-radius: var(--r-md);
    background: linear-gradient(135deg, var(--accent), #d97706);
    border: none;
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--accent-glow);
    transition: all .18s ease;
}

button.submitBtn:hover {
    background: linear-gradient(135deg, var(--accent-hover), #b45309);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px var(--accent-glow);
}

.peekBtn {
    width: 42px;
    height: 42px;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--muted);
    flex-shrink: 0;
    transition: all 0.15s ease;
}
.peekBtn:hover {
    color: var(--text);
    background: var(--surface-2);
}

.peekBtn svg {
    width: 18px;
    height: 18px;
}

.error {
    color: var(--red);
    text-align: center;
    margin-bottom: 16px;
    font-size: 12.5px;
    font-weight: 600;
    padding: 8px 12px;
    background: rgba(220, 38, 38, 0.08);
    border-radius: var(--r-sm);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.success {
    color: var(--green);
    text-align: center;
    margin-bottom: 16px;
    font-size: 12.5px;
    font-weight: 600;
    padding: 8px 12px;
    background: rgba(5, 150, 105, 0.08);
    border-radius: var(--r-sm);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

#modeBtn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 38px;
    height: 38px;
    padding: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.15s ease;
}
#modeBtn:hover {
    color: var(--text);
    border-color: var(--border-strong);
}

#modeBtn svg {
    width: 18px;
    height: 18px;
}

body.dark #moonIcon {
    display: inline;
}
body.dark #sunIcon {
    display: none;
}
body:not(.dark) #sunIcon {
    display: inline;
}
body:not(.dark) #moonIcon {
    display: none;
}

.auth-field-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.auth-input-no-margin {
    margin-bottom: 0 !important;
}

.hidden {
    display: none;
}