/* Login page styles (Training Volume Tracker, phase 6).
 *
 * Gym Floor HUD theme, the same tokens as the app (src/index.css): #0A0C0D
 * canvas, a #131618 panel with a 1px #23282D border, the #D4FF3A volt call to
 * action, crimson for errors, monospaced tabular numbers. Mobile first at a
 * 390 px design width; no external fonts or images and no inline styles (the
 * page is served with the strict CSP, see server/http/security.mjs).
 */

:root {
  color-scheme: dark;
  --bg: #0a0c0d;
  --surface: #131618;
  --inset: #1a1e22;
  --text: #f3f5f7;
  --text-muted: #8d96a0;
  --text-faint: #5a626b;
  --border: #23282d;
  --border-strong: #343b42;
  --accent: #d4ff3a;
  --accent-hover: #e2ff7a;
  --accent-ink: #0a0c0d;
  --amber: #ff9f1c;
  --teal: #2ec4b6;
  --danger: #ff4d6d;
  --danger-soft: rgba(255, 77, 109, 0.12);
  --radius: 4px;
  --pad: 16px;
  --font: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "Helvetica Neue",
    Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

h1,
h2 {
  margin: 0;
  line-height: 1.3;
}

p {
  margin: 0;
}

/* ---- header -------------------------------------------------------------- */

.app-header {
  border-bottom: 1px solid var(--border);
  padding: 14px var(--pad);
}

.app-header__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 440px;
  margin: 0 auto;
}

.app-header__logo {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.app-header__text {
  min-width: 0;
}

.app-header__title {
  font-size: 1.0625rem;
  font-weight: 700;
}

.app-header__subtitle {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
}

/* ---- panel --------------------------------------------------------------- */

.app-main {
  max-width: 440px;
  margin: 0 auto;
  padding: 24px var(--pad);
  padding-bottom: max(48px, calc(24px + env(safe-area-inset-bottom, 0px)));
}

.panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--accent);
}

.login {
  padding: 22px var(--pad) var(--pad);
}

.login__kicker {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.login__title {
  margin-top: 4px;
  font-size: 1.375rem;
  font-weight: 700;
}

.login__hint {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.login__hint--small {
  font-size: 0.8125rem;
}

.login__form {
  margin-top: 18px;
}

.login__step + .login__step {
  margin-top: 16px;
}

.login__label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.login__input {
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--inset);
  color: var(--text);
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}

#nickname.login__input {
  font-family: var(--font);
  letter-spacing: 0.02em;
}

.login__input::placeholder {
  color: var(--text-faint);
}

.login__input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.login__input[aria-invalid="true"] {
  border-color: var(--danger);
}

.login__error {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--danger);
  border-left-width: 3px;
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.875rem;
}

.login__button {
  width: 100%;
  min-height: 56px;
  margin-top: 18px;
  padding: 12px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: inherit;
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.login__button:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.login__button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.login__button:disabled {
  border-color: var(--border-strong);
  background: var(--border-strong);
  color: var(--text-muted);
  cursor: progress;
}

.login__privacy {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 0.75rem;
}

@media (min-width: 720px) {
  .app-main {
    padding-top: 64px;
  }

  .login {
    padding: 28px 28px 24px;
  }
}
