/* =========================================================
   HEADER FRAME
========================================================= */

.header {
    position: sticky;
    top: 0;

    width: 100%;
    min-height: 110px;

    z-index: 9999;

    background: black;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    width: 100%;
    max-width: 1340px;
    min-width: 0;

    margin: 0 auto;
    padding: 20px;
}

/* =========================================================
   LOGO
========================================================= */

.header .logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex: 0 0 auto;

    width: fit-content;
    min-width: 0;

    gap: 0.85rem;

    color: inherit;
    text-decoration: none;
}

.header .logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 64px;

    width: 64px;
    height: 64px;

    overflow: visible;
}

.header .logo-icon img {
    width: 180px;
    height: 180px;

    object-fit: contain;
    transform: translate(-20px, 0);
}

.header .logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    margin: 0;

    line-height: 1.05;
    text-align: left;
}

.header .logo-wordmark {
    color: #32abef;

    font-family: "Font Awesome 6 Free", sans-serif;
    font-size: 1.95rem;
    font-weight: 800;

    letter-spacing: 0.03em;
}

.header .logo-title {
    color: #fbfbfb;

    font-size: 1.4rem;
    font-weight: 800;
}

.header .logo-subtitle {
   color: rgb(255 255 255 / 55%);

    font-size: 0.82rem;
    font-weight: 700;

    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* =========================================================
   NAVIGATION CONTAINER
========================================================= */

.header .nav-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;

    min-width: 0;
    max-width: 100%;

    gap: 0.6rem;
    padding: 0.5rem;

    background: rgba(162, 219, 254, 0.89);
    border-radius: 18px;
}

/* =========================================================
   NAVIGATION BUTTONS
========================================================= */

.header .nav-buttons .btn,
.header .nav-buttons .nav-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;

    min-height: 40px;
    padding: 0.55rem 1.2rem;

    gap: 0.45rem;

    border: 0;
    border-radius: 999px;

    background:
        linear-gradient(
            135deg,
            #0ea5e9,
            #2563eb
        );

    color: #ffffff;

    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;

    text-decoration: none;
    white-space: nowrap;

    cursor: pointer;

    box-shadow:
        inset 0 0 0 1px rgba(14, 165, 233, 0.25);

    transition:
        background 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.header .nav-buttons .btn:hover,
.header .nav-buttons .nav-pill:hover {
    background: #020202;
    color: #ffffff;

    transform: translateY(-1px);
    text-decoration: none;
}

.header .nav-buttons .btn:focus-visible,
.header .nav-buttons .nav-pill:focus-visible {
    outline: 3px solid rgba(14, 165, 233, 0.35);
    outline-offset: 2px;
}

.header .nav-buttons .btn i,
.header .nav-buttons .nav-pill i {
    font-size: 0.9rem;
}

.header .nav-buttons .btn[href*="logout"] {
    color: #b91c1c;
}

/* =========================================================
   STOP IMPERSONATING
========================================================= */

.header .nav-buttons .nav-pill.impersonate-stop {
    border: 1px solid rgba(147, 51, 234, 0.25);

    background: #e0f2fe;
    color: #000000;

    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.header .nav-buttons .nav-pill.impersonate-stop i {
    color: #000000;
}

.header .nav-buttons .nav-pill.impersonate-stop:hover {
    border-color: rgba(124, 58, 237, 0.35);

    background: #e0f2fe;
    color: #000000;

    box-shadow: 0 5px 14px rgba(124, 58, 237, 0.18);
}

/* =========================================================
   MOBILE HEADER
========================================================= */

@media (max-width: 768px) {

    .header {
        min-height: 0;
    }

    .header-container {
        flex-direction: column;
        align-items: stretch;

        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }

    .header .logo {
        justify-content: center;

        width: 100%;
        min-width: 0;

        padding: 14px 18px;

        background:
            linear-gradient(
                180deg,
                #ffffff,
                #f8fafc
            );

        border: 1px solid rgba(0, 0, 0, 0.05);
        border-radius: 18px;

        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);

        text-align: center;
    }
    
    .header .logo-icon img {
    width: 130px;
    height: 130px;

    transform: translate(15px, 8px);
}

    .header .logo-text {
        align-items: center;

        margin: 0;

        text-align: center;
    }

    .header .logo-wordmark {
        font-size: 1.95rem;
    }

    .header .logo-title {
        font-size: 1.2rem;
    }

    .header .logo-subtitle {
        font-size: 0.8rem;
        letter-spacing: 0.1em;
    }

    .header .nav-buttons {
        justify-content: flex-start;
        flex-wrap: nowrap;

        width: 100%;
        max-width: 100%;
        min-width: 0;

        gap: 8px;
        padding: 6px 0;

        overflow-x: auto;
        overflow-y: hidden;

        white-space: nowrap;

        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .header .nav-buttons::-webkit-scrollbar {
        display: none;
    }

    .header .nav-buttons .btn,
    .header .nav-buttons .nav-pill {
        flex: 0 0 auto;
        white-space: nowrap;
    }
}

.cnctasphr-login-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.cnctasphr-header-logo-icon {
    display: block;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    object-fit: contain;
}

@media (max-width: 768px) {
    .cnctasphr-login-logo {
        gap: 9px;
    }

    .cnctasphr-header-logo-icon {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
    }
}


body.cnctasphr-community-sidebar-enabled
.cnctasphr-login-header-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding-left: 20px;
    padding-right: 20px;
    justify-content: space-between;
}

body.cnctasphr-community-sidebar-enabled
.cnctasphr-login-logo {
    margin-left: 0;
    margin-right: auto;
}

/* =========================================================
   CNCTASPHR MOBILE HEADER — CLEAN CENTERED BRAND
========================================================= */

@media (max-width: 768px) {

    body.cnctasphr-community-sidebar-enabled
    .cnctasphr-login-site-header {
        width: 100%;
        min-height: 94px;
        margin: 0;
        padding: 0;
        background: #000000 !important;
        border: 0;
        box-shadow: none;
    }

    body.cnctasphr-community-sidebar-enabled
    .cnctasphr-login-header-container {
        position: relative;
        display: block;
        width: 100%;
        max-width: none;
        min-height: 94px;
        margin: 0;
        padding: 0 72px 0 12px;
        background: #000000 !important;
        border: 0;
    }

    body.cnctasphr-community-sidebar-enabled
    .cnctasphr-login-logo {
        position: absolute;
        top: 50%;
        left: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 9px;
        width: max-content;
        max-width: calc(100% - 110px);
        min-height: 0;
        margin: 0 !important;
        padding: 0 !important;
        color: inherit;
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
        outline: 0;
        box-shadow: none !important;
        text-decoration: none;
        transform: translate(-50%, -50%);
    }

    body.cnctasphr-community-sidebar-enabled
    .cnctasphr-header-logo-icon {
        display: block;
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
        margin: 0;
        padding: 0;
        object-fit: contain;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    body.cnctasphr-community-sidebar-enabled
    .logo-text {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        min-width: 0;
        margin: 0;
        padding: 0;
        text-align: left;
    }

    body.cnctasphr-community-sidebar-enabled
    .logo-wordmark {
        display: block;
        margin: 0;
        color: #29a9eb !important;
        font-size: 1.65rem;
        font-weight: 500;
        line-height: 0.95;
        letter-spacing: -0.04em;
        white-space: nowrap;
    }

    body.cnctasphr-community-sidebar-enabled
    .logo-title {
        display: block;
        margin: 4px 0 0;
        color: #ffffff !important;
        font-size: 0.92rem;
        font-weight: 900;
        line-height: 1;
        white-space: nowrap;
    }

    body.cnctasphr-community-sidebar-enabled
    .logo-subtitle {
        display: block;
        margin: 3px 0 0;
        color: #9ca3af !important;
        font-size: 0.62rem;
        font-weight: 800;
        line-height: 1;
        letter-spacing: 0.045em;
        text-transform: uppercase;
        white-space: nowrap;
    }

    body.cnctasphr-community-sidebar-enabled
    .cnctasphr-community-header-tools {
        position: absolute;
        top: 50%;
        right: 12px;
        z-index: 10;
        display: block;
        width: auto;
        margin: 0;
        padding: 0;
        transform: translateY(-50%);
    }

    body.cnctasphr-community-sidebar-enabled
    .cnctasphr-community-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: auto;
        min-width: 44px;
        height: 42px;
        margin: 0;
        padding: 0 11px;
        color: #ffffff !important;
        background: transparent !important;
        /*border: 1px solid rgba(255, 255, 255, 0.38);*/
        border-radius: 0;
        box-shadow: none;
        font-size: 0.78rem;
        font-weight: 800;
    }

    body.cnctasphr-community-sidebar-enabled
    .cnctasphr-community-menu-toggle i {
        color: #29a9eb;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {

    body.cnctasphr-community-sidebar-enabled
    .cnctasphr-login-site-header,
    body.cnctasphr-community-sidebar-enabled
    .cnctasphr-login-header-container {
        min-height: 86px;
    }

    body.cnctasphr-community-sidebar-enabled
    .cnctasphr-login-logo {
        gap: 7px;
        max-width: calc(100% - 82px);
    }

    body.cnctasphr-community-sidebar-enabled
    .cnctasphr-header-logo-icon {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
    }

    body.cnctasphr-community-sidebar-enabled
    .logo-wordmark {
        font-size: 1.36rem;
    }

    body.cnctasphr-community-sidebar-enabled
    .logo-title {
        font-size: 0.76rem;
    }

    body.cnctasphr-community-sidebar-enabled
    .logo-subtitle {
        font-size: 0.51rem;
    }

    body.cnctasphr-community-sidebar-enabled
    .cnctasphr-community-menu-toggle {
        width: 38px;
        min-width: 38px;
        height: 38px;
        padding: 0;
    }

    body.cnctasphr-community-sidebar-enabled
    .cnctasphr-community-menu-toggle span {
        display: none;
    }
}

/* =========================================================
   CNCTASPHR SHARED STICKY HEADER
   DESKTOP + MOBILE
========================================================= */

/*
   overflow-x: hidden on html/body can create a scroll container
   and prevent position: sticky from following the viewport.
   clip prevents horizontal overflow without creating that
   competing scroll container.
*/
html {
    overflow-x: clip !important;
}

body {
    overflow-x: clip !important;
}

/*
   The shared header is a direct child of body.
   Keep one authoritative positioning rule here.
*/
body > header.header.cnctasphr-login-site-header {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10000 !important;
    width: 100%;
    align-self: flex-start;
    isolation: isolate;
}

/*
   Do not place scrolling or clipping on the header container.
*/
body > header.header.cnctasphr-login-site-header
.cnctasphr-login-header-container {
    position: relative;
    overflow: visible;
}

/* Reinforce the same rule inside the mobile layout. */
@media (max-width: 768px) {
    body.cnctasphr-community-sidebar-enabled
    > header.header.cnctasphr-login-site-header {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 10000 !important;
    }
}