/* ==========================================================================
   mc-impersonation-banner — persistent top-of-page warning strip shown
   while a superuser has "signed in as" another user.

   Design intent:
     * IMPOSSIBLE to miss. Operators who forget they're impersonating
       cause real incidents — the banner is amber, bold, and sticky to
       the top of the scroll container.
     * One click to exit — the button is right there on every page.
     * Accessible — `role="status"` + `aria-live="polite"`; colour is
       reinforced by an icon + explicit text, never colour-only.
   ========================================================================== */

.mc-impersonation-banner {
    position: sticky;
    top: 0;
    z-index: 9500; /* above modals? No — modals are 9999. Below modals. */
    display: flex;
    align-items: center;
    gap: var(--mc-space-3, 12px);
    padding: var(--mc-space-2, 8px) var(--mc-space-4, 16px);
    background: linear-gradient(
        90deg,
        #f59e0b 0%,     /* amber-500 */
        #f97316 100%    /* orange-500 */
    );
    color: #111827;
    font-size: var(--mc-text-sm, 0.875rem);
    font-weight: 500;
    box-shadow: 0 2px 8px -2px rgba(245, 158, 11, 0.4);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.mc-impersonation-banner__icon {
    font-size: 22px;
    line-height: 1;
    color: #7c2d12; /* amber-900 — strong contrast on the orange gradient */
    flex: none;
}

.mc-impersonation-banner__text {
    flex: 1;
    line-height: 1.4;
}

.mc-impersonation-banner__target,
.mc-impersonation-banner__admin {
    font-weight: 700;
    font-family: var(--mc-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.08);
}

.mc-impersonation-banner__form {
    flex: none;
    margin: 0;
}

.mc-impersonation-banner__exit {
    appearance: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #111827;
    color: #fef3c7;
    font: inherit;
    font-size: var(--mc-text-sm, 0.875rem);
    font-weight: 600;
    border: 1px solid #111827;
    border-radius: var(--mc-radius-sm, 6px);
    transition: background 150ms ease, transform 150ms ease;
}
.mc-impersonation-banner__exit:hover {
    background: #1f2937;
    transform: translateY(-1px);
}
.mc-impersonation-banner__exit:focus-visible {
    outline: 2px solid #111827;
    outline-offset: 3px;
}
.mc-impersonation-banner__exit .material-symbols-rounded {
    font-size: 18px;
    line-height: 1;
}

@media (max-width: 640px) {
    .mc-impersonation-banner {
        flex-wrap: wrap;
        gap: var(--mc-space-2, 8px);
        padding: var(--mc-space-2, 8px);
    }
    .mc-impersonation-banner__text {
        flex: 1 1 100%;
    }
    .mc-impersonation-banner__exit {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mc-impersonation-banner__exit { transition: none; }
    .mc-impersonation-banner__exit:hover { transform: none; }
}
