/* ============================================
           HEADER
           ============================================ */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 20px 0;
    background: rgba(248, 249, 254, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.4s ease;
}

header.scrolled {
    background: rgba(248, 249, 254, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.04);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-weight: 800;
    font-size: 24px;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.logo-icon {
    width: 20px;
    height: 38px;
    border-radius: 12px;
    background: var(--gradient-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
}

.logo span {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo .badge {
    font-size: 10px;
    font-weight: 700;
    color: #7b3fe4;
    padding: 2px 12px;
    border-radius: 30px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    -webkit-text-fill-color: #7b3fe4;
    background: var(--gradient-light);
    margin-left: 5px;
}

/* ============================================
   HEADER — ДВА СОСТОЯНИЯ
   ============================================ */

/* Неавторизованное меню */
.nav {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav a {
    font-weight: 500;
    font-size: 14px;
    color: #6b6b80;
    position: relative;
    transition: color 0.3s ease;
}

.nav a:hover {
    color: #1a1a2e;
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--gradient-main);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.nav a:hover::after {
    width: 100%;
}

.nav .btn-primary {
    background: var(--gradient-main);
    color: #fff;
    box-shadow: 0 4px 24px rgba(123, 63, 228, 0.25);
    padding: 10px 28px;
    border-radius: 60px;
    font-weight: 600;
    font-size: 13px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.nav .btn-primary:hover {
    transform: scale(1.04);
    box-shadow: 0 8px 40px rgba(123, 63, 228, 0.35);
    background: linear-gradient(90deg, #6a2fd4, #1a6fd4);
    color: #fff;
}

.nav .btn-primary:hover::after {
    width: 0;
}

/* Авторизованное меню (без кнопки "Начать") */
.nav#navAuth {
    gap: 32px;
}

.nav#navAuth a {
    font-weight: 500;
    font-size: 14px;
    color: #6b6b80;
    position: relative;
    transition: color 0.3s ease;
}

.nav#navAuth a:hover {
    color: #1a1a2e;
}

.nav#navAuth a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--gradient-main);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.nav#navAuth a:hover::after {
    width: 100%;
}

/* Кнопка "Войти" */
.btn-login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px 8px 12px;
    border-radius: 40px;
    font-weight: 500;
    font-size: 14px;
    color: #6b6b80;
    background: transparent;
    border: 1.5px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    text-decoration: none;
}

.btn-login:hover {
    color: #1a1a2e;
    border-color: #7b3fe4;
    background: var(--gradient-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(123, 63, 228, 0.08);
}

.btn-login svg {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.btn-login:hover svg {
    transform: translateX(2px);
}

.btn-login .login-text {
    white-space: nowrap;
}
.logout-form {
    line-height: 0;
}
/* ============================================
   КНОПКА "КАБИНЕТ"
   ============================================ */
.btn-cabinet {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px 8px 14px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    background: var(--gradient-main);
    box-shadow: 0 4px 16px rgba(123, 63, 228, 0.2);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    white-space: nowrap;
}

.btn-cabinet:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 28px rgba(123, 63, 228, 0.35);
    background: linear-gradient(90deg, #6a2fd4, #1a6fd4);
    color: #fff;
}

.btn-cabinet svg {
    flex-shrink: 0;
    stroke: #fff;
}
/* Меню пользователя (авторизованный) */
.user-menu {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-menu .name {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a2e;
}

.user-menu .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-main);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.user-menu .user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(123, 63, 228, 0.25);
}

/* Гамбургер */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
    background: none;
    border: none;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #1a1a2e;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Header right */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .nav,
    .nav#navAuth {
        display: none;
    }

    .nav.open,
    .nav#navAuth.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 76px;
        left: 24px;
        right: 24px;
        background: #fff;
        padding: 32px 24px;
        border-radius: 20px;
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
        gap: 16px;
        z-index: 1001;
    }

    .nav.open .btn-primary,
    .nav#navAuth.open .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .hamburger {
        display: flex;
    }

    .btn-login .login-text {
        display: none;
    }

    .btn-login {
        padding: 8px 10px;
        border-radius: 50%;
        border: 1.5px solid rgba(0, 0, 0, 0.06);
    }

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

    .user-menu .name {
        display: none;
    }
}

@media (max-width: 480px) {
    .header-right {
        gap: 8px;
    }

    .btn-login {
        padding: 6px 8px;
    }

    .btn-login svg {
        width: 18px;
        height: 18px;
    }

    .user-menu .user-avatar {
        width: 34px;
        height: 34px;
        font-size: 12px;
    }
}
