/* Final mobile login alignment fixes. Loaded after the shared theme. */
@media (max-width: 900px) {
  html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
  body:has(.auth-page) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100dvh !important;
    padding: 16px !important;
    overflow-y: auto;
  }
  body:has(.auth-page) .auth-page {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 520px !important;
    min-height: calc(100dvh - 32px) !important;
    margin: 0 auto !important;
    padding: 0 !important;
    transform: none !important;
    min-width: 0 !important;
    max-inline-size: 520px !important;
    flex: none !important;
  }
  body:has(.auth-page) .auth-panel {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 500px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    justify-self: auto !important;
    align-self: auto !important;
    transform: none !important;
    max-inline-size: 500px !important;
    flex: none !important;
    overflow: hidden !important;
  }
  body:has(.auth-page) .auth-visual { display: none !important; }
}

@media (max-width: 520px) {
  body:has(.auth-page) { padding: 12px !important; }
  body:has(.auth-page) .auth-page {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    max-inline-size: calc(100vw - 24px) !important;
    min-height: calc(100dvh - 24px) !important;
  }
  body:has(.auth-page) .auth-panel {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    max-inline-size: calc(100vw - 24px) !important;
    padding: 26px 18px 30px !important;
    border-radius: 22px !important;
  }
  body:has(.auth-page) .auth-brand { gap: 10px; flex-wrap: wrap; }
  body:has(.auth-page) .auth-brand img { max-width: 145px; }
  body:has(.auth-page) .auth-form,
  body:has(.auth-page) .app-field,
  body:has(.auth-page) input,
  body:has(.auth-page) button { max-width: 100%; min-width: 0; }
  body:has(.auth-page) .toast {
    right: 12px !important;
    left: 12px !important;
    width: auto !important;
    max-width: none !important;
    text-align: center;
  }
}

@media (max-height: 650px) and (max-width: 900px) {
  body:has(.auth-page) { align-items: flex-start !important; }
}
