/* Sticky + compact header — crisp logo swap (no CSS scale blur) */

.auth-header {
  position: sticky;
  top: 0;
  z-index: 200;
}

.auth-header__official,
.auth-header__bar,
.auth-header__inner {
  transition:
    max-height 0.28s ease,
    padding 0.28s ease,
    opacity 0.22s ease,
    box-shadow 0.28s ease,
    background-color 0.28s ease,
    border-color 0.28s ease;
}

.auth-header__brand {
  position: relative;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
}

.auth-header__logo {
  display: block;
  width: auto;
  max-width: 100%;
  opacity: 1;
  filter: none;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.auth-header__logo--full {
  width: 110px;
  height: 52px;
}

.auth-header__logo--compact {
  display: none;
  width: 96px;
  height: 40px;
}

body.auth-header-scrolled .auth-header,
body.auth-header-scrolled .auth-header.auth-header--scrolled {
  background: var(--fdic-dark-blue, #003256);
}

body.auth-header-scrolled .auth-header__official {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  border-bottom-width: 0;
  pointer-events: none;
}

body.auth-header-scrolled .auth-header__bar {
  background: var(--fdic-dark-blue, #003256);
  border-bottom: 3px solid var(--fdic-gold-brand, #c0ae6a);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.22),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

body.auth-header-scrolled .auth-header {
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.06);
}

body.auth-header-scrolled .auth-header__inner {
  padding-top: 8px;
  padding-bottom: 8px;
}

body.auth-header-scrolled .auth-header__brand {
  min-height: 40px;
}

body.auth-header-scrolled .auth-header__logo--full {
  display: none;
}

body.auth-header-scrolled .auth-header__logo--compact {
  display: block;
}

/* FDIC.gov-style: compact mark + readable agency name (never hide subtitle) */
.auth-header__agency-name {
  display: none;
  max-width: 12.5rem;
  margin-left: 0.55rem;
  font-family: "Public Sans", var(--font-gov-sans, sans-serif);
  font-size: clamp(0.625rem, 1.6vw, 0.6875rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.015em;
  color: #fff;
  text-decoration: none;
  white-space: normal;
}

body.auth-header-scrolled .auth-header__brand {
  align-items: center;
  line-height: 1.2;
  max-width: min(100%, 20rem);
}

body.auth-header-scrolled .auth-header__agency-name {
  display: block;
  opacity: 1;
}

/* Scroll shrink: header nav only — never inherit global link colors */
.auth-header .auth-header__nav-link:link,
.auth-header .auth-header__nav-link:visited,
body.auth-header-scrolled .auth-header .auth-header__nav-link:link,
body.auth-header-scrolled .auth-header .auth-header__nav-link:visited {
  color: rgba(255, 255, 255, 0.94);
  text-decoration: none;
}

.auth-header .auth-header__nav-link--active:link,
.auth-header .auth-header__nav-link--active:visited,
body.auth-header-scrolled .auth-header .auth-header__nav-link--active:link,
body.auth-header-scrolled .auth-header .auth-header__nav-link--active:visited {
  color: var(--fdic-dark-blue, #003256);
  background: #fff;
  border-color: #fff;
}

body.auth-header-scrolled .auth-header--rr-banner .auth-rr-header-banner {
  max-height: 72px;
  object-fit: cover;
  object-position: top center;
}

body.auth-header-scrolled .auth-header--rr-banner .auth-header__nav-strip {
  background: var(--fdic-dark-blue, #003256);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

/* ---- Member portal ---- */

.portal-app .portal-top-header__brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 56px;
}

.portal-app .portal-top-header__logo--full {
  display: block;
  height: 56px;
  width: auto;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.portal-app .portal-top-header__logo--compact {
  display: none;
  height: 40px;
  width: auto;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

body.auth-header-scrolled .portal-app header.portal-top-header {
  background: var(--fdic-dark-blue, #003256) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

body.auth-header-scrolled .portal-app header.portal-top-header .portal-top-header__inner {
  padding-top: 6px;
  padding-bottom: 6px;
}

body.auth-header-scrolled .portal-app .portal-top-header__brand {
  min-height: 40px;
}

body.auth-header-scrolled .portal-app .portal-top-header__logo--full {
  display: none;
}

body.auth-header-scrolled .portal-app .portal-top-header__logo--compact {
  display: block;
}

.portal-app .portal-top-header__agency-name {
  display: none;
}

body.auth-header-scrolled .portal-app .portal-top-header__agency-name {
  display: block;
}

body.auth-header-scrolled .portal-app .portal-header-user,
body.auth-header-scrolled .portal-app .portal-header-signout {
  border-color: rgba(255, 255, 255, 0.72);
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

@media (max-width: 767px) {
  .auth-header__logo--full {
    width: 93px;
    height: 44px;
  }

  .auth-header__logo--compact {
    width: 84px;
    height: 36px;
  }

  .auth-header__brand {
    min-height: 44px;
  }

  body.auth-header-scrolled .auth-header__brand {
    min-height: 36px;
  }

  body.auth-header-scrolled .auth-header__inner {
    padding-top: 7px;
    padding-bottom: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-header,
  .auth-header__official,
  .auth-header__bar,
  .auth-header__inner {
    transition: none;
  }
}
