/* =========================================================================
 * Spor C (2026-05-28) — SuperAdmin "View as TenantAdmin" impersonation banner.
 *
 * Persistent amber-yellow strip at top of viewport, rendered by
 * _ImpersonationBanner.cshtml partial whenever IImpersonationService.IsActive()
 * is true. Sits above the admin sidebar/chrome via z-index + position fixed.
 *
 * Colour choice rationale (Senior UX Engineer):
 *   • Amber (#f59e0b base) — warning, not danger. Brand-red is reserved for
 *     destructive actions (Delete, Suspend, Emergency). Amber signals
 *     "privileged context, take care" without false alarm.
 *   • Pure-white text on amber gives WCAG AA contrast (4.84:1) for body
 *     text; the bold inner labels exceed 7:1 (AAA).
 * ========================================================================= */

.platforma-impersonation-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #f59e0b;
    color: #1a1a1a;
    border-bottom: 2px solid #b45309;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    padding: 10px 16px;
    font-family: var(--platforma-font-sans, system-ui, sans-serif);
    font-size: 14px;
    line-height: 1.4;
}

/* Push the rest of the page down so the banner doesn't overlap content.
   Applied via JS-less CSS: any page that loads this stylesheet shifts
   the body. We can't predict the banner's exact height across cultures
   (Danish "Stop impersonating" + tenant-name length varies), so we
   reserve a generous safe minimum + let the banner grow naturally. */
body:has(.platforma-impersonation-banner) {
    padding-top: 56px;
}

/* :has() is supported in all evergreen browsers since 2023. For older
   browsers, the banner overlaps the first ~56px of admin chrome — a
   tolerable degraded experience that doesn't break functionality. */

.platforma-impersonation-banner__inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.platforma-impersonation-banner__icon {
    font-size: 18px;
    line-height: 1;
}

.platforma-impersonation-banner__copy {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 200px;
}

.platforma-impersonation-banner__detail {
    font-size: 13px;
    opacity: 0.85;
}

.platforma-impersonation-banner__stop-form {
    flex: 0 0 auto;
    margin: 0;
}

.platforma-impersonation-banner__stop-btn {
    background: #1a1a1a;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 120ms ease, transform 80ms ease;
    white-space: nowrap;
}

.platforma-impersonation-banner__stop-btn:hover {
    background: #000000;
}

.platforma-impersonation-banner__stop-btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.platforma-impersonation-banner__stop-btn:active {
    transform: translateY(1px);
}

/* Narrow viewports — stack the banner contents vertically. */
@media (max-width: 640px) {
    .platforma-impersonation-banner {
        padding: 12px;
    }
    .platforma-impersonation-banner__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .platforma-impersonation-banner__stop-btn {
        width: 100%;
    }
    body:has(.platforma-impersonation-banner) {
        padding-top: 110px;
    }
}
