/*
|--------------------------------------------------------------------------
| Shared BiasFlow glass header
|--------------------------------------------------------------------------
*/

.biasflow-header {
    position: fixed;
    z-index: 1000;
    top: 18px;
    right: 0;
    left: 0;
    height: 68px;
    color: #ffffff;
    pointer-events: none;
}

.biasflow-header-spacer {
    width: 100%;
    height: 104px;
}

.biasflow-header-inner {
    position: relative;
    display: flex;
    width: min(1380px, calc(100% - 48px));
    height: 68px;
    margin: 0 auto;
    padding: 0 22px;
    align-items: center;
    justify-content: space-between;
    overflow: visible;

    background:
        linear-gradient(
            135deg,
            rgba(21, 82, 78, 0.34),
            rgba(3, 28, 30, 0.5)
        );

    border: 1px solid rgba(128, 232, 220, 0.28);
    border-radius: 24px;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.24),
        0 2px 8px rgba(0, 0, 0, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(255, 255, 255, 0.025);

    backdrop-filter:
        blur(22px)
        saturate(145%);

    -webkit-backdrop-filter:
        blur(22px)
        saturate(145%);

    pointer-events: auto;
}

.biasflow-header-inner::before {
    position: absolute;
    z-index: -1;
    top: 1px;
    right: 20px;
    left: 20px;
    height: 45%;
    content: "";
    pointer-events: none;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.065),
            transparent
        );

    border-radius: 22px 22px 50% 50%;
}

/*
|--------------------------------------------------------------------------
| Logo
|--------------------------------------------------------------------------
*/

.biasflow-header-logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.biasflow-header-logo {
    display: block;
    width: auto;
    height: 34px;
}

/*
|--------------------------------------------------------------------------
| Header controls
|--------------------------------------------------------------------------
*/

.biasflow-header-controls {
    display: flex;
    align-items: center;
    gap: 9px;
}

.biasflow-account-control,
.biasflow-main-menu-control {
    position: relative;
}

/*
|--------------------------------------------------------------------------
| User button
|--------------------------------------------------------------------------
*/

.biasflow-user-button {
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0;
    cursor: pointer;
    place-items: center;
    color: #ffffff;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.095),
            rgba(2, 31, 32, 0.3)
        );

    border: 1px solid rgba(153, 239, 229, 0.25);
    border-radius: 13px;

    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.13);

    backdrop-filter:
        blur(14px)
        saturate(145%);

    -webkit-backdrop-filter:
        blur(14px)
        saturate(145%);

    text-decoration: none;

    transition:
        background 160ms ease,
        border-color 160ms ease,
        transform 160ms ease;
}

.biasflow-user-button:hover {
    background:
        linear-gradient(
            145deg,
            rgba(98, 234, 213, 0.2),
            rgba(8, 62, 61, 0.42)
        );

    border-color: rgba(98, 234, 213, 0.58);
}

.biasflow-user-button:focus-visible {
    outline: 2px solid #62ead5;
    outline-offset: 3px;
}

.biasflow-user-button:active {
    transform: scale(0.97);
}

.biasflow-user-button svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
}

.biasflow-user-button-initial {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    color: #062321;

    background:
        linear-gradient(
            135deg,
            #7cf2df,
            #4bd9c6
        );

    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 900;
}

/*
|--------------------------------------------------------------------------
| Hamburger button
|--------------------------------------------------------------------------
*/

.biasflow-menu-button {
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0;
    cursor: pointer;
    place-content: center;
    gap: 5px;
    color: #ffffff;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.095),
            rgba(2, 31, 32, 0.3)
        );

    border: 1px solid rgba(153, 239, 229, 0.25);
    border-radius: 13px;

    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.13);

    backdrop-filter:
        blur(14px)
        saturate(145%);

    -webkit-backdrop-filter:
        blur(14px)
        saturate(145%);

    transition:
        background 160ms ease,
        border-color 160ms ease,
        transform 160ms ease;
}

.biasflow-menu-button:hover {
    background:
        linear-gradient(
            145deg,
            rgba(98, 234, 213, 0.2),
            rgba(8, 62, 61, 0.42)
        );

    border-color: rgba(98, 234, 213, 0.58);
}

.biasflow-menu-button:focus-visible {
    outline: 2px solid #62ead5;
    outline-offset: 3px;
}

.biasflow-menu-button:active {
    transform: scale(0.97);
}

.biasflow-menu-button span {
    display: block;
    width: 19px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
    transform-origin: center;

    transition:
        transform 180ms ease,
        opacity 180ms ease;
}

.biasflow-header.is-main-menu-open
.biasflow-menu-button span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.biasflow-header.is-main-menu-open
.biasflow-menu-button span:nth-child(2) {
    opacity: 0;
}

.biasflow-header.is-main-menu-open
.biasflow-menu-button span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/*
|--------------------------------------------------------------------------
| Shared dropdown styling
|--------------------------------------------------------------------------
*/

.biasflow-menu-dropdown,
.biasflow-account-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    color: #ffffff;

    background:
        linear-gradient(
            145deg,
            rgba(24, 88, 83, 0.46),
            rgba(2, 25, 27, 0.76)
        );

    border: 1px solid rgba(128, 232, 220, 0.3);
    border-radius: 18px;

    box-shadow:
        0 22px 60px rgba(0, 0, 0, 0.42),
        0 6px 18px rgba(0, 0, 0, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.11),
        inset 0 -1px 0 rgba(255, 255, 255, 0.025);

    backdrop-filter:
        blur(26px)
        saturate(155%);

    -webkit-backdrop-filter:
        blur(26px)
        saturate(155%);

    transform: translateY(-8px) scale(0.985);
    transform-origin: top right;

    transition:
        opacity 160ms ease,
        visibility 160ms ease,
        transform 160ms ease;
}

.biasflow-menu-dropdown {
    width: min(290px, calc(100vw - 48px));
}

.biasflow-account-dropdown {
    right: -53px;
    width: min(330px, calc(100vw - 48px));
}

.biasflow-header.is-main-menu-open
.biasflow-menu-dropdown {
    visibility: visible;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.biasflow-header.is-account-menu-open
.biasflow-account-dropdown {
    visibility: visible;
    opacity: 1;
    transform: translateY(0) scale(1);
}

/*
|--------------------------------------------------------------------------
| Account profile section
|--------------------------------------------------------------------------
*/

.biasflow-account-profile {
    color: inherit;
    text-decoration: none;
    display: flex;
    min-width: 0;
    padding: 18px;
    align-items: center;
    gap: 13px;

    background:
        linear-gradient(
            135deg,
            rgba(98, 234, 213, 0.08),
            rgba(255, 255, 255, 0.025)
        );

    border-bottom: 1px solid rgba(128, 232, 220, 0.14);
}

.biasflow-account-avatar {
    display: grid;
    flex: 0 0 auto;
    width: 45px;
    height: 45px;
    place-items: center;
    color: #062321;

    background:
        linear-gradient(
            135deg,
            #7cf2df,
            #4bd9c6
        );

    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 13px;

    box-shadow:
        0 7px 18px rgba(0, 0, 0, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);

    font-size: 1rem;
    font-weight: 900;
}

.biasflow-account-profile-details {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.biasflow-account-profile-details span {
    color: rgba(175, 217, 211, 0.68);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.biasflow-account-profile-details strong {
    overflow: hidden;
    color: #f4fbfa;
    font-size: 0.94rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.biasflow-account-profile-details small {
    overflow: hidden;
    color: rgba(207, 226, 223, 0.68);
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/*
|--------------------------------------------------------------------------
| Navigation links
|--------------------------------------------------------------------------
*/

.biasflow-menu-navigation,
.biasflow-account-navigation {
    display: grid;
    gap: 5px;
    padding: 10px;
}

.biasflow-menu-link,
.biasflow-account-link {
    display: flex;
    min-height: 48px;
    padding: 11px 14px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: rgba(226, 241, 238, 0.76);

    background: rgba(255, 255, 255, 0.015);
    border: 1px solid transparent;
    border-radius: 12px;

    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;

    transition:
        color 150ms ease,
        background 150ms ease,
        border-color 150ms ease,
        transform 150ms ease;
}

.biasflow-menu-link:hover,
.biasflow-account-link:hover {
    color: #ffffff;
    background: rgba(98, 234, 213, 0.09);
    border-color: rgba(128, 232, 220, 0.17);
    transform: translateX(2px);
}

.biasflow-menu-link.is-active,
.biasflow-account-link.is-active {
    color: #062321;

    background:
        linear-gradient(
            135deg,
            #7cf2df,
            #51ddca
        );

    border-color: rgba(255, 255, 255, 0.22);

    box-shadow:
        0 7px 18px rgba(0, 0, 0, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.biasflow-menu-link:focus-visible,
.biasflow-account-link:focus-visible {
    outline: 2px solid #62ead5;
    outline-offset: -2px;
}

.biasflow-link-arrow {
    flex: 0 0 auto;
    color: currentColor;
    font-size: 0.95rem;
    opacity: 0.65;
}

/*
|--------------------------------------------------------------------------
| Account footer and sign out
|--------------------------------------------------------------------------
*/

.biasflow-account-footer {
    padding: 11px;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.015),
            rgba(0, 0, 0, 0.08)
        );

    border-top: 1px solid rgba(128, 232, 220, 0.14);
}

.biasflow-account-footer form {
    margin: 0;
}

.biasflow-signout-button {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    cursor: pointer;
    color: #f5aaaa;

    background:
        linear-gradient(
            135deg,
            rgba(232, 90, 90, 0.12),
            rgba(232, 90, 90, 0.045)
        );

    border: 1px solid rgba(238, 132, 132, 0.26);
    border-radius: 12px;

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.055);

    font: inherit;
    font-size: 0.84rem;
    font-weight: 800;

    transition:
        color 150ms ease,
        background 150ms ease,
        border-color 150ms ease;
}

.biasflow-signout-button:hover {
    color: #ffffff;
    background: rgba(232, 90, 90, 0.2);
    border-color: rgba(245, 145, 145, 0.48);
}

.biasflow-signout-button:focus-visible {
    outline: 2px solid #f09595;
    outline-offset: 2px;
}

/*
|--------------------------------------------------------------------------
| Mobile
|--------------------------------------------------------------------------
*/

@media (max-width: 620px) {
    .biasflow-header {
        top: 12px;
        height: 62px;
    }

    .biasflow-header-spacer {
        height: 86px;
    }

    .biasflow-header-inner {
        width: calc(100% - 24px);
        height: 62px;
        padding: 0 16px;
        border-radius: 19px;
    }

    .biasflow-header-logo {
        height: 29px;
    }

    .biasflow-user-button,
    .biasflow-menu-button {
        width: 40px;
        height: 40px;
        border-radius: 11px;
    }

    .biasflow-user-button-initial {
        width: 25px;
        height: 25px;
    }

    .biasflow-menu-dropdown {
        top: calc(100% + 10px);
        width: min(280px, calc(100vw - 24px));
        border-radius: 16px;
    }

    .biasflow-account-dropdown {
        top: calc(100% + 10px);
        right: -49px;
        width: min(310px, calc(100vw - 24px));
        border-radius: 16px;
    }

    .biasflow-account-profile {
        padding: 15px;
    }

    .biasflow-account-avatar {
        width: 42px;
        height: 42px;
    }
}
/*
|--------------------------------------------------------------------------
| Admin-only return-to-site button
|--------------------------------------------------------------------------
*/

.biasflow-home-button {
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0;
    place-items: center;
    color: #ffffff;
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.095),
            rgba(2, 31, 32, 0.3)
        );
    border: 1px solid rgba(153, 239, 229, 0.25);
    border-radius: 13px;
    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.13);
    backdrop-filter: blur(14px) saturate(145%);
    -webkit-backdrop-filter: blur(14px) saturate(145%);
    text-decoration: none;
    transition:
        background 160ms ease,
        border-color 160ms ease,
        transform 160ms ease;
}

.biasflow-home-button:hover {
    background:
        linear-gradient(
            145deg,
            rgba(98, 234, 213, 0.2),
            rgba(8, 62, 61, 0.42)
        );
    border-color: rgba(98, 234, 213, 0.58);
}

.biasflow-home-button:focus-visible {
    outline: 2px solid #62ead5;
    outline-offset: 3px;
}

.biasflow-home-button:active {
    transform: scale(0.97);
}

.biasflow-home-button svg {
    width: 21px;
    height: 21px;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 620px) {
    .biasflow-home-button {
        width: 40px;
        height: 40px;
        border-radius: 11px;
    }

    .biasflow-home-button svg {
        width: 20px;
        height: 20px;
    }
}
