/* KI‑Oasen (Roboversum) — Bürgerbeteiligung „Wenn Städte träumen" */
:root {
  /* Roboversum/JFF-Grundfarben: weißer Grund, schwarze Schrift, Akzentgelb */
  --text: #080808;
  --accent: #080808;        /* Aktionsfarbe (Pill-Buttons, Links, aktive Zustände) */
  --accent-dark: #000000;
  --jff: #f3e600;           /* JFF-Akzentgelb — nur als Fläche, nie als Textfarbe auf Weiß */
  --bg: #ffffff;
  --card: #ffffff;
  --surface: #eceff1;       /* hellgraue Flächen (Formular-Karten) */
  --muted: #515b63;         /* Sekundärtext, Kontrast ≥ 6:1 auf Weiß und ≥ 5:1 auf Grau */
  --border: #cfd6db;
  /* Palette aus dem KI-Oasen-Cover */
  --blue: #2398c2;
  --green: #87c05a;
  --mint: #68a986;
  --sand: #f0e58f;
  --tint: #fbf7cf;          /* helles Gelb für ausgewählte Optionen */
  --radius: 20px;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font);
  font-size: 16px; line-height: 1.55;
  overflow-x: hidden;
}
img { max-width: 100%; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
#screen-danke .row { margin-top: 30px; }
a { color: var(--accent); text-underline-offset: 3px; }

/* Tastatur-Fokus gut sichtbar (Blau aus dem Cover, ≥ 3:1 auf Weiß) */
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---- Header: Wortzeichen links, Titel daneben (mobil darunter) ---- */
header { background: var(--card); }
/* Bunte Akzentleiste in den Cover-Farben */
header::after {
  content: ""; display: block; height: 5px;
  background: linear-gradient(90deg, var(--blue) 0 25%, var(--green) 25% 50%,
    var(--mint) 50% 75%, var(--jff) 75% 100%);
}
header .wrap {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px 16px; min-height: 72px; padding-top: 10px; padding-bottom: 10px;
}
.brand { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; color: var(--text);
  text-decoration: none; display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand img { height: 32px; width: auto; display: block; }
@media (max-width: 540px) {
  .brand { flex-direction: column; align-items: flex-start; gap: 4px; font-size: .95rem; }
  .brand img { height: 20px; }
}
nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); }
nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border: 2px solid var(--text); border-radius: 99px;
  color: var(--text); text-decoration: none; font-weight: 700; font-size: .95rem;
  transition: background .15s;
}
nav a:hover { background: var(--jff); }

main.wrap { padding: 28px 16px 64px; }
h1 { font-size: 2rem; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 18px; }
h2 { font-size: 1.5rem; line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 10px; }
h1, h2 { overflow-wrap: break-word; hyphens: auto; }
.screen > p { margin: 0 auto 8px; max-width: 620px; }

.hero { text-align: center; max-width: 700px; margin: 6vh auto 0; }
.hero p { margin: 0 auto 14px; }
.hero p { font-size: 1.08rem; }

/* ---- Startscreen KI-Oasen: Cover, Kicker, große Headline, linksbündig ---- */
.hero.hero-start { text-align: left; max-width: 860px; margin-top: 0; }
.hero-cover {
  display: block; width: 100%; height: auto; aspect-ratio: 1400 / 788; object-fit: cover;
  border-radius: var(--radius); margin: 0 0 22px; background: var(--surface);
}
.hero .kicker {
  display: inline-block; background: var(--jff); color: var(--text);
  font-weight: 700; font-size: .85rem; letter-spacing: .02em;
  padding: 5px 14px; border-radius: 99px; margin: 0 0 14px;
}
.hero-start h1 {
  font-size: clamp(2.4rem, 10vw, 4.6rem); line-height: 1.0; letter-spacing: -0.035em;
  margin: 0 0 22px;
}
.hero-start h2 { font-size: clamp(1.3rem, 4.6vw, 1.75rem); margin: 0 0 14px; }
.hero-start p { margin: 0 0 14px; max-width: 680px; }
.hero-start .consent { margin-left: 0; margin-right: 0; }
.hero-start .btn.big { margin: 20px 0 14px; }
@media (max-width: 540px) { .hero-start .btn.big { width: 100%; } }

/* DSGVO-Einwilligung auf dem Start-Screen: kleiner, linksbündiger Fließtext */
.consent { display: flex; gap: 10px; align-items: flex-start; text-align: left;
  max-width: 560px; margin: 16px auto 0; font-size: .85rem; color: var(--muted);
  background: var(--surface); padding: 12px 14px; border-radius: 14px; cursor: pointer; }
.consent input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--text); }
.consent a { color: var(--text); }

/* ---- Buttons als Pills: schwarz gefüllt (primary) bzw. Outline ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 22px; border-radius: 99px;
  border: 2px solid var(--text); background: var(--card); color: var(--text);
  font-family: inherit; font-size: 1rem; font-weight: 700; line-height: 1.2;
  cursor: pointer; transition: background .15s, color .15s, border-color .15s;
  text-align: center;
}
.btn:hover { background: var(--surface); }
.btn.primary { background: var(--text); border-color: var(--text); color: #fff; }
.btn.primary:hover { background: var(--jff); color: var(--text); }
.btn.big { min-height: 52px; padding: 14px 32px; font-size: 1.1rem; margin-top: 16px; }
#screen-foto .btn, #screen-idee .btn, #screen-ergebnis .btn { margin-top: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { background: var(--card); color: var(--text); }
.btn.primary:disabled:hover { background: var(--text); color: #fff; }

/* ---- Schritt-Anzeige ---- */
.stepper {
  display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 28px;
  counter-reset: step; flex-wrap: wrap;
}
.stepper li {
  counter-increment: step; font-size: .85rem; color: var(--muted);
  display: flex; align-items: center; gap: 7px;
}
.stepper li::before {
  content: counter(step); display: inline-flex; width: 28px; height: 28px; flex: none;
  border-radius: 50%; background: var(--surface); color: var(--muted);
  align-items: center; justify-content: center; font-weight: 700; font-size: .85rem;
}
.stepper li:not(:last-child)::after { content: "—"; margin-left: 8px; color: var(--border); }
.stepper li.active { color: var(--text); font-weight: 700; }
.stepper li.active::before { background: var(--text); color: #fff; }
.stepper li.done::before { content: "✓"; background: var(--green); color: var(--text); }
/* Mobil: vier gleich breite Spalten, Zahl über Beschriftung, ohne Trennstriche */
@media (max-width: 540px) {
  .stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .stepper.hidden { display: none !important; }
  .stepper li { flex-direction: column; gap: 4px; font-size: .72rem; text-align: center; line-height: 1.2; }
  .stepper li:not(:last-child)::after { content: none; }
}

/* ---- Karten & Formulare ---- */
.card {
  background: var(--surface); border: 0;
  border-radius: var(--radius); padding: 22px;
}
@media (max-width: 540px) { .card { padding: 18px 16px; } }
.form { display: flex; flex-direction: column; gap: 20px; max-width: 480px; margin-top: 26px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: .95rem; }
.form select, .form input, .form textarea {
  min-height: 48px; padding: 11px 14px; border: 2px solid var(--border); border-radius: 12px;
  font-size: 1rem; font-family: inherit; background: #fff; color: var(--text); width: 100%;
}
.form textarea { resize: vertical; }
.form select:focus, .form input:focus, .form textarea:focus {
  outline: 3px solid var(--blue); outline-offset: 0; border-color: var(--text);
}

/* Feld mit eigenem Label (z. B. Checkbox-Gruppe statt <select>) */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-weight: 700; font-size: .95rem; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.checks label {
  display: flex; flex-direction: row; align-items: center; gap: 12px; font-weight: 400; cursor: pointer;
  min-height: 48px; padding: 10px 14px; border: 2px solid var(--border); border-radius: 12px; background: #fff;
}
.checks label:has(input:checked) { border-color: var(--text); background: var(--tint); }
.checks input { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--text); flex: none; }

/* ---- Fotoauswahl ---- */
.photo-grid {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 16px; margin: 26px 0 30px;
}
.photo-grid img {
  width: 320px; max-width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius);
  cursor: pointer; border: 4px solid transparent; transition: transform .15s, border-color .15s; display: block;
}
.photo-grid img:hover { transform: scale(1.02); border-color: var(--jff); }
.photo-grid img.selected { border-color: var(--text); box-shadow: 0 0 0 4px var(--jff); }
@media (max-width: 540px) { .photo-grid img { width: 100%; } }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 28px; align-items: start; }
.split > * { min-width: 0; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; gap: 20px; } }
.preview { width: 100%; border-radius: var(--radius); display: block; }
.big-preview { box-shadow: 0 10px 30px rgba(8,8,8,.14); }
/* Varianten-Navigation (durch bisherige Entwürfe blättern) */
.variants { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; font-weight: 700; }
.variants.hidden { display: none; }
.vnav {
  border: 2px solid var(--text); background: var(--card); color: var(--text);
  border-radius: 50%; width: 44px; height: 44px; cursor: pointer; font-size: .9rem; line-height: 1;
  font-family: inherit;
}
.vnav:hover:not(:disabled) { background: var(--jff); }
.vnav:disabled { opacity: .35; cursor: not-allowed; }

/* Modus-Auswahl: aufbauen vs. neu vom Original */
.modus { display: flex; flex-direction: column; gap: 10px; }
.mopt {
  display: flex; flex-direction: row; gap: 12px; align-items: flex-start; padding: 12px 14px;
  border: 2px solid var(--border); border-radius: 14px; cursor: pointer; font-weight: 400; background: #fff;
}
.mopt:has(input:checked) { border-color: var(--text); background: var(--tint); }
.mopt input { width: 20px; height: 20px; min-height: 0; padding: 0; margin-top: 1px; flex: none; accent-color: var(--text); }

.compare { margin-top: 10px; text-align: center; }
.compare a { color: var(--text); display: inline-block; padding: 10px 6px; font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 2px solid var(--border); background: var(--bg); border-radius: 99px; color: var(--text);
  min-height: 40px; padding: 6px 14px; font-size: .85rem; cursor: pointer; font-family: inherit;
}
.chip:hover { border-color: var(--text); background: var(--tint); }

/* ---- Ideen-Galerie: klare Karten mit großen Bildern ---- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 18px; margin: 18px 0 24px; }
.gallery .item { background: var(--card); border: 2px solid var(--surface); border-radius: var(--radius); overflow: hidden; text-align: left; }
.gallery img { width: 100%; aspect-ratio: 3/2; object-fit: cover; display: block; }
.gallery .meta { padding: 12px 16px 14px; }
.gallery .meta p { margin: 0 0 6px; font-size: .92rem; }

/* ---- Footer ---- */
footer.wrap { padding: 28px 16px 36px; margin-top: 28px; text-align: center; border-top: 2px solid var(--surface); }
footer a { color: var(--muted); display: inline-block; padding: 6px 2px; }
.footer-mark { display: block; height: 76px; width: auto; margin: 0 auto 14px; }
.footer-credit { margin: 0 0 10px; color: var(--text); font-weight: 700; font-size: .92rem; }

/* ---- Lade-Overlay ---- */
.overlay {
  position: fixed; inset: 0; background: rgba(8,8,8,.6);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.loader-card {
  background: var(--card); border-radius: var(--radius); padding: 36px 40px;
  text-align: center; max-width: 340px; width: 100%;
}
.loader-card p { margin: 8px 0 0; font-weight: 700; }
/* Spinner in den Cover-Farben */
.spinner {
  width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 50%;
  border: 5px solid var(--surface);
  border-top-color: var(--blue); border-right-color: var(--green); border-bottom-color: var(--jff);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* Fehlermeldung */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #b3261e; color: #fff; padding: 12px 20px; border-radius: 14px;
  font-weight: 700; z-index: 60; max-width: calc(100vw - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.25);
}

/* Lightbox / Bild-Großansicht */
.gallery img, .big-preview { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; background: rgba(8,8,8,.9); z-index: 80;
  display: flex; align-items: center; justify-content: center; padding: 16px; cursor: zoom-out;
}
.lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 12px; box-shadow: 0 12px 48px rgba(0,0,0,.5); }

/* Desktop: Eingaben/Inhalte zentrieren (Bürger-Flow) */
@media (min-width: 761px) {
  main.wrap { padding: 44px 16px 72px; }
  #screen-fragen, #screen-foto, #screen-idee, #screen-ergebnis { text-align: center; }
  #screen-fragen .form,
  #screen-foto .form { margin-left: auto; margin-right: auto; text-align: left; }
  .stepper { justify-content: center; }
  .photo-grid { justify-content: center; }
  /* Idee + Ergebnis: Bild und Kasten gleich hoch, gleicher Start, breiter */
  .split { max-width: 1140px; margin-left: auto; margin-right: auto; text-align: left;
    grid-template-columns: 1.4fr 1fr; gap: 36px; align-items: stretch; }
  .split .form { max-width: none; }
  .split .preview { height: 100%; object-fit: cover; }
  .photo-grid img { width: 380px; }
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.75rem; }
}

/* Desktop: Eingaben/Inhalte mittig statt linksbündig */
@media (min-width: 761px) {
  .screen { text-align: center; }
  .screen .card, .screen .form { text-align: left; margin-left: auto; margin-right: auto; }
  /* Zwei-Spalten-Layouts (Idee/Ergebnis) zentriert, max. Breite begrenzt */
  .split { max-width: 860px; margin-left: auto; margin-right: auto; text-align: left; }
}
