:root {
    --hea-bg: #00222E;
    --hea-gold: #D4A94F;
    --hea-text: #ffffff;
    --hea-text-muted: rgba(255,255,255,0.75);
    --hea-shadow: rgba(0,0,0,0.15);
    --hea-radius: 8px;
    --hea-transition: 300ms ease;
}

#hea-header {
    width: 100%;
    background: var(--hea-bg);
}

#hea-header .hea-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 90px;
    gap: 12px;
}

#hea-header .hea-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

#hea-header .hea-logo-wrap {
    position: relative;
    display: inline-block;
    line-height: 0;
}

#hea-header .hea-logo-img {
    display: block;
    height: 66px;
    width: auto;
    transition: filter 400ms ease, transform 400ms ease;
    backface-visibility: hidden;
}

#hea-header .hea-logo-hover-img {
    position: absolute;
    top: 0;
    left: 0;
    filter: opacity(0);
}

#hea-header .hea-logo a:hover .hea-logo-normal,
#hea-header .hea-logo-wrap.hea-logo-hover .hea-logo-normal {
    filter: opacity(0) brightness(1.1);
    transform: scale(1.03);
}

#hea-header .hea-logo a:hover .hea-logo-hover-img,
#hea-header .hea-logo-wrap.hea-logo-hover .hea-logo-hover-img {
    filter: opacity(1) drop-shadow(0 0 18px rgba(212,169,79,0.55));
    transform: scale(1.03);
}

#hea-header .hea-mobile-panel {
    display: flex;
    flex: 1;
    align-items: center;
    gap: inherit;
}

#hea-header .hea-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

#hea-header .hea-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
}

#hea-header .hea-menu li {
    margin: 0;
    padding: 0;
}

#hea-header .hea-menu a {
    display: block;
    padding: 4px 10px;
    color: var(--hea-text);
    text-decoration: none;
    font-size: 17px;
    font-weight: 500;
    letter-spacing: 0.02em;
    position: relative;
    transition: color var(--hea-transition);
    white-space: nowrap;
    background: none;
    text-transform: none;
    line-height: 1.5;
    border: none;
    box-shadow: none;
}

#hea-header .hea-menu a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--hea-gold);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: width 300ms ease;
}

#hea-header .hea-menu a:hover {
    color: var(--hea-gold);
    background: none;
}

#hea-header .hea-menu a:hover::after {
    width: calc(100% - 20px);
}

#hea-header .hea-login-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 28px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.3;
    box-sizing: border-box;
    font-family: inherit;
    letter-spacing: 0.03em;
    text-transform: none;
    outline: none;
    border: 1px solid rgba(255,215,120,0.3);
    color: #00222E;
    text-shadow: 0 1px 2px rgba(255,235,180,0.3);

    background: linear-gradient(135deg,
        rgba(255,245,200,0.15) 0%,
        #F5D76E 5%,
        #D4A94F 25%,
        #B8922E 50%,
        #D4A94F 75%,
        #F5D76E 95%,
        rgba(255,245,200,0.15) 100%
    );
    background-size: 200% 200%;
    background-position: 0% 50%;

    box-shadow:
        inset 0 2px 0 rgba(255,255,255,0.35),
        inset 0 -1px 0 rgba(0,0,0,0.06),
        inset 0 0 0 1px rgba(255,215,120,0.15),
        0 4px 28px rgba(212,169,79,0.3),
        0 2px 4px rgba(0,0,0,0.08);

    transition: background-position 0.6s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

#hea-header .hea-login-trigger:hover {
    background-position: 100% 50%;
    transform: translateY(-3px);
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,0.4),
        inset 0 -1px 0 rgba(0,0,0,0.06),
        inset 0 0 0 1px rgba(255,215,120,0.25),
        0 8px 36px rgba(212,169,79,0.45),
        0 4px 8px rgba(0,0,0,0.12);
}

#hea-header .hea-login-area {
    flex-shrink: 0;
    position: relative;
}

#hea-header .hea-login-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 360px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.2);
    padding: 28px 28px;
    z-index: 10002;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 300ms ease, transform 300ms ease;
    border: 1px solid rgba(212,169,79,0.15);
    margin: 0;
    box-sizing: border-box;
}

#hea-header .hea-login-dropdown.is-open {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

#hea-header .hea-login-text {
    color: #1a1a1a;
    font-size: 22px;
    line-height: 1.5;
    margin: 0 0 20px;
    text-align: center;
    font-weight: 400;
}

#hea-header .hea-google-login-wrapper {
    display: flex;
    justify-content: center;
}

#hea-header .hea-user-area {
    position: relative;
}

#hea-header .hea-user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--hea-text);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50px;
    transition: background var(--hea-transition);
    font-family: inherit;
    box-shadow: none;
    margin: 0;
}

#hea-header .hea-user-trigger:hover {
    background: rgba(255,255,255,0.08);
}

#hea-header .hea-user-initials {
    font-size: 22px;
    font-weight: 700;
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--hea-gold);
    letter-spacing: 0.04em;
    line-height: 1.2;
    white-space: nowrap;
}

#hea-header .hea-chevron {
    transition: transform 300ms ease;
}

#hea-header .hea-user-trigger[aria-expanded="true"] .hea-chevron {
    transform: rotate(180deg);
}

#hea-header .hea-user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 260px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.2);
    padding: 24px;
    z-index: 10002;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 300ms ease, transform 300ms ease;
    border: 1px solid rgba(212,169,79,0.15);
    margin: 0;
    box-sizing: border-box;
}

#hea-header .hea-user-dropdown.is-open {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

#hea-header .hea-greeting {
    color: #1a1a1a;
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 16px;
    text-align: center;
}

#hea-header .hea-aluno-link {
    display: block;
    text-align: center;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: #00222E;
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    border-radius: 0;
    transition: background 300ms ease, transform 300ms ease;
    letter-spacing: 0.02em;
}

#hea-header .hea-aluno-link:hover {
    background: #003546;
    color: #ffffff;
    transform: translateY(-1px);
}

#hea-header .hea-logout-wrapper {
    display: flex;
    justify-content: center;
}

#hea-header .hea-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 10001;
    box-shadow: none;
    margin: 0;
    min-width: unset;
    min-height: unset;
}

#hea-header .hea-hamburger-bar {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--hea-text);
    border-radius: 2px;
    transition: all 300ms ease;
    transform-origin: center;
}

#hea-header .hea-hamburger.is-active .hea-hamburger-bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

#hea-header .hea-hamburger.is-active .hea-hamburger-bar:nth-child(2) {
    opacity: 0;
}

#hea-header .hea-hamburger.is-active .hea-hamburger-bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 1024px) {
    #hea-header .hea-container {
        position: relative;
        height: 72px;
        padding: 0 16px;
    }

    #hea-header .hea-logo-img {
        height: 50px;
    }

    #hea-header .hea-logo-hover-img {
        height: 50px;
    }

    #hea-header .hea-mobile-panel {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--hea-bg);
        flex-direction: row;
        align-items: center;
        padding: 16px 24px;
        z-index: 10000;
        opacity: 0;
        transition: opacity 300ms ease, transform 300ms ease;
        transform: translateY(-8px);
        box-sizing: border-box;
        max-height: calc(100dvh - 72px);
        overflow-y: auto;
        box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    }

    #hea-header .hea-mobile-panel.is-open {
        display: flex;
        opacity: 1;
        transform: translateY(0);
    }

    #hea-header .hea-mobile-panel .hea-nav {
        flex: 0 0 auto;
        display: flex;
        justify-content: flex-start;
    }

    #hea-header .hea-mobile-panel .hea-menu {
        flex-direction: column;
        gap: 2px;
        text-align: left;
    }

    #hea-header .hea-mobile-panel .hea-menu a {
        font-size: 17px;
        padding: 6px 12px;
        white-space: nowrap;
    }

    #hea-header .hea-mobile-panel .hea-menu a::after {
        bottom: 2px;
    }

    #hea-header .hea-mobile-panel .hea-menu a:hover::after {
        width: calc(100% - 24px);
    }

    #hea-header .hea-mobile-panel .hea-login-area {
        display: flex;
        justify-content: center;
        flex: 1;
        margin: 0;
        position: static;
        transform: none;
        z-index: auto;
    }

    #hea-header .hea-login-dropdown {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: calc(100% - 32px);
        max-width: 400px;
        padding: 24px;
        z-index: 10002;
    }

    #hea-header .hea-login-dropdown.is-open {
        transform: translate(-50%, -50%);
    }

    #hea-header .hea-hamburger {
        display: flex;
    }

    #hea-header .hea-user-dropdown {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: calc(100% - 32px);
        max-width: 320px;
        padding: 20px;
        z-index: 10002;
    }

    #hea-header .hea-user-dropdown.is-open {
        transform: translate(-50%, -50%);
    }
}

@media (max-width: 480px) {
    #hea-header .hea-container {
        height: 60px;
        padding: 0 12px;
    }

    #hea-header .hea-logo-img {
        height: 40px;
    }

    #hea-header .hea-logo-hover-img {
        height: 40px;
    }

    #hea-header .hea-mobile-panel {
        max-height: calc(100dvh - 60px);
        padding: 12px 16px;
    }

    #hea-header .hea-mobile-panel .hea-menu a {
        font-size: 16px;
        padding: 5px 10px;
    }

    #hea-header .hea-login-dropdown {
        padding: 20px;
        width: calc(100% - 24px);
    }
}

@media (prefers-reduced-motion: reduce) {
    #hea-header .hea-logo-img,
    #hea-header .hea-menu a,
    #hea-header .hea-menu a::after,
    #hea-header .hea-login-dropdown,
    #hea-header .hea-user-dropdown,
    #hea-header .hea-hamburger-bar,
    #hea-header .hea-chevron,
    #hea-header .hea-aluno-link {
        transition-duration: 0.01ms !important;
    }
}
