:root {
    --color-void: #f8fafc;
    --color-surface: #ffffff;
    --color-border: #e2e8f0;
    --color-primary: #0f172a;
    --color-secondary: #64748b;
    --color-accent: #3b82f6;
    --color-success: #10b981;
    --font-main: 'Inter', ui-sans-serif, system-ui, sans-serif;
    
    --bg-header: rgba(255, 255, 255, 0.8);
    --bg-hover: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] {
    --color-void: #09090b;
    --color-surface: #18181b;
    --color-border: #3f3f46;
    --color-primary: #ffffff;
    --color-secondary: #a1a1aa;
    
    --bg-header: rgba(9, 9, 11, 0.8);
    --bg-hover: rgba(255, 255, 255, 0.04);
}

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

body {
    background-color: var(--color-void);
    color: var(--color-primary);
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.6;
    overflow-wrap: break-word;
}

/* Top Navigation */
.header {
    background-color: var(--bg-header);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(63, 63, 70, 0.5);
    padding: 0 48px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    color: var(--color-primary);
    font-weight: 700;
    font-size: 20px;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    color: var(--color-secondary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--color-primary);
}

.auth-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Typography */
h1,
h2,
h3 {
    color: var(--color-primary);
    font-weight: 600;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 64px;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.04em;
}

h2 {
    font-size: 36px;
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
}

.subtitle {
    font-size: 20px;
    color: var(--color-secondary);
    margin-bottom: 40px;
    max-width: 600px;
    line-height: 1.5;
}

/* Buttons */
.btn {
    display: inline-block;
    background-color: var(--color-accent);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
}

.btn:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-primary);
}

.btn-outline:hover {
    border-color: var(--color-secondary);
    background-color: var(--bg-hover);
}

/* Footer */
footer {
    border-top: 1px solid var(--color-border);
    padding: 64px 48px;
    background-color: var(--color-surface);
    text-align: left;
    color: var(--color-secondary);
    margin-top: 80px;
}



.mobile-only {
    display: none;
}

.mobile-menu-overlay {
    display: none;
}

.hamburger-btn {
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    display: none; /* Hidden by default on desktop */
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .nav-links, .auth-links { display: none; }
    .hamburger-btn { display: flex; }
    
    .header {
        padding: 0 24px;
        height: 64px;
    }
    
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 64px;
        left: 0; right: 0; bottom: 0;
        background-color: var(--color-surface);
        z-index: 99;
        padding: 32px 24px;
        border-top: 1px solid var(--color-border);
        overflow-y: auto;
        overscroll-behavior: contain;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
    }
    
    .mobile-menu-overlay.active {
        display: block;
    }

    body.sidebar-open,
    html.sidebar-open {
        overflow: hidden !important;
        overscroll-behavior: none !important;
        touch-action: none;
    }
    
    .mobile-nav-links {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    
    .mobile-link {
        font-size: 18px;
        color: var(--color-primary);
        text-decoration: none;
        display: block;
    }
    
    h1 { font-size: 40px; }
    h2 { font-size: 28px; }
    footer { padding: 48px 16px; }
}

/* Button Loading State */
.btn.is-loading,
button.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none !important;
    cursor: wait !important;
}

.btn.is-loading::after,
button.is-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: btnSpin 0.65s linear infinite;
    -webkit-animation: btnSpin 0.65s linear infinite;
}

@keyframes btnSpin {
    to { transform: rotate(360deg); }
}
@-webkit-keyframes btnSpin {
    to { -webkit-transform: rotate(360deg); }
}

/* Universal In-Page Confirmation Modal */
.app-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(2px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.app-modal-overlay.active {
    display: flex;
}

.app-modal-dialog {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 24px;
    max-width: 440px;
    width: calc(100% - 32px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
    animation: modalPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.app-modal-title {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 17px;
    font-weight: 600;
    color: var(--color-primary);
}

.app-modal-message {
    color: var(--color-secondary);
    font-size: 14px;
    line-height: 1.55;
    margin-bottom: 24px;
}

.app-modal-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

@keyframes modalPopIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Universal Website Toast Notifications */
.website-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: calc(100% - 48px);
    pointer-events: none;
}

.website-toast {
    pointer-events: auto;
    background: var(--color-surface);
    color: var(--color-primary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    font-size: 13.5px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.website-toast.toast-success {
    border-color: rgba(16, 185, 129, 0.4);
}

.website-toast.toast-error {
    border-color: rgba(239, 68, 68, 0.4);
}

.website-toast.toast-info {
    border-color: rgba(59, 130, 246, 0.4);
}

.website-toast-close {
    background: none;
    border: none;
    color: var(--color-secondary);
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.website-toast-close:hover {
    opacity: 1;
    color: var(--color-primary);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Global Page Loader Overlay & GPU-Accelerated Dots */
.app-loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    will-change: opacity;
}

[data-theme="dark"] .app-loader-overlay {
    background: rgba(9, 9, 11, 0.82);
}

.app-loader-overlay.active {
    display: flex;
    opacity: 1;
}

.app-loader-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px 32px;
    background: var(--color-surface, #ffffff);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
    text-align: center;
    min-width: 220px;
    max-width: 90vw;
}

[data-theme="dark"] .app-loader-card {
    background: var(--color-surface, #18181b);
    border-color: var(--color-border, #27272a);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.app-loader-dots {
    position: relative;
    width: 80px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-loader-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.app-loader-dot.dot-mint {
    background: #25d8a7;
    animation: loaderOscillateMint 1.333s cubic-bezier(0.167, 0.167, 0.833, 0.833) infinite;
    -webkit-animation: loaderOscillateMint 1.333s cubic-bezier(0.167, 0.167, 0.833, 0.833) infinite;
}

.app-loader-dot.dot-cyan {
    background: #1ea8fa;
    animation: loaderOscillateCyan 1.333s cubic-bezier(0.167, 0.167, 0.833, 0.833) infinite;
    -webkit-animation: loaderOscillateCyan 1.333s cubic-bezier(0.167, 0.167, 0.833, 0.833) infinite;
}

@keyframes loaderOscillateMint {
    0%, 100% {
        transform: translate3d(-24px, 0, 0);
        -webkit-transform: translate3d(-24px, 0, 0);
    }
    50% {
        transform: translate3d(24px, 0, 0);
        -webkit-transform: translate3d(24px, 0, 0);
    }
}
@-webkit-keyframes loaderOscillateMint {
    0%, 100% {
        -webkit-transform: translate3d(-24px, 0, 0);
    }
    50% {
        -webkit-transform: translate3d(24px, 0, 0);
    }
}

@keyframes loaderOscillateCyan {
    0%, 100% {
        transform: translate3d(24px, 0, 0);
        -webkit-transform: translate3d(24px, 0, 0);
    }
    50% {
        transform: translate3d(-24px, 0, 0);
        -webkit-transform: translate3d(-24px, 0, 0);
    }
}
@-webkit-keyframes loaderOscillateCyan {
    0%, 100% {
        -webkit-transform: translate3d(24px, 0, 0);
    }
    50% {
        -webkit-transform: translate3d(-24px, 0, 0);
    }
}

.app-loader-text {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--color-primary, #0f172a);
    letter-spacing: -0.01em;
}

[data-theme="dark"] .app-loader-text {
    color: var(--color-primary, #ededed);
}