/* BEZ Member Hub public-auth viewport fit.
   Loaded after the app stylesheet with high-specificity overrides so the login
   remains balanced on laptop-height screens without changing Hub layouts. */

#auth-portal {
  position: relative;
  height: 100dvh !important;
  min-height: 100dvh !important;
  padding: 0.75rem !important;
  overflow: hidden !important;
  background: #f5f9fd;
}

/* Keep the generated WebP for texture, and layer a visible BEZ architectural
   scene above it so the approved building/wave composition cannot disappear on
   high-key displays or protected-preview rendering. */
#auth-portal::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url('/brand/bez-login-scene.svg'), url('/brand/bez-login-background.webp');
  background-size: cover, cover;
  background-position: center center, center center;
  background-repeat: no-repeat, no-repeat;
  opacity: 1;
}

/* PilotAuthScreen already contains legacy decorative background/overlay divs.
   The pseudo-element above is now the single source of truth for the artwork. */
#auth-portal > div[aria-hidden='true'] {
  display: none !important;
}

#auth-portal > div.relative.z-10 {
  height: 100%;
  min-height: 0 !important;
  align-items: center;
  justify-content: center;
}

#auth-portal > div.relative.z-10 > section {
  width: min(100%, 540px);
  max-width: 540px !important;
  max-height: calc(100dvh - 1.5rem) !important;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(1.25rem, 2.4vh, 2rem) !important;
  border-radius: 18px !important;
  scrollbar-width: thin;
}

#auth-portal > div.relative.z-10 > section > div:first-child {
  transform: scale(0.88);
  transform-origin: center;
  margin-block: -0.35rem -0.45rem;
}

#auth-portal > div.relative.z-10 > section > div.mt-5 {
  margin-top: 0.75rem !important;
}

#auth-portal h1 {
  font-size: clamp(1.55rem, 3vh, 1.85rem) !important;
  line-height: 1.15 !important;
}

#auth-portal form {
  margin-top: 1.125rem !important;
}

#auth-portal form.space-y-5 > :not([hidden]) ~ :not([hidden]) {
  margin-top: 0.85rem !important;
}

#auth-portal label.mb-2 {
  margin-bottom: 0.375rem !important;
}

#auth-portal input[type='email'],
#auth-portal input[type='password'],
#auth-portal input[type='text'] {
  height: 48px !important;
}

#auth-portal form button[type='submit'] {
  height: 48px !important;
}

#auth-portal section > div:last-child {
  margin-top: 1rem !important;
  padding-top: 0.875rem !important;
}

@media (max-height: 760px) and (min-width: 640px) {
  #auth-portal > div.relative.z-10 > section {
    width: min(100%, 500px);
    max-width: 500px !important;
    padding: 1rem 1.35rem !important;
  }

  #auth-portal > div.relative.z-10 > section > div:first-child {
    transform: scale(0.78);
    margin-block: -0.6rem -0.7rem;
  }

  #auth-portal h1 {
    font-size: 1.5rem !important;
  }

  #auth-portal form {
    margin-top: 0.85rem !important;
  }

  #auth-portal form.space-y-5 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0.65rem !important;
  }

  #auth-portal input[type='email'],
  #auth-portal input[type='password'],
  #auth-portal input[type='text'],
  #auth-portal form button[type='submit'] {
    height: 44px !important;
  }

  #auth-portal section > div:last-child {
    margin-top: 0.75rem !important;
    padding-top: 0.65rem !important;
  }
}

@media (max-width: 639px) {
  #auth-portal {
    padding: 0.75rem !important;
  }

  #auth-portal::before {
    background-position: 58% center, 58% center;
  }

  #auth-portal > div.relative.z-10 > section {
    max-height: calc(100dvh - 1.5rem) !important;
    padding: 1.25rem !important;
    border-radius: 16px !important;
  }
}
