/* Mobile login repair. Keep the existing colors and authentication behavior. */
/* The lightweight layer uses important rules for the mobile navigation. */
@layer abc-lite {
  @media (max-width: 768px) {
    body:has(#loginScreen:not(.hidden)) #mobileFluidNav {
      display: none !important;
    }
  }
}

@media (max-width: 768px) {
  body:has(#loginScreen:not(.hidden)) {
    overflow: hidden;
  }

  body:has(#loginScreen:not(.hidden)) :is(.sidebar, .topbar, .shell, .mobile-bottom-nav) {
    display: none !important;
  }

  #loginScreen {
    z-index: 80000;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    height: 100dvh;
    min-height: 0;
    padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  #loginForm {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    width: min(100%, 400px);
    min-width: 0;
    margin: auto;
    padding: 24px 20px;
    border-radius: 24px;
    transform: none;
  }

  #loginForm img {
    display: block;
    width: min(190px, 100%);
    height: auto;
    max-height: 90px;
    object-fit: contain;
    justify-self: center;
  }

  #loginForm h2 {
    font-size: clamp(1.4rem, 6vw, 1.75rem);
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  #loginForm input,
  #loginForm .button {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    font-size: 16px;
    line-height: 1.4;
    border-radius: 14px;
    transform: none;
  }

  #loginForm .button {
    white-space: normal;
    padding: 12px 16px;
  }
}
