@import url('/geist-embedded.css');

:root {
  color-scheme: light;
  /* Nexus brand tokens, matching style.css exactly (docs/PORTAL-IA-SPEC.md
     section 10). Kept in sync manually since this page has no shared CSS
     file with the main app; if the token values in style.css ever change,
     update both. */
  --brand: #9abb3e;
  --brand-deep: #5f7326;
  --ink: #0A0A0B;
  --muted: #5C5C64;
  --bone: #F4F5F6;
  --surface: #FFFFFF;
  --line: #E7E7EA;
  --danger: #C8402F;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --brand: #9abb3e;
    --brand-deep: #abc553;
    --ink: #f5f5f4;
    --muted: #c3c2b7;
    --bone: #0a0a0b;
    --surface: #17181a;
    --line: rgba(255, 255, 255, 0.08);
    --danger: #f0605f;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #9abb3e;
  --brand-deep: #abc553;
  --ink: #f5f5f4;
  --muted: #c3c2b7;
  --bone: #0a0a0b;
  --surface: #17181a;
  --line: rgba(255, 255, 255, 0.08);
  --danger: #f0605f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bone);
  font-family: 'Geist', system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
}

.login-card {
  width: 320px;
  padding: 36px 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.25);
}

.mark {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

h1 {
  font-size: 1.1rem;
  margin: 0 0 4px;
}

.subtitle {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 24px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bone);
  color: var(--ink);
  font-size: 0.95rem;
  font-family: inherit;
}

input[type="password"]:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

/* Primary action is ink/black, not colorful, matching the rest of the app
   (docs/PORTAL-IA-SPEC.md section 10: "primary actions are ink/black
   buttons"). Cyan stays reserved for the mark and focus rings. */
button {
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  background: var(--ink);
  color: var(--surface);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

button:hover { opacity: 0.85; }
button:disabled { opacity: 0.6; cursor: default; }

.error {
  margin: 14px 0 0;
  color: var(--danger);
  font-size: 0.82rem;
}

/* Per-user sign-in: the form gained an email field and labels. The existing
   rules targeted input[type="password"] only, so the email input would have
   rendered unstyled. */
/* These rules referenced --text-secondary, --border, --surface-1 and
   --text-primary, none of which login.css defines, so every one of them fell
   through to its hardcoded LIGHT-mode fallback. In dark mode that rendered the
   email field as a white box with dark text sitting directly above a correctly
   dark password field in the same form, and the labels at 3.19:1. Aliased to
   the tokens this file does define, which are already theme-aware. */
:root {
  --text-primary: var(--ink);
  --text-secondary: var(--muted);
  --surface-1: var(--surface);
  --border: var(--line);
}

.field-label {
  display: block;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--text-secondary);
  margin: 14px 0 5px;
}
.field-label:first-of-type { margin-top: 4px; }

input[type="email"],
input[type="text"] {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.9rem;
}
input[type="email"]:focus,
input[type="text"]:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: transparent;
}

.login-foot {
  margin-top: 18px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
