/* Penduline intake. One sheet, no web fonts, no external requests.
   Colour pairs are checked for WCAG AA in tests/test_intake_static.py. */
:root {
  --ink: #1b1b18;
  --paper: #fbfaf6;
  --muted: #4a4a43;
  --accent: #1d4f3a;
  --rule: #d9d6cc;
  --note-bg: #f1efe6;
  --error: #8a1c1c;
  --focus: #1d4f3a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ecebe4;
    --paper: #161614;
    --muted: #b9b7ad;
    --accent: #8fd1b0;
    --rule: #3a3a35;
    --note-bg: #22221f;
    --error: #ff9c9c;
    --focus: #8fd1b0;
  }
}

* { box-sizing: border-box; }

html { font-size: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main, header, footer {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

header { padding-top: 2rem; }
footer { padding-bottom: 3rem; color: var(--muted); font-size: 0.9375rem; }
footer nav a { margin-right: 1rem; }

.wordmark {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}

h1 { font-size: 2rem; line-height: 1.2; margin: 1.5rem 0 0.75rem; }
h2 { font-size: 1.25rem; margin: 2.25rem 0 0.5rem; }

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

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  background: var(--paper);
  padding: 0.5rem 0.75rem;
}

.draft {
  border: 1px dashed var(--rule);
  background: var(--note-bg);
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.note {
  background: var(--note-bg);
  border-left: 4px solid var(--accent);
  padding: 0.75rem 1rem;
}

.dark { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

pre, code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9375rem; }
pre {
  background: var(--note-bg);
  border: 1px solid var(--rule);
  padding: 0.75rem 1rem;
  overflow-x: auto;
  white-space: pre;
}

form { margin: 1.5rem 0 3rem; }

fieldset {
  border: 1px solid var(--rule);
  padding: 1rem 1.25rem 1.25rem;
  margin: 0 0 1.5rem;
}
legend { font-weight: 700; padding: 0 0.25rem; }

.field { margin: 0 0 1.25rem; }
.field:last-child { margin-bottom: 0; }

label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.check label { display: inline; font-weight: 400; }
.hint { display: block; color: var(--muted); font-size: 0.9375rem; margin: 0 0 0.375rem; }
.req { color: var(--error); }

input[type="email"], input[type="text"], input[type="password"], textarea, input[type="file"] {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--muted);
  border-radius: 4px;
  padding: 0.5rem 0.625rem;
}
textarea { min-height: 8rem; resize: vertical; }
textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9375rem; }

.check { display: flex; gap: 0.625rem; align-items: flex-start; margin: 0 0 0.75rem; }
.check input { margin-top: 0.35rem; width: 1.125rem; height: 1.125rem; flex: none; }

button {
  font: inherit;
  font-weight: 700;
  background: var(--accent);
  color: var(--paper);
  border: 0;
  border-radius: 4px;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
}

.cta {
  display: inline-block;
  font-weight: 700;
  background: var(--accent);
  color: var(--paper);
  border-radius: 4px;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
}

/* Server-rendered parts (#15): form errors, own submissions, staff queue. */
.errors {
  border: 2px solid var(--error);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
}
.errors h2 { color: var(--error); margin-top: 0; font-size: 1.125rem; }
.errors ul { margin-bottom: 0; }

.subs li { margin-bottom: 1rem; }
.subs form { margin: 0.5rem 0 0; }

main.wide { max-width: none; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 0.375rem 0.75rem 0.375rem 0; border-bottom: 1px solid var(--rule); }

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

.steps { padding-left: 1.25rem; }
.steps .state { font-size: 0.875rem; font-weight: 400; color: var(--muted); }
.steps .locked { color: var(--muted); }
