:root {
    --portal-blue: #009fe3;
    --portal-blue-dark: #007cad;
    --portal-blue-soft: #eaf7fc;

    --portal-green: #9eb73b;
    --portal-green-dark: #879d30;

    --portal-red: #c83c32;
    --portal-red-soft: #fff1ef;

    --portal-text: #183246;
    --portal-text-soft: #647583;

    --portal-white: #ffffff;
    --portal-surface: #f7f9fa;

    --portal-border: rgba(24, 50, 70, 0.1);
    --portal-shadow: 0 10px 35px rgba(24, 50, 70, 0.08);
}

/* =========================================================
   HEADER
========================================================= */

.portal-header {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1050;

    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--portal-border);
    box-shadow: 0 4px 20px rgba(24, 50, 70, 0.06);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.portal-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;

    width: 100%;
    height: 3px;

    background: linear-gradient(
        90deg,
        var(--portal-blue) 0%,
        var(--portal-blue) 74%,
        var(--portal-green) 74%,
        var(--portal-green) 100%
    );
}

.portal-navbar {
    min-height: 82px;
    padding: 0;
    background: transparent;
}

.portal-nav-container {
    width: 100%;
    max-width: 1500px;
    min-height: 82px;

    margin: 0 auto;
    padding: 0 clamp(24px, 5vw, 80px);

    display: flex;
    align-items: center;
    gap: clamp(30px, 4vw, 60px);
}

/* =========================================================
   MARCA
========================================================= */

.portal-brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;

    flex-shrink: 0;

    color: var(--portal-text);
    text-decoration: none;
}

.portal-brand:hover {
    color: var(--portal-text);
    text-decoration: none;
}

.portal-brand img {
    width: auto;
    height: 48px;
    display: block;
    object-fit: contain;
}

/* =========================================================
   CONTEÚDO DA NAVEGAÇÃO
========================================================= */

.portal-collapse {
    min-width: 0;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}

.portal-nav {
    margin: 0 auto;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;

    list-style: none;
}

.portal-nav .nav-item {
    display: flex;
    align-items: center;
}

.portal-nav-link {
    position: relative;

    min-height: 42px;
    padding: 0 15px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    color: var(--portal-text);
    font-size: 12px;
    font-weight: 750;
    line-height: 1;

    text-transform: uppercase;
    letter-spacing: 0.045em;
    text-decoration: none !important;

    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        transform 0.2s ease;
}

.portal-nav-link:hover,
.portal-nav-link:focus {
    color: var(--portal-blue-dark);
    background: var(--portal-blue-soft);
    transform: translateY(-1px);
}

.portal-nav-link.active {
    color: var(--portal-blue-dark);
    background: var(--portal-blue-soft);
}

.portal-nav-link.active::after {
    content: "";

    position: absolute;
    left: 50%;
    bottom: 5px;

    width: 18px;
    height: 2px;

    border-radius: 999px;
    background: var(--portal-blue);

    transform: translateX(-50%);
}

/* =========================================================
   AÇÕES
========================================================= */

.portal-nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;

    flex-shrink: 0;
}

.portal-nav-actions form {
    margin: 0;
}

/* FAQ */

.portal-faq-button {
    min-height: 40px;
    padding: 0 16px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    border: 1px solid transparent;
    border-radius: 10px;

    background: var(--portal-green);
    color: var(--portal-white) !important;

    font-size: 12px;
    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none !important;

    box-shadow: 0 7px 18px rgba(158, 183, 59, 0.22);

    transition:
        background-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.portal-faq-button svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.portal-faq-button:hover,
.portal-faq-button:focus {
    background: var(--portal-green-dark);
    color: var(--portal-white) !important;

    transform: translateY(-1px);
    box-shadow: 0 9px 22px rgba(158, 183, 59, 0.3);
}

/* Logout */

.portal-logout-button {
    min-height: 40px;
    padding: 0 14px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    border: 1px solid rgba(200, 60, 50, 0.18);
    border-radius: 10px;

    background: transparent;
    color: var(--portal-text);

    font-family: inherit;
    font-size: 12px;
    font-weight: 800;

    cursor: pointer;

    transition:
        color 0.2s ease,
        border-color 0.2s ease,
        background-color 0.2s ease,
        transform 0.2s ease;
}

.portal-logout-button svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.portal-logout-button:hover {
    color: var(--portal-red);
    border-color: rgba(200, 60, 50, 0.3);
    background: var(--portal-red-soft);
    transform: translateY(-1px);
}

/* =========================================================
   BOTÃO MOBILE
========================================================= */

.portal-toggler {
    width: 44px;
    height: 40px;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid rgba(0, 159, 227, 0.2);
    border-radius: 10px;

    background: var(--portal-white);

    box-shadow: none !important;
}

.portal-toggler:focus {
    border-color: rgba(0, 159, 227, 0.4);
    box-shadow: 0 0 0 4px rgba(0, 159, 227, 0.1) !important;
}

.portal-toggler-lines {
    width: 20px;
    height: 16px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.portal-toggler-lines i {
    width: 100%;
    height: 2px;

    display: block;

    border-radius: 999px;
    background: var(--portal-blue-dark);
}

/* =========================================================
   TELAS INTERMEDIÁRIAS
========================================================= */

@media (max-width: 1250px) {
    .portal-nav-container {
        gap: 25px;
        padding: 0 35px;
    }

    .portal-brand-text {
        display: none;
    }

    .portal-nav-link {
        padding: 0 11px;
        font-size: 11px;
    }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 991px) {
    .portal-header {
        position: sticky;
    }

    .portal-navbar,
    .portal-nav-container {
        min-height: 72px;
    }

    .portal-nav-container {
        padding: 0 22px;

        flex-wrap: wrap;
        justify-content: space-between;

        gap: 12px;
    }

    .portal-brand img {
        height: 42px;
    }

    .portal-brand-text {
        display: flex;
    }

    .portal-toggler {
        display: inline-flex;
    }

    .portal-collapse {
        width: 100%;
        flex-basis: 100%;

        display: block;

        margin: 0 0 18px;
        padding: 10px;

        border: 1px solid var(--portal-border);
        border-radius: 16px;

        background: var(--portal-white);
        box-shadow: var(--portal-shadow);
    }

    .portal-collapse:not(.show) {
        display: none;
    }

    .portal-collapse.collapsing {
        display: block;
    }

    .portal-nav {
        width: 100%;

        display: flex;
        flex-direction: column;
        align-items: stretch;

        gap: 3px;
    }

    .portal-nav .nav-item {
        width: 100%;
    }

    .portal-nav-link {
        width: 100%;
        min-height: 46px;

        justify-content: flex-start;

        padding: 0 15px;

        border-radius: 10px;

        font-size: 12px;
    }

    .portal-nav-link.active::after {
        top: 50%;
        right: 14px;
        bottom: auto;
        left: auto;

        width: 7px;
        height: 7px;

        transform: translateY(-50%);
    }

    .portal-nav-actions {
        width: 100%;

        margin-top: 9px;
        padding-top: 12px;

        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));

        border-top: 1px solid var(--portal-border);
    }

    .portal-nav-actions form {
        width: 100%;
    }

    .portal-faq-button,
    .portal-logout-button {
        width: 100%;
        min-height: 43px;
    }
}

/* =========================================================
   CELULARES
========================================================= */

@media (max-width: 520px) {
    .portal-nav-container {
        min-height: 68px;
        padding: 0 15px;
    }

    .portal-brand {
        gap: 9px;
    }

    .portal-brand img {
        height: 37px;
    }

    .portal-brand-text {
        min-width: auto;
        padding-left: 9px;
    }

    .portal-brand-text span {
        font-size: 8px;
    }

    .portal-brand-text strong {
        font-size: 15px;
    }

    .portal-toggler {
        width: 39px;
        height: 36px;
        border-radius: 8px;
    }

    .portal-collapse {
        border-radius: 13px;
        margin-bottom: 14px;
    }

    .portal-nav-actions {
        grid-template-columns: 1fr;
    }
}