/* Mobile-only redesign of the login page (index.html).
   The desktop side-by-side illustration + card layout (defined in
   style.css) stays exactly as it is above this breakpoint — it already
   fits the viewport without scrolling and wasn't the problem. Below it,
   this rewrites the layout from scratch as a single compact column: a
   small inline brand mark above one form card, both height- and
   width-aware so the whole page fits in one screen with no scrolling,
   on any phone. */

@media (max-width: 900px) {
  html, body.auth-page {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  body.auth-page::before,
  body.auth-page::after {
    display: none;
  }

  .auth-shell {
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    height: 100%;
    gap: 16px;
    padding: 16px;
  }

  .auth-illustration {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: none;
  }

  /* Fluid so one rule covers the whole range this file owns: a small badge
     next to the wordmark on a phone, growing to a proper logo on a tablet.
     height stays auto — the source image isn't square, so pinning both
     dimensions squashes it. */
  .auth-illustration img {
    width: clamp(46px, 11vw, 104px);
    max-width: none;
    height: auto;
    filter: none;
  }

  .auth-illustration .wordmark {
    font-size: clamp(23px, 4.2vw, 36px);
  }

  .auth-illustration .tagline {
    display: none;
  }

  .auth-panel {
    flex: 0 1 auto;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    padding: 22px 20px 18px;
  }

  .auth-panel h1 {
    font-size: 20px;
    margin-bottom: 2px;
  }

  .auth-panel .auth-subtitle {
    margin-bottom: 16px;
  }

  .auth-panel .field {
    margin-bottom: 12px;
  }

  .auth-row-between {
    margin-bottom: 16px;
  }

  .auth-divider {
    margin: 14px 0;
  }
}

/* Short-viewport safety net (small phones in landscape, or a phone with a
   tall on-screen keyboard prompt already up) — compress further rather
   than let anything scroll. */
@media (max-width: 900px) and (max-height: 620px) {
  .auth-illustration {
    display: none;
  }
  .auth-panel {
    padding: 18px 20px 16px;
  }
  .auth-panel h1 {
    font-size: 18px;
  }
  .auth-panel .auth-subtitle {
    margin-bottom: 12px;
  }
  .auth-panel .field {
    margin-bottom: 10px;
  }
  .auth-row-between {
    margin-bottom: 12px;
  }
  .auth-divider {
    margin: 10px 0;
  }
}
