/* =========================================
   HEADER & NAVEGAÇÃO
   Estilos do header fixo (pill flutuante),
   navbar, logo, links e botões de CTA.
   ========================================= */

.header {
    position: fixed;
    top: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2.5rem);
    max-width: 850px;
    height: 58px;
    background: var(--c-header-bg);
    backdrop-filter: blur(32px) saturate(180%);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
    z-index: 1000;
    border: 1px solid var(--c-header-border);
    border-radius: 50px;
    display: flex;
    align-items: center;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

/* Linha de glow animada na borda superior */
.header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(241, 96, 34, 0.205) 30%,
            rgba(255, 255, 255, 0.25) 50%,
            rgba(241, 96, 34, 0.199) 70%,
            transparent 100%);
    animation: header-glow-line 5s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes header-glow-line {
    0% {
        opacity: 0.3;
        transform: scaleX(0.5);
    }

    50% {
        opacity: 1;
        transform: scaleX(1);
    }

    100% {
        opacity: 0.3;
        transform: scaleX(0.5);
    }
}

/* ── Navbar layout ── */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 1.25rem;
    gap: 1.5rem;
}

/* ── Logo ── */
.logo-text {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--c-text);
    flex-shrink: 0;
}

.logo-text .highlight {
    color: var(--primary-color);
}

/* ── Links de navegação ── */
.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.nav-links a {
    font-weight: 600;
    padding: 5px 15px;
    border-radius: 5px;
    font-size: 0.8rem;
    color: var(--c-nav-link);
    transition: all 0.3s;
    white-space: nowrap;
    position: relative;
}

.nav-links a:hover {
    background: rgba(128, 128, 128, 0.137);
    color: var(--c-nav-link-hover);
}

.nav-links a.active {
    color: var(--c-nav-active);
    background: rgba(128, 128, 128, 0.137);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 2px;
    background: var(--primary-color);
    border-radius: 1px;
}

/* ── CTA Buttons do header ── */
.nav-cta {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-shrink: 0;
}

.btn-nav-outline {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 1.25rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #ffffff;
    background: var(--primary-color);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
}

.btn-nav-outline:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(241, 97, 34, 0.45);
}

.nav-theme-toggle {
    background: transparent;
    border: none;
    color: var(--c-nav-link);
    background: rgba(128, 128, 128, 0.137);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.nav-theme-toggle:hover {
    color: var(--c-nav-link-hover);
}

/* ── Mobile Menu Button (hambúrguer) ── */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.mobile-menu-btn span {
    width: 100%;
    height: 2px;
    background-color: var(--c-hamburger);
    border-radius: 4px;
    transition: all 0.3s ease;
}

/* =========================================
   HEADER — RESPONSIVO
   ========================================= */

@media screen and (max-width: 1024px) {
    .header {
        width: calc(100% - 2rem);
        top: 1rem;
    }
}

/* Mobile-only login CTA inside nav dropdown — hidden on desktop */
.mobile-nav-cta {
    display: none;
}

@media screen and (max-width: 768px) {
    .header {
        width: calc(100% - 1.5rem);
        top: 0.75rem;
        height: 58px;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        overflow: visible;
    }

    /* Reorganiza lado direito: theme-toggle à esquerda do hambúrguer, colados */
    .navbar {
        gap: 15px;
    }

    .nav-cta {
        display: flex;
        order: 2;
        margin-left: auto;
    }

    .btn-nav-outline {
        display: none;
    }

    /* Hambúrguer fica o mais à direita */
    .mobile-menu-btn {
        display: flex;
        order: 3;
    }

    /* Menu mobile — dropdown animado */
    .nav-links {
        position: fixed;
        top: 80px;
        left: 0.75rem;
        right: 0.75rem;
        width: calc(100% - 1.5rem);
        background: var(--c-surface);
        backdrop-filter: blur(20px);
        border: 1px solid var(--c-border);
        border-radius: 16px;
        flex-direction: column;
        padding: 1.5rem;
        gap: 1rem;
        clip-path: circle(0% at 95% 0);
        transition: clip-path 0.4s ease-in-out;
    }

    .nav-links.active {
        clip-path: circle(150% at 95% 0);
    }

    .nav-links a {
        font-size: 1rem;
        font-weight: 600;
        color: var(--c-text-muted);
    }

    /* Animação do hambúrguer → X */
    .mobile-menu-btn.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    /* CTA de login dentro do dropdown mobile */
    .mobile-nav-cta {
        display: block;
        width: 100%;
        padding-top: 0.75rem;
        margin-top: 0.25rem;

        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .mobile-nav-cta .btn {
        display: block;
        color: #ffffff;
        width: 100%;
        text-align: center;
    }
}