/* ================================================================
   HubBits & MorDocs — Shared Premium Identity Seals
   Used by Staff Command and the authenticated Customer Realm header.
   ================================================================ */

.hm-identity-seal {
    --hm-identity-gold: 216, 188, 120;
    --hm-identity-violet: 151, 108, 226;
    --hm-identity-ink: rgba(8, 7, 12, .94);

    position: relative;
    isolation: isolate;
    display: inline-flex;
    min-width: 0;
    max-width: 238px;
    min-height: 42px;
    align-items: center;
    gap: 9px;
    overflow: hidden;
    padding: 6px 12px 6px 7px;
    border: 1px solid rgba(var(--hm-identity-gold), .30);
    border-radius: 999px;
    background:
        radial-gradient(
            circle at 18% 22%,
            rgba(var(--hm-identity-violet), .15),
            transparent 48%
        ),
        linear-gradient(145deg, rgba(255, 255, 255, .032), transparent 54%),
        var(--hm-identity-ink);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .055),
        inset 0 0 22px rgba(var(--hm-identity-violet), .052),
        0 8px 22px rgba(0, 0, 0, .18);
    color: #f3eee4;
    text-decoration: none;
    white-space: nowrap;
    transition:
        max-width .24s ease,
        border-color .22s ease,
        background .22s ease,
        box-shadow .24s ease,
        color .20s ease,
        transform .20s ease;
}

.hm-identity-seal::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    right: 12%;
    left: 22%;
    height: 1px;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(var(--hm-identity-gold), .08) 24%,
        rgba(var(--hm-identity-gold), .48) 62%,
        transparent
    );
    opacity: .78;
}

.hm-identity-seal::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(
        108deg,
        transparent 0 42%,
        rgba(var(--hm-identity-violet), .08) 46%,
        rgba(var(--hm-identity-gold), .20) 50%,
        rgba(255, 255, 255, .09) 52%,
        transparent 57% 100%
    );
    opacity: 0;
    transform: translateX(-86%);
}

.hm-identity-seal:hover,
.hm-identity-seal:focus-visible {
    border-color: rgba(var(--hm-identity-gold), .46);
    background:
        radial-gradient(
            circle at 20% 28%,
            rgba(var(--hm-identity-violet), .20),
            transparent 50%
        ),
        linear-gradient(145deg, rgba(255, 255, 255, .045), transparent 56%),
        var(--hm-identity-ink);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .075),
        inset 0 0 24px rgba(var(--hm-identity-violet), .072),
        0 10px 24px rgba(0, 0, 0, .22),
        0 0 16px rgba(var(--hm-identity-violet), .055);
    color: #fffaf0;
    text-decoration: none;
    transform: translateY(-1px);
}

.hm-identity-seal:hover::after,
.hm-identity-seal:focus-visible::after {
    animation: hmIdentitySealShimmer 1.05s cubic-bezier(.2, .72, .2, 1) 1;
}

.hm-identity-seal:focus-visible {
    outline: 2px solid rgba(var(--hm-identity-violet), .42);
    outline-offset: 3px;
}

.hm-identity-seal__sigil {
    display: inline-grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    border: 1px solid rgba(var(--hm-identity-violet), .28);
    border-radius: 50%;
    background:
        radial-gradient(
            circle,
            rgba(var(--hm-identity-violet), .16),
            rgba(7, 6, 10, .72) 72%
        );
    color: #dfc779;
    box-shadow:
        inset 0 0 10px rgba(var(--hm-identity-violet), .08),
        0 0 9px rgba(var(--hm-identity-violet), .07);
    font-size: 8px;
    line-height: 1;
    text-shadow: 0 0 6px rgba(var(--hm-identity-gold), .24);
}

.hm-identity-seal__copy {
    display: grid;
    min-width: 0;
    max-width: 186px;
    line-height: 1.05;
    transition:
        max-width .22s ease,
        opacity .18s ease,
        transform .22s ease;
}

.hm-identity-seal__name,
.hm-identity-seal__authority {
    overflow: hidden;
    text-overflow: ellipsis;
}

.hm-identity-seal__name {
    color: #f3eee4;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .005em;
}

.hm-identity-seal__authority {
    margin-top: 3px;
    color: rgba(224, 201, 143, .80);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.hm-identity-seal--customer {
    --hm-identity-gold: 201, 169, 107;
    --hm-identity-violet: 156, 108, 255;
    margin: 0 2px;
}

.hm-identity-seal--customer .hm-identity-seal__authority {
    color: rgba(207, 180, 238, .82);
}

@keyframes hmIdentitySealShimmer {
    0% {
        opacity: 0;
        transform: translateX(-86%);
    }
    24% {
        opacity: .62;
    }
    76% {
        opacity: .30;
    }
    100% {
        opacity: 0;
        transform: translateX(92%);
    }
}

/* Collapse identity copy before the desktop navigation becomes crowded. */
@media (max-width: 1420px) and (min-width: 981px) {
    .site-header--gateway .hm-identity-seal--customer {
        width: 40px;
        max-width: 40px;
        justify-content: center;
        gap: 0;
        padding-right: 5px;
        padding-left: 5px;
    }

    .site-header--gateway .hm-identity-seal--customer .hm-identity-seal__copy {
        max-width: 0;
        opacity: 0;
        transform: translateX(5px);
    }
}

@media (max-width: 1100px) and (min-width: 801px) {
    .staff-site-header .hm-identity-seal--staff {
        width: 42px;
        max-width: 42px;
        justify-content: center;
        gap: 0;
        padding-right: 6px;
        padding-left: 6px;
    }

    .staff-site-header .hm-identity-seal--staff .hm-identity-seal__copy {
        max-width: 0;
        opacity: 0;
        transform: translateX(5px);
    }
}

/* Once the Customer menu becomes a panel, identity gets a calm full row. */
@media (max-width: 980px) {
    .site-nav--gateway .hm-identity-seal--customer {
        width: 100%;
        max-width: none;
        grid-column: 1 / -1;
        justify-content: flex-start;
        gap: 9px;
        padding-right: 12px;
        padding-left: 7px;
    }

    .site-nav--gateway .hm-identity-seal--customer .hm-identity-seal__copy {
        max-width: calc(100% - 40px);
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 800px) {
    .staff-site-header .hm-identity-seal--staff {
        width: auto;
        max-width: min(100%, 238px);
        justify-content: flex-start;
        gap: 9px;
        padding-right: 12px;
        padding-left: 7px;
    }

    .staff-site-header .hm-identity-seal--staff .hm-identity-seal__copy {
        max-width: 186px;
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 520px) {
    .staff-site-header .hm-identity-seal--staff {
        width: 100%;
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hm-identity-seal,
    .hm-identity-seal__copy {
        transition: none;
    }

    .hm-identity-seal:hover::after,
    .hm-identity-seal:focus-visible::after {
        animation: none;
        opacity: .10;
        transform: none;
    }
}
