/* internal/web/static/style.css
 * 123infra beta portal - dark ground, emerald/cyan brand accents, copied
 * from the marketing repo's brand/tokens.css (values only, no runtime
 * reference to that repo - AGENTS.md law 10, WP7.1). Values recomputed
 * and contrast-checked for THIS page's actual pairings; see
 * internal/web/red_test.go's TestRedContrast for the checked pairs.
 *
 * No @import, no url() to anything but /static/fonts/*.ttf (same origin).
 */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/inter-400.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/inter-700.ttf') format('truetype');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/jetbrains-mono-500.ttf') format('truetype');
}

:root {
  --color-bg: #06080c;
  --color-surface: #0b1220;
  --color-surface-raised: #141d2d;
  --border-subtle: #1e293b;
  --border-strong: #64748b;   /* meets 3:1 on --color-surface: form fields, buttons */

  --text-primary: #e8edf4;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;   /* large text / labels only, see TestRedContrast */

  --color-emerald: #34d399;
  --color-cyan: #22d3ee;
  --color-error: #f87171;
  --on-color-text: #06080c;   /* text placed on a filled emerald/cyan button */

  --brand-gradient: linear-gradient(135deg, var(--color-emerald), var(--color-cyan));

  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  --focus-ring: 0 0 0 3px rgba(34, 211, 238, 0.55);

  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  padding-block: 2rem;
  padding-inline: max(1rem, env(safe-area-inset-left, 0px));
}

.page {
  max-width: 40rem;
  margin: 0 auto;
}

header.site {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

header.site img.mark {
  width: 2rem;
  height: 2rem;
}

header.site .wordmark {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 1.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.5625rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

p { margin: 0 0 1rem; }

a {
  color: var(--color-cyan);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:hover { color: var(--color-emerald); }

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 4px;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.card.summary {
  border-color: var(--border-strong);
}

.flash, .error-banner {
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}

.flash { background: var(--color-surface-raised); border: 1px solid var(--color-emerald); }
.error-banner { background: var(--color-surface-raised); border: 1px solid var(--color-error); color: var(--text-primary); }

/* ---- key-share progress: text first, shapes as a secondary cue ------ */
.shares {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.shares .count { font-weight: 500; }

.shares .dots {
  display: inline-flex;
  gap: 0.3rem;
  margin-inline-start: 0.6rem;
  vertical-align: middle;
}

.shares .dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: transparent;
}

.shares .dot.done { background: var(--color-emerald); border-color: var(--color-emerald); }

/* ---- forms ------------------------------------------------------------ */
form { margin: 0; }

label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.field-group { margin-bottom: 1.25rem; }

.hint, .field-error {
  font-size: 0.8125rem;
  margin-top: 0.35rem;
}

.hint { color: var(--text-secondary); }
.field-error { color: var(--color-error); font-weight: 500; }

input[type="text"], input[type="email"] {
  width: 100%;
  background: var(--color-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  font-family: inherit;
}

input[type="text"]:focus, input[type="email"]:focus {
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: var(--color-cyan);
}

.choice-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  accent-color: var(--color-emerald);
  border: 1px solid var(--border-strong);
}

/* ---- buttons ----------------------------------------------------------- */
.btn {
  display: inline-block;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  padding: 0.65rem 1.25rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--brand-gradient);
  color: var(--on-color-text);
}

.btn-secondary {
  background: var(--color-surface-raised);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- tables / status rows ------------------------------------------- */
table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
th, td { text-align: left; padding: 0.5rem 0.25rem; border-bottom: 1px solid var(--border-subtle); }
th { color: var(--text-secondary); font-weight: 500; font-size: 0.875rem; }

.state { font-family: var(--font-mono); font-size: 0.875rem; }
.state.active { color: var(--color-emerald); }
.state.failed { color: var(--color-error); }
.state.pending, .state.invited { color: var(--text-tertiary); }

footer.site {
  margin-top: 3rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 400px) {
  .page { max-width: 100%; }
  h1 { font-size: 1.5625rem; }
}
