/*
 * CIVCNCT / Bürgerpilot static sites.
 * The CSP allows styles only from this file: no style attributes, no <style> elements.
 * Colour tokens: platform/docs/brand/05-identity.md §5 (all pairs WCAG 2.2 AA).
 * Fonts: system stack only. No web fonts, no third-party requests.
 */

:root {
  color-scheme: light dark;
  --ink: #0f172a;
  --muted: #475569;
  --teal: #0b6b63;
  --indigo: #4f46e5;
  --page: #f7f8fb;
  --surface: #ffffff;
  --surface2: #eef1f6;
  --line: #dde3ec;
  --line-strong: #748197;
  --teal-soft: #e0f1ee;
  --indigo-soft: #eef0ff;
  --on-teal: #ffffff;
  --warn: #8a5300;
  --warn-soft: #fbefd9;
  --shadow: rgb(15 23 42 / 0.12);
  --todo-bg: #fff3c4;
  --todo-ink: #5c3b00;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f1f5f9;
    --muted: #a3b0c2;
    --teal: #5ccfc1;
    --indigo: #a5b4fc;
    --page: #0b1020;
    --surface: #131b2e;
    --surface2: #182238;
    --line: #243049;
    --line-strong: #6b7a96;
    --teal-soft: #12302f;
    --indigo-soft: #1f2350;
    --on-teal: #04201d;
    --warn: #f2b54d;
    --warn-soft: #2f2412;
    --shadow: rgb(0 0 0 / 0.35);
    --todo-bg: #3d2f00;
    --todo-ink: #ffe08a;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
}

.wrap {
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 1rem;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

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

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
  hyphens: auto;
}

h1 {
  font-size: clamp(1.9rem, 7vw, 2.9rem);
  font-weight: 800;
  margin: 0.4rem 0 1rem;
}

h2 {
  font-size: 1.4rem;
  font-weight: 750;
  margin: 2.5rem 0 0.75rem;
}

h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

p,
ul,
dl {
  margin: 0 0 1rem;
}

/* Skip link: visible only on keyboard focus. */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--surface);
  color: var(--ink);
  padding: 0.5rem 1rem;
  border: 2px solid var(--indigo);
  border-radius: 8px;
}

/* Header and brand lockup */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
}

.brand .symbol {
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
}

.brand .wordmark {
  height: 1.9rem;
  width: auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand-by {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.header-nav a {
  font-weight: 600;
  font-size: 0.95rem;
}

/* SVG parts follow the colour scheme. Fill attributes in the markup are the fallback. */
.s-teal {
  fill: var(--teal);
}

.s-indigo {
  fill: var(--indigo);
}

.s-ink {
  fill: var(--ink);
}

/* Main content */
main {
  padding-bottom: 1rem;
}

.hero {
  padding: 2.25rem 0 0.5rem;
}

.badge {
  display: inline-block;
  margin: 0;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--indigo-soft);
  color: var(--indigo);
  font-size: 0.85rem;
  font-weight: 700;
}

.tagline {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.5em;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--teal);
}

.lead {
  font-size: 1.15rem;
}

.note {
  border-left: 4px solid var(--indigo);
  background: var(--surface2);
  padding: 0.75rem 1rem;
  border-radius: 0 8px 8px 0;
}

.note > p:last-child,
.callout > p:last-child {
  margin-bottom: 0;
}

/* Prominent link to the web app ("Bürgerpilot starten"). A link, not a button: the pages have no forms. */
.cta-row {
  margin: 0.25rem 0 1.25rem;
}

.cta {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  background: var(--teal);
  color: var(--on-teal);
  font-size: 1.1rem;
  font-weight: 750;
  text-decoration: none;
}

.cta:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* Web apps of the other country packs (civcnct.com). */
.packs {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.35rem 1.25rem;
}

.packs .host {
  color: var(--muted);
  font-size: 0.9rem;
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

.callout {
  background: var(--teal-soft);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.cards {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.cards > li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.cards > li p {
  margin: 0;
}

.checks {
  list-style: none;
  padding: 0;
}

.checks > li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.5rem;
}

.checks > li::before {
  content: "\2713";
  position: absolute;
  left: 0.2rem;
  top: 0;
  font-weight: 800;
  color: var(--teal);
}

.contact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.15rem 1.5rem;
}

.contact dt {
  font-weight: 650;
}

.contact dd {
  margin: 0 0 0.6rem;
  overflow-wrap: anywhere;
}

/* Country and language pickers */
.picker {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

/* The card is the direct link of the item; a link in a .hint line stays a plain link. */
.picker > li > a {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
}

.picker > li > a:hover {
  border-color: var(--indigo);
}

.picker .code {
  flex: none;
  min-width: 2.6rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: var(--indigo-soft);
  color: var(--indigo);
  font-family: var(--mono);
  font-weight: 700;
  text-align: center;
}

.picker .label {
  display: flex;
  flex-direction: column;
}

.picker .label strong {
  font-size: 1.1rem;
}

.picker .label span {
  color: var(--muted);
  font-size: 0.95rem;
}

.picker .hint {
  margin: 0.4rem 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* "So funktioniert es" / "How it works": numbered cards. The numbers come from a counter. */
.steps {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  counter-reset: step;
}

.steps > li {
  counter-increment: step;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.steps > li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.6rem;
  border-radius: 50%;
  background: var(--teal);
  color: var(--on-teal);
  font-weight: 800;
}

.steps > li p {
  margin: 0;
}

/*
 * Product preview: a static mock of the planned app, built from HTML and this file only.
 * Every frame shows the label "Beispiel". The mock holds no links, buttons or form controls,
 * so nothing in it looks clickable to the keyboard. tests/check_static.py checks both rules.
 */
.preview {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0 0 1rem;
}

.preview figcaption {
  color: var(--muted);
  font-size: 0.95rem;
}

.mock {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 1px 2px var(--shadow), 0 12px 28px -14px var(--shadow);
  font-size: 0.92rem;
  line-height: 1.45;
  overflow-wrap: break-word;
  cursor: default;
}

.mock p,
.mock ul,
.mock dl {
  margin: 0;
}

.mock .icon {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
}

.mock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  background: var(--surface2);
  border-bottom: 1px solid var(--line);
}

.mock-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.mock-brand .symbol {
  flex: none;
  width: 1.35rem;
  height: 1.35rem;
}

.mock-label {
  flex: none;
  padding: 0.05rem 0.55rem;
  border: 1px dashed var(--indigo);
  border-radius: 999px;
  background: var(--indigo-soft);
  color: var(--indigo);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mock-body {
  display: grid;
  gap: 0.85rem;
  padding: 1rem 0.95rem 1.1rem;
}

.mock-title {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.mock-field {
  position: relative;
  min-height: 4.6rem;
  padding: 0.7rem 3.1rem 0.7rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  color: var(--muted);
}

.mock-send {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--teal);
  color: var(--on-teal);
}

.mock-place {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.7rem 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 0.85rem;
  font-weight: 650;
}

.mock-place .icon {
  width: 0.95rem;
  height: 0.95rem;
}

.mock-kicker {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mock-kicker + p,
.mock-kicker + ul {
  margin-top: 0.3rem;
}

.mock-chips {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.mock-chips li {
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.mock-entry {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  background: var(--teal-soft);
}

.mock-entry strong,
.mock-sub {
  display: block;
}

.mock-sub {
  color: var(--muted);
  font-size: 0.85rem;
}

.mock-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: var(--teal);
  color: var(--on-teal);
}

.mock-trust {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.mock-trust .icon {
  color: var(--teal);
}

.mock-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.2rem 0.75rem;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  background: var(--surface2);
}

.mock-meta dt {
  color: var(--muted);
}

.mock-meta dd {
  margin: 0;
  font-weight: 650;
}

.mock-due {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: var(--warn-soft);
  color: var(--warn);
  font-weight: 700;
}

.mock-action {
  margin-left: auto;
  padding: 0.05rem 0.65rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.8rem;
}

.mock-todo {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.mock-todo li {
  position: relative;
  padding-left: 1.65rem;
}

.mock-todo li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15rem;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--line-strong);
  border-radius: 4px;
}

.mock-note {
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

/* FAQ: <details> per question, no script. The chevron is drawn from two borders (no text). */
.faq {
  display: grid;
  gap: 0.6rem;
  margin: 0 0 1rem;
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.faq summary {
  position: relative;
  padding: 0.85rem 3rem 0.85rem 1.15rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  position: absolute;
  right: 1.25rem;
  top: 1.15rem;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--indigo);
  border-bottom: 2px solid var(--indigo);
  transform: rotate(45deg);
}

.faq summary:hover {
  color: var(--indigo);
}

.faq details[open] > summary {
  border-bottom: 1px solid var(--line);
}

.faq details[open] > summary::after {
  top: 1.4rem;
  transform: rotate(-135deg);
}

.faq .answer {
  padding: 0.8rem 1.15rem 0.1rem;
}

/*
 * Privacy architecture ("So schützen wir Ihre Daten"): the path of a question, one step per
 * system. The numbers come from a counter; a line joins them. The label above each heading says
 * on whose systems the step runs (class where-<kind>; all pairs WCAG 2.2 AA in both schemes).
 */
.flow {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  counter-reset: flow;
}

.flow > li {
  counter-increment: flow;
  position: relative;
  padding: 0 0 1.25rem 3rem;
}

.flow > li::before {
  content: counter(flow);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--teal);
  color: var(--on-teal);
  font-weight: 800;
}

.flow > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(1rem - 1px);
  top: 2.4rem;
  bottom: 0.4rem;
  width: 2px;
  background: var(--line-strong);
}

.flow > li > p:last-child {
  margin-bottom: 0;
}

.flow .where {
  display: inline-block;
  margin: 0.2rem 0 0.4rem;
  padding: 0.1rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--teal-soft);
  color: var(--teal);
}

.flow .where-server {
  background: var(--indigo-soft);
  color: var(--indigo);
}

.flow .where-model {
  background: var(--warn-soft);
  color: var(--warn);
}

.flow .where-sources {
  background: var(--surface2);
  color: var(--muted);
}

/* Legal pages */
.legal h1 {
  font-size: clamp(1.75rem, 6.5vw, 2.4rem);
}

.legal h2 {
  font-size: 1.2rem;
  margin-top: 2rem;
}

.legal address {
  font-style: normal;
}

.meta {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Open items that block the launch. They stay visible until somebody resolves them. */
mark.todo {
  background: var(--todo-bg);
  color: var(--todo-ink);
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  font-weight: 600;
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer .wrap {
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
}

.site-footer p {
  margin: 0 0 0.75rem;
}

.site-footer nav ul {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
}

@media (min-width: 40rem) {
  .cards {
    grid-template-columns: 1fr 1fr;
  }

  .contact {
    grid-template-columns: max-content 1fr;
  }

  .contact dd {
    margin-bottom: 0.15rem;
  }

  .preview {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .preview figcaption {
    grid-column: 1 / -1;
  }
}

@media (min-width: 46rem) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}
