/*
 * Sign-in, forgotten password, and reset. Three pages that render through
 * application.html.erb rather than the console layout, and until now the only
 * styling they had was `style="color:red"` on a flash.
 *
 * They matter more than three small forms suggest: this is the first thing a new
 * operator sees, and the page somebody lands on at 2am when their session has
 * expired mid-incident. An unstyled form reads as a half-finished internal tool,
 * which is exactly the wrong thing to think about a console that controls 65
 * point-of-sale systems.
 *
 * Scoped to .auth-page for the same reason every rule in console.css is scoped:
 * application.html.erb links stylesheets with `stylesheet_link_tag :app`, which
 * Propshaft expands to EVERY css file under app/assets, so a bare `body` or
 * `input` rule here would reach the console too. `body:has(.auth-page)` is what
 * lets the page own its background without a layout change —
 * ApplicationController's `allow_browser versions: :modern` already requires
 * :has support, so this is not a new floor.
 *
 * The tokens are console.css's, restated rather than shared: a variable defined
 * on .console-page cannot reach a page that has no .console-page on it. The
 * IBM Plex faces ARE shared — @font-face is global, and :app links console.css
 * too. The ground is the console sidebar's dark in both schemes, so the first
 * screen is recognisably the same application.
 */

.auth-page {
  --panel: #ffffff;
  --ink: #161b26;
  --ink-2: #5b6475;
  --rule: #d6dae1;
  --accent: #3451d1;
  --go: #0f6b47;
  --go-wash: #e5f4ec;
  --stop: #b42318;
  --stop-wash: #fdecea;
}

@media (prefers-color-scheme: dark) {
  .auth-page {
    --panel: #151a22;
    --ink: #e6e9ef;
    --ink-2: #9ba4b4;
    --rule: #2a313d;
    --accent: #7d8cff;
    --go: #74d3a0;
    --go-wash: #12271d;
    --stop: #ff8d7e;
    --stop-wash: #2c1815;
  }
}

body:has(.auth-page) { margin: 0; background: #121620; }

.auth-page {
  box-sizing: border-box;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 2.5rem 1rem 3rem;
  font: 14px/1.55 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.auth-page * { box-sizing: border-box; }

.auth-page__brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.auth-page__logo { width: 2rem; height: 2rem; display: block; }

.auth-card {
  width: 100%;
  max-width: 24rem;
  background: var(--panel);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

/* Which fleet, before anything else on the card. */
.auth-card__env {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.5rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.auth-card__env--live { background: #2a1215; color: #ff9b8f; }
.auth-card__env--test { background: #1b2433; color: #9fc1ff; }
.auth-card__dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; }

.auth-card__body { display: flex; flex-direction: column; gap: 1rem; padding: 1.6rem 1.5rem 1.5rem; }

.auth-page h1 { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.auth-page__lede { color: var(--ink-2); margin: -0.4rem 0 0; }

.auth-page form { display: flex; flex-direction: column; gap: 1rem; }

.auth-page label { font-size: 0.86rem; font-weight: 500; display: block; margin-bottom: 0.35rem; }
.auth-page__label-row { display: flex; align-items: baseline; justify-content: space-between; }
.auth-page__label-row a { font-size: 0.86rem; }
.auth-page a { color: var(--accent); text-decoration: none; }
.auth-page a:hover { text-decoration: underline; text-underline-offset: 2px; }

.auth-page input[type="email"],
.auth-page input[type="password"] {
  font: inherit;
  width: 100%;
  height: 2.6rem;
  padding: 0 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
}

.auth-page input[type="submit"] {
  font: inherit;
  font-weight: 600;
  height: 2.6rem;
  margin-top: 0.25rem;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.auth-page input[type="submit"]:hover { opacity: 0.9; }
.auth-page :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.auth-page__message {
  margin: 0;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--rule);
  font-size: 0.92rem;
}

.auth-page__message--alert { border-color: var(--stop); background: var(--stop-wash); color: var(--stop); }
.auth-page__message--notice { border-color: var(--go); background: var(--go-wash); color: var(--go); }

.auth-page__aside { font-size: 0.9rem; margin: 0; }

.auth-page__foot { margin: 0; font-size: 0.82rem; color: #8a93a3; text-align: center; }
