:root {
  --auth-logo-inline-size: min(100%, clamp(13rem, 44vw, 23rem));
  --auth-logo-compact-inline-size: min(100%, clamp(11.5rem, 36vw, 18.5rem));
  --auth-logo-max-block-size: clamp(4rem, 10vh, 7.25rem);
  --auth-logo-compact-max-block-size: clamp(3.25rem, 8vh, 5.25rem);
  --auth-logo-filter: none;
  --auth-logo-opacity: 0.98;
  --auth-logo-blend-mode: normal;
}

html[data-theme="dark"] {
  --auth-logo-filter:
    drop-shadow(0 0 0.05rem rgba(255, 255, 255, 0.55))
    drop-shadow(0 0.22rem 0.7rem rgba(255, 255, 255, 0.14))
    brightness(1.08)
    contrast(1.06);
  --auth-logo-opacity: 0.96;
}

html[data-theme="sovereign"] {
  --auth-logo-filter: saturate(1.03) contrast(1.04);
}

html[data-theme="sandf"],
html[data-theme="defence"] {
  --auth-logo-filter: saturate(1.04) contrast(1.03);
}

.auth-brand-header {
  display: grid !important;
  justify-items: center;
  gap: var(--space-3, 0.75rem);
  min-width: 0;
  text-align: center;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
}

.auth-brand-copy {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  min-width: 0;
}

.auth-login-logo {
  display: block !important;
  flex: 0 1 auto;
  inline-size: var(--auth-logo-inline-size);
  width: var(--auth-logo-inline-size);
  block-size: auto;
  height: auto;
  max-inline-size: 100%;
  max-block-size: var(--auth-logo-max-block-size);
  object-fit: contain;
  object-position: center;
  margin: 0 auto;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  background-color: transparent !important;
  opacity: var(--auth-logo-opacity);
  filter: var(--auth-logo-filter);
  mix-blend-mode: var(--auth-logo-blend-mode);
  image-rendering: auto;
}

.auth-login-logo--compact {
  inline-size: var(--auth-logo-compact-inline-size);
  width: var(--auth-logo-compact-inline-size);
  max-block-size: var(--auth-logo-compact-max-block-size);
}

.auth-login-logo[data-auth-logo-family="defence"] {
  inline-size: min(100%, clamp(12rem, 34vw, 20rem));
  width: min(100%, clamp(12rem, 34vw, 20rem));
  max-block-size: clamp(3.6rem, 9vh, 5.7rem);
}

.auth-login-logo--compact[data-auth-logo-family="defence"] {
  inline-size: min(100%, clamp(11rem, 31vw, 17rem));
  width: min(100%, clamp(11rem, 31vw, 17rem));
  max-block-size: clamp(3.25rem, 8vh, 5rem);
}

.auth-login-logo[data-auth-logo-state="loading"] {
  opacity: min(var(--auth-logo-opacity), 0.88);
}

.auth-login-logo[data-auth-logo-state="failed"] {
  opacity: 0.72;
}

@media (max-width: 640px) {
  :root {
    --auth-logo-inline-size: min(100%, clamp(12rem, 68vw, 19rem));
    --auth-logo-compact-inline-size: min(100%, clamp(10.5rem, 58vw, 16rem));
    --auth-logo-max-block-size: clamp(3.65rem, 9vh, 5.75rem);
    --auth-logo-compact-max-block-size: clamp(3rem, 7.5vh, 4.75rem);
  }

  .auth-brand-header {
    gap: var(--space-2, 0.5rem);
  }
}

@media (prefers-contrast: more) {
  .auth-login-logo {
    opacity: 1;
    filter: contrast(1.1);
  }
}

@media (forced-colors: active) {
  .auth-login-logo {
    forced-color-adjust: auto;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    filter: none !important;
    opacity: 1 !important;
  }
}
