/* ==========================================================================
   identity-guard.css — transient "your session changed" overlay
   --------------------------------------------------------------------------
   Shown by /js/identity-guard.js for a beat before it force-reloads a tab
   whose cookie identity changed in another tab (a login, logout, or account
   switch elsewhere in the same browser). Styled in the ProEstimate
   paper/charcoal/orange system so it reads as an intentional part of the app,
   not a crash or a random refresh.

   Tokens come from pe-design.css (loaded globally in App.razor); each var has
   a hard-coded fallback so the overlay is self-sufficient even if a page
   somehow renders without that stylesheet.

   High z-index + id selectors keep it above all page chrome. The element is
   injected/removed by the guard script, so it only exists for ~0.75s.
   ========================================================================== */

#pe-identity-switch {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(120% 120% at 50% 38%,
            #FAF8F2 0%,
            var(--pe-warm-bg, #F5F2EC) 55%,
            var(--pe-warm-end, #EDE8E0) 100%);
    font-family: var(--pe-font, Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
    animation: pe-id-fade 140ms ease both;
}

#pe-identity-switch .pe-id-card {
    width: min(320px, 100%);
    background: var(--pe-card, #FFFFFF);
    border: 1px solid var(--pe-card-border, rgba(90, 74, 53, 0.08));
    border-radius: 16px;
    box-shadow: var(--pe-shadow-lg, 0 24px 60px rgba(90, 74, 53, 0.18), 0 8px 24px rgba(90, 74, 53, 0.10));
    padding: 30px 32px 0;
    text-align: center;
    overflow: hidden;
    animation: pe-id-rise 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

#pe-identity-switch .pe-id-logo {
    width: 34px;
    height: 34px;
    display: block;
    margin: 0 auto 16px;
    filter: drop-shadow(0 2px 6px rgba(221, 145, 66, 0.28));
}

#pe-identity-switch .pe-id-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--pe-charcoal, #323232);
}

#pe-identity-switch .pe-id-body {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--pe-text-muted, rgba(50, 50, 50, 0.78));
}

/* Indeterminate sweep — bleeds to the card edges, reads as "working". */
#pe-identity-switch .pe-id-bar {
    position: relative;
    height: 3px;
    margin: 26px -32px 0;
    background: rgba(50, 50, 50, 0.06);
    overflow: hidden;
}

#pe-identity-switch .pe-id-bar > span {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg,
        rgba(221, 145, 66, 0) 0%,
        var(--pe-orange, #DD9142) 50%,
        rgba(221, 145, 66, 0) 100%);
    animation: pe-id-sweep 1100ms cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes pe-id-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes pe-id-rise {
    from { opacity: 0; transform: translateY(8px) scale(0.985); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

@keyframes pe-id-sweep {
    0%   { transform: translateX(-120%); }
    100% { transform: translateX(280%); }
}

@media (prefers-reduced-motion: reduce) {
    #pe-identity-switch,
    #pe-identity-switch .pe-id-card {
        animation: none;
    }
    #pe-identity-switch .pe-id-bar > span {
        animation: none;
        left: 30%;
        width: 40%;
        background: var(--pe-orange, #DD9142);
        opacity: 0.85;
    }
}
