/* Auth + legal pages. Loaded after app.css by login.php, signup.php,
   terms.php, privacy.php, and 404.php — app.css itself stays untouched. */

/* Fill the real viewport height (mobile toolbars shrink 100%), and keep the
   card scrollable instead of clipped when the screen is short. */
.login-body {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 16px;
}

.login-card {
  width: min(400px, 100%);
  max-width: 100%;
}

/* Terms/Privacy reuse the card, just wider with a readable measure. */
.login-card.wide {
  width: min(720px, 100%);
  gap: 10px;
}

.login-card.wide h1 { font-size: 22px; }
.login-card.wide h2 { font-size: 16px; margin-top: 10px; }
.login-card.wide p,
.login-card.wide li { color: var(--text); }
.login-card.wide ul { margin: 0; padding-left: 20px; }
.login-card.wide .legal-updated { color: var(--muted); font-size: 12px; }

/* Emails, URLs, and long error text must wrap instead of scrolling the page. */
.login-card, .login-card p, .login-card li, .error { overflow-wrap: anywhere; }

/* Password input + show/hide toggle. */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 64px; }
.login-card .pw-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  margin: 0;
  padding: 4px 8px;
  background: none;
  color: var(--muted);
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.login-card .pw-toggle:hover { color: var(--text); }

.auth-hint { color: var(--muted); font-size: 12px; }

/* "Forgot password?" hangs off the password field, right-aligned. */
.auth-forgot {
  margin: -4px 0 0;
  text-align: right;
  font-size: 12px;
}
.auth-forgot a { white-space: nowrap; }
.auth-links { text-align: center; font-size: 12px; }
.auth-links a { white-space: nowrap; }

@media (max-height: 640px) {
  .login-body { place-items: start center; }
}

/* Phones: 16px form text (no iOS focus zoom), comfortable tap targets,
   links that wrap instead of pushing the card wide. */
@media (max-width: 640px) {
  .login-card input { font-size: 16px; }
  .login-card button { min-height: 44px; }
  .pw-wrap input { padding-right: 78px; }
  .login-card .pw-toggle {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 13px;
  }
  .auth-forgot a,
  .auth-links a { white-space: normal; }
}

@media (max-width: 480px) {
  .login-card { padding: 20px; }
  .login-card button[type="submit"] { width: 100%; }
  .login-card.wide h1 { font-size: 20px; }
}
