/* The look of the LangGuard login page: dark only (Login.tsx forces the .dark
   theme), the .dark tokens of client/src/index.css as hex, Plus Jakarta Sans,
   the threads background, and the login card (LoginShell.tsx AuthCard). The
   signed-in views use the app's Card, Input and Button styles on that page. */

/* Plus Jakarta Sans (SIL Open Font License 1.1, fonts/OFL.txt), from
   @fontsource-variable/plus-jakarta-sans. Served from this origin: the CSP
   allows fonts from 'self' only. */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(/fonts/plus-jakarta-sans-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --bg: #0e141c;          /* --background */
  --card: #151f2c;        /* --card */
  --ink: #e6f0f8;         /* --foreground */
  --muted: #8ba1b8;       /* --muted-foreground */
  --input: #1a2430;       /* --input */
  --primary: #00e0a8;     /* --primary */
  --on-primary: #0e141c;  /* --primary-foreground */
  --accent: #004c4c;      /* --accent */
  --error: #f87171;
  --line: rgba(255, 255, 255, 0.1);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; }
/* The sticky header must not cover the element that has keyboard focus. */
html { scroll-padding-top: 72px; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#threads {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
/* Only behind the signed-out views, like the app: its content pages have a
   plain background, and the lines would lower the text contrast. threads.js
   stops drawing too. */
body:not(.auth) #threads { display: none; }

/* Top bar of the signed-in views. The signed-out views show the logo in their card. */
header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
  padding: 12px 24px;
  background: rgba(14, 20, 28, 0.75);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
body.auth header { display: none; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}
.brand img { display: block; height: 28px; width: auto; }
.brand .product {
  margin-left: 4px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
}
#user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

main {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
body.auth main {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: none;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 32px 24px;
}

h1 {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
h1:focus { outline: none; }
h2 {
  margin: 36px 0 12px;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h3, h4 { margin: 20px 0 6px; font-size: 1rem; font-weight: 600; }
p { margin: 0 0 12px; }
a { color: var(--primary); }
strong { font-weight: 600; }

.muted { color: var(--muted); font-size: 0.875rem; }
.lede {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.625;
  text-wrap: pretty;
}
.notice { color: var(--muted); }
.error { color: var(--error); }

/* Card (components/ui/card.tsx): rounded-xl border bg-card shadow. Slightly
   see-through, so the threads show behind it, like the login card. */
.card {
  margin-bottom: 12px;
  padding: 20px;
  background: rgba(21, 31, 44, 0.85);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* The login card (AuthCard): max-w-md, p-8, rounded-2xl, logo on top. */
.auth-card {
  width: 100%;
  max-width: 28rem;
  margin: 0;
  padding: 32px;
  background: rgba(14, 20, 28, 0.6);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.auth-card h1 { margin: 0 0 8px; font-size: 1.5rem; line-height: 1.35; text-align: center; }
.auth-card .lede, .auth-card .notice { text-align: center; }
.auth-card .notice { margin-bottom: 0; font-size: 0.875rem; line-height: 1.55; }
.lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 24px;
}
.lockup img { display: block; height: clamp(36px, 11vw, 48px); width: auto; }

form { margin: 0; }
.stack > * + * { margin-top: 16px; }
label { display: block; margin-bottom: 8px; font-size: 0.875rem; font-weight: 500; }

/* Input (components/ui/input.tsx): bg-card, border-input, rounded-md, ring-1 on
   focus, text-base md:text-sm (16px on phones, so iOS Safari does not zoom). */
input[type="email"] {
  display: block;
  width: 100%;
  height: 36px;
  padding: 0 12px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--input);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="email"]::placeholder { color: var(--muted); opacity: 1; }
input[type="email"]:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

/* Button (components/ui/button.tsx): default and ghost variants. */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  background: var(--primary);
  color: var(--on-primary);
  border: 0;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
button:hover:enabled { background: rgba(0, 224, 168, 0.9); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.wide { width: 100%; height: 44px; font-size: 0.9375rem; }
button.ghost {
  height: 32px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-weight: 500;
}
button.ghost:hover:enabled { background: var(--accent); color: var(--primary); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Release list. The date is the first span of each card (the tests read it). */
.list { display: grid; gap: 10px; }
.list .card { margin: 0; }
.row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 16px;
}
a.plain {
  justify-content: flex-start;
  padding: 16px 20px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}
a.plain strong { font-size: 1rem; }
a.plain span { margin-left: auto; color: var(--muted); font-size: 0.875rem; }
/* Decorative glyphs: the second content value gives them an empty accessible
   name (browsers without that syntax use the first one). */
a.plain::after { content: '\203A'; content: '\203A' / ''; color: var(--muted); font-size: 1.25rem; line-height: 1; }
a.plain:hover { border-color: rgba(0, 224, 168, 0.5); background: rgba(21, 31, 44, 0.95); }
a.plain:hover::after { color: var(--primary); }

/* Release view. */
.back { margin: 0 0 16px; font-size: 0.875rem; }
.back a { color: var(--muted); text-decoration: none; }
.back a::before { content: '\2190\00a0'; content: '\2190\00a0' / ''; }
.back a:hover { color: var(--primary); }
.artifact strong { font-size: 1rem; }
.artifact .file { margin-top: 2px; font-size: 0.8125rem; overflow-wrap: anywhere; }
.artifact > p.muted { margin: 12px 0 0; }
.mono {
  margin-top: 12px;
  padding: 8px 10px;
  background: rgba(14, 20, 28, 0.7);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  word-break: break-all;
}

/* Release notes (render.js renderNotes: h2 to h4, ul, p, code, strong). */
.notes > :first-child { margin-top: 0; }
.notes > :last-child { margin-bottom: 0; }
.notes h2 { margin: 24px 0 8px; font-size: 1.0625rem; }
.notes ul { margin: 4px 0 12px; padding-left: 20px; }
.notes li + li { margin-top: 4px; }
.notes code {
  padding: 1px 6px;
  background: var(--input);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.85em;
}

@media (min-width: 768px) {
  .auth-card h1 { font-size: 1.875rem; line-height: 1.2; }
  input[type="email"] { font-size: 0.875rem; }
}
@media (max-width: 480px) {
  html { scroll-padding-top: 100px; }
  header { padding: 10px 16px; }
  main { padding: 24px 16px 56px; }
  .auth-card { padding: 24px; }
}
@media (forced-colors: active) {
  #threads { display: none; }
  button { border: 2px solid ButtonText; }
}
