:root {
    --primary-gradient: linear-gradient(135deg, #FFD700 0%, #FF8C00 50%, #FF6B00 100%);
    --secondary-gradient: linear-gradient(135deg, #FFA500 0%, #FF7F00 100%);
    --accent-gradient: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    --success-color: #4CAF50;
    --warning-color: #FF9800;
    --error-color: #F44336;

    --bg-dark: #121c29;
    --bg-dark-secondary: #162332;
    --card-dark: rgba(43, 90, 135, 0.18);
    --card-dark-hover: rgba(43, 90, 135, 0.28);
    --glass-dark: rgba(43, 90, 135, 0.22);
    --input-dark: rgba(43, 90, 135, 0.12);
    --text-dark: #FFFFFF;
    --text-secondary-dark: #E0E7F0;
    --text-muted-dark: #B8C5D4;
    --border-dark: rgba(43, 90, 135, 0.32);
    --shadow-dark: rgba(0, 0, 0, 0.45);

    --bg-light: #F0F4F8;
    --bg-light-secondary: #E8F0F8;
    --card-light: rgba(255, 255, 255, 0.92);
    --card-light-hover: rgba(255, 255, 255, 1);
    --glass-light: rgba(255, 255, 255, 0.78);
    --input-light: rgba(255, 255, 255, 0.9);
    --text-light: #1A2B42;
    --text-secondary-light: #2B5A87;
    --text-muted-light: #5A7A9A;
    --border-light: rgba(43, 90, 135, 0.2);
    --shadow-light: rgba(43, 90, 135, 0.15);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 13px;
    --radius-xl: 16px;
    --spacing-xs: 3px;
    --spacing-sm: 6px;
    --spacing-md: 13px;
    --spacing-lg: 19px;
    --spacing-xl: 26px;
    --spacing-2xl: 38px;
    --spacing-3xl: 51px;

    --text-xs: 0.6rem;
    --text-sm: 0.7rem;
    --text-base: 0.8rem;
    --text-lg: 0.9rem;
    --text-xl: 1rem;
    --text-2xl: 1.2rem;
    --text-3xl: 1.5rem;
    --text-4xl: 1.8rem;
    --text-5xl: 2.4rem;
    --text-6xl: 3rem;
}

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

body {
    background: var(--bg-dark);
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255, 215, 0, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 140, 0, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(43, 90, 135, 0.1) 0%, transparent 50%);
    color: var(--text-dark);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: var(--text-base);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light {
    background: var(--bg-light);
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255, 215, 0, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 140, 0, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(43, 90, 135, 0.05) 0%, transparent 50%);
    color: var(--text-light);
}

.container {
    max-width: 1220px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.glass {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-dark);
    box-shadow: 0 8px 32px var(--shadow-dark);
}

body.light .glass {
    border: 1px solid var(--border-light);
    box-shadow: 0 8px 32px var(--shadow-light);
}

.header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(18, 28, 41, 0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-dark);
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-mobile {
    display: none;
}

.header-desktop {
    display: block;
}

.header-content {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-md) 0;
}

.logo-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    text-decoration: none;
    order: 1;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3);
}

.logo-icon img {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-sm);
}

.logo-text {
    font-size: var(--text-xl);
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-nav {
    display: none;
    gap: var(--spacing-xl);
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
    padding: var(--spacing-sm) 0 var(--spacing-sm);
    order: 3;
    grid-column: 1 / -1;
}

.header-nav.open {
    display: flex;
}

.menu-toggle {
    display: inline-flex;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-dark);
    background: var(--glass-dark);
    color: var(--text-dark);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    order: 2;
}
.menu-toggle:hover {
    border-color: rgba(255, 215, 0, 0.4);
    background: rgba(255, 215, 0, 0.08);
}

body.light .menu-toggle {
    border-color: var(--border-light);
    background: var(--glass-light);
    color: var(--text-light);
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-link {
    color: var(--text-secondary-dark);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover { color: #FFD700; }

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
}

.nav-link:hover::after { width: 100%; }
.nav-link.active { color: #FFD700; }
.nav-link.active::after { width: 100%; }

@media (max-width: 768px) {
    .header-mobile {
        display: block;
    }

    .header-desktop {
        display: none;
    }

    .header-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--spacing-md);
        padding: var(--spacing-sm) 0;
    }

    .logo-icon {
        width: 42px;
        height: 42px;
    }

    .logo-icon img {
        width: 48px;
        height: 48px;
    }

    .logo-text {
        font-size: var(--text-lg);
    }

    .logo-header {
        min-width: 0;
    }

    .header-nav {
        width: 100%;
        gap: var(--spacing-sm);
        justify-content: flex-start;
        padding: var(--spacing-md);
        border-radius: var(--radius-lg);
        background: var(--glass-dark);
        border: 1px solid var(--border-dark);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    }
    body.light .header-nav {
        background: var(--glass-light);
        border-color: var(--border-light);
        box-shadow: 0 12px 30px rgba(43, 90, 135, 0.15);
    }

    .header-nav.open {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nav-link {
        padding: 10px 12px;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid transparent;
        text-align: center;
    }
    body.light .nav-link { background: rgba(0, 0, 0, 0.03); }
    .nav-link:hover {
        border-color: rgba(255, 215, 0, 0.35);
    }
    .nav-link::after {
        display: none;
    }
}

@media (max-width: 520px) {
    .header-nav.open {
        grid-template-columns: 1fr;
    }

    .menu-toggle {
        width: 40px;
        height: 40px;
    }
}

.main-content {
    margin-top: 80px;
    padding: var(--spacing-2xl) 0;
    min-height: calc(100vh - 160px);
}

.main-content .container {
    max-width: 1060px;
    margin: 0 auto;
    padding: var(--spacing-2xl) var(--spacing-lg);
    flex: 1;
}

.page-header { text-align: center; margin-bottom: var(--spacing-2xl); }

.page-title {
    font-size: var(--text-4xl);
    font-weight: 800;
    margin-bottom: var(--spacing-lg);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.page-subtitle {
    font-size: var(--text-xl);
    color: var(--text-secondary-dark);
    margin-bottom: var(--spacing-xl);
    font-weight: 400;
}

.theme-toggle {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 48px;
    height: 48px;
    background: var(--card-dark);
    border: 1px solid var(--border-dark);
    border-radius: 50%;
    color: var(--text-dark);
    font-size: var(--text-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 0 4px 16px var(--shadow-dark);
}

.theme-toggle:hover {
    transform: scale(1.05) rotate(8deg);
    background: var(--card-dark-hover);
}

.btn {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: 12px;
    border: 1px solid transparent;
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #111;
    box-shadow: 0 10px 25px rgba(255, 215, 0, 0.18);
}

.btn-primary:hover { transform: translateY(-2px); }

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dark);
    border-color: var(--border-dark);
}

body.light .btn-secondary {
    color: var(--text-light);
    background: rgba(0, 0, 0, 0.03);
    border-color: var(--border-light);
}

.footer {
    padding: var(--spacing-2xl) 0 var(--spacing-xl);
    border-top: 1px solid var(--border-dark);
    background: rgba(18, 28, 41, 0.6);
}

body.light .footer { border-color: var(--border-light); background: rgba(255, 255, 255, 0.6); }

.footer-bottom {
    text-align: center;
    color: var(--text-muted-dark);
}

body.light .footer-bottom { color: var(--text-muted-light); }

@media (max-width: 980px) {
    .header-content { padding: var(--spacing-md) 0 var(--spacing-sm); }
}

@media (max-width: 640px) {
    .header-content { align-items: flex-start; }
    .logo-header { width: 100%; justify-content: center; }
    .header-nav { flex-direction: column; align-items: center; gap: var(--spacing-sm); }
}
