:root {
    --header-bg: #0d2340;
    --header-link: rgba(255,255,255,0.9);
    --header-link-hover: #ffffff;
    --header-link-active: #1aa3ff;
    --header-btn-start: #20a5ff;
    --header-btn-end: #1677ed;
}

.main-header {
    width: 100%;
    background: var(--header-bg);
    z-index: 1000;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.18);
    position: sticky;
    top: 0;
}

.flex-header {
    max-width: 1400px;
    margin: 0 auto;
    min-height: 78px;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.logo-container {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.logo-img {
    display: block;
    width: auto;
    height: 42px;
    max-width: 170px;
    object-fit: contain;
    filter: brightness(1.1) contrast(1.08);
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    flex: 1;
    min-width: 0;
}

.nav-links a {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 10px 0 12px;
    color: var(--header-link);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: color 0.2s ease;
    white-space: nowrap;
    line-height: 1;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 2px;
    width: 0;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, #4fd1ff, #1aa3ff);
    box-shadow: 0 0 12px rgba(62, 182, 255, 0.8);
    transition: width 0.25s ease, box-shadow 0.25s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--header-link-hover);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
    box-shadow: 0 0 14px rgba(62, 182, 255, 0.9);
}

.nav-account-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-avatar,
.nav-avatar-fallback {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    background: #15a0ff;
    color: #ffffff;
}

.btn-contact-header {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--header-btn-start), var(--header-btn-end));
    color: #ffffff;
    text-decoration: none;
    font-weight: 800;
    font-size: 16px;
    white-space: nowrap;
    box-shadow: 0 10px 24px rgba(0, 162, 255, 0.24);
}

.btn-contact-header:hover {
    filter: brightness(1.05);
}

@media (max-width: 980px) {
    .nav-links {
        gap: 16px;
    }

    .nav-links a {
        font-size: 15px;
    }

    .btn-contact-header {
        padding: 12px 20px;
        font-size: 16px;
    }
}

@media (max-width: 760px) {
    .flex-header {
        flex-wrap: wrap;
        justify-content: center;
        padding-top: 18px;
        padding-bottom: 18px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links a {
        font-size: 14px;
    }
}
