/* ScaleLounge portals V2: the client sign-in page (/login, inventory C01).
 * The page-16 card style: one card, the logo, the line, then either the password form or the
 * login-link form. /login never moves: every email and magic link points at it. Both themes come
 * from the tokens.
 *
 * ON CHARCOAL (Katie, 2026-10-10). The page behind the card is V2's charcoal, --pv-charcoal (#17191C,
 * the sidebar's colour), in BOTH themes; the card is as it was (--pv-surface: white in light, the
 * raised #23262A in dark), so it stands out. Nothing is drawn on the charcoal outside the card, so no
 * text or focus ring ever sits on it. While the card shows, the root behind it is charcoal too, so a
 * phone's overscroll never flashes the white page, and pv-portal-boot.js turns the browser bar
 * (theme-color) charcoal; the portal itself puts the bar back to its theme when it starts. Held by
 * server/test/login-charcoal.test.js. */

html.pv-app .pv-login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 32px 16px;
  background: var(--pv-charcoal);
}

html.pv-app:has(> body > .pv-login:not([hidden])),
html.pv-app:has(> body > .pv-login:not([hidden])) body {
  background: var(--pv-charcoal);
}

html.pv-app .pv-login__card {
  display: grid;
  gap: 18px;
  width: min(440px, 100%);
  padding: 36px 36px 30px;
  border: 1px solid var(--pv-border);
  border-radius: var(--pv-radius-card);
  background: var(--pv-surface);
}

html.pv-app .pv-login__brand {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

html.pv-app .pv-login__logo {
  width: 196px;
  height: auto;
}

html.pv-app .pv-login__logo--dark {
  display: none;
}

html.pv-app[data-pv-theme="dark"] .pv-login__logo--light {
  display: none;
}

html.pv-app[data-pv-theme="dark"] .pv-login__logo--dark {
  display: block;
}

html.pv-app .pv-login__tag {
  color: var(--pv-accent-text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html.pv-app .pv-login__title {
  font-size: 26px;
  line-height: 1.2;
  text-align: center;
}

html.pv-app .pv-login__sub {
  color: var(--pv-text-secondary);
  text-align: center;
}

html.pv-app .pv-login__form {
  display: grid;
  gap: 16px;
}

html.pv-app .pv-login__form[hidden] {
  display: none;
}

html.pv-app .pv-login__form .pv-btn--primary {
  width: 100%;
}

html.pv-app .pv-login__switch {
  justify-self: center;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--pv-text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

html.pv-app .pv-login__switch:hover {
  text-decoration-thickness: 2px;
}

html.pv-app .pv-login__msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--pv-radius);
  background: var(--pv-surface-muted);
  color: var(--pv-text);
}

html.pv-app .pv-login__msg[hidden] {
  display: none;
}

html.pv-app .pv-login__msg--error {
  background: var(--pv-status-danger-bg);
  color: var(--pv-status-danger-text);
}

html.pv-app .pv-login__msg--ok {
  background: var(--pv-status-success-bg);
  color: var(--pv-status-success-text);
}

html.pv-app .pv-login__msg .pv-icon {
  flex: none;
  margin-top: 2px;
}

html.pv-app .pv-login__join {
  padding-top: 16px;
  border-top: 1px solid var(--pv-divider);
  color: var(--pv-text-secondary);
  text-align: center;
}

html.pv-app .pv-login__join a {
  color: var(--pv-text);
  font-weight: 600;
  text-underline-offset: 3px;
}

html.pv-app .pv-login__preview {
  color: var(--pv-text-meta);
  font-size: 14px;
  text-align: center;
}

@media (max-width: 479px) {
  html.pv-app .pv-login {
    align-items: start;
    padding-top: 24px;
  }
  html.pv-app .pv-login__card {
    padding: 28px 20px 24px;
  }
}
