/*
 * The site-unlock form (#21, project/site_gate.py). A stylesheet of its own
 * because the page's CSP allows no inline style. Colours are the SPA's
 * (frontend_app/src/styles/tokens.css); every text pair clears 4.5:1 and
 * every control border 3:1 (WCAG 2.2 AA). Caddy serves /static/site_gate/*
 * without the gate cookie, so the form is styled before unlock.
 */
:root {
  --brand: #1f4e79;
  --cta: #0b3a66;
  --cta-hover: #072849;
  --on-cta: #ffffff;
  --focus: #0b3a66;
  --ink: #1a2430;
  --ink-soft: #3d4a57;
  --surface: #ffffff;
  --canvas: #f3f5f7;
  --border: #d5dbe1;
  --border-control: #6b7782;
  --urgent-deep: #8c1d18;
  --urgent-tint: #fbe5e3;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
}

.banner {
  padding: 0.75rem 1rem;
  background: var(--brand);
  color: var(--on-cta);
}

.site-name {
  margin: 0 auto;
  max-width: 24rem;
  font-weight: 700;
}

main {
  flex: 1;
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
  padding: 2rem 1rem;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  line-height: 1.25;
  color: var(--brand);
}

.intro {
  margin: 0 0 1.5rem;
  color: var(--ink-soft);
}

.error {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--urgent-deep);
  border-radius: 4px;
  background: var(--urgent-tint);
  color: var(--urgent-deep);
  font-weight: 600;
}

form {
  display: flex;
  flex-direction: column;
}

label {
  margin: 0 0 0.25rem;
  font-weight: 600;
}

input {
  min-height: 44px;
  margin: 0 0 1rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-control);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

input[aria-invalid='true'] {
  border: 2px solid var(--urgent-deep);
}

button {
  min-height: 44px;
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: 8px;
  background: var(--cta);
  color: var(--on-cta);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  background: var(--cta-hover);
}

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

footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1rem;
  color: var(--ink-soft);
}

footer > * {
  max-width: 24rem;
  margin: 0 auto;
}

footer p {
  margin-bottom: 0.5rem;
}

.languages {
  display: flex;
  gap: 1rem;
  padding: 0;
  list-style: none;
}

.languages a,
.languages span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
}

.languages a {
  color: var(--cta);
}

.languages span[aria-current] {
  font-weight: 700;
  color: var(--ink);
}
