:root {
  --bg: #eef2f7;
  --card: #ffffff;
  --text: #16202c;
  --muted: #5b6878;
  --line: #d4dbe5;
  --accent: #223d77; /* CI-Blau Baufinanz Düren */
  --accent-text: #ffffff;
  --brand: #223d77;
  --brand-dark: #16294f;
  --focus: #f0a63a;
  --error: #b42318;
  --success: #12805c;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141b;
    --card: #19212c;
    --text: #eef2f7;
    --muted: #9aa7b8;
    --line: #2d3949;
    --accent: #f0a63a;
    --accent-text: #1a1206;
    --error: #ff8a80;
    --success: #4cd4a0;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* Blaues Kopfband mit weißem Logo (Link zur Website) */
.band {
  background: linear-gradient(135deg, #2b4a8a, var(--brand) 55%, var(--brand-dark));
  padding: max(14px, env(safe-area-inset-top)) 16px 14px;
}
.band-link {
  display: block;
  width: fit-content;
  margin: 0 auto;
  border-radius: 8px;
}
.band-link img { display: block; height: 52px; width: auto; }
.band-link:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }

.shell {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px max(24px, env(safe-area-inset-bottom));
}

.shell > .card + .card { margin-top: 16px; }

.intro { padding: 8px 4px 20px; }

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 { margin: 0; font-size: 1.7rem; line-height: 1.2; }
h2 { margin: 0 0 8px; font-size: 1.25rem; }
.subtitle { margin: 8px 0 0; color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 6px 24px rgb(15 20 27 / 0.06);
}

.label { display: block; margin: 0 0 8px; font-weight: 600; }
.optional { color: var(--muted); font-weight: 400; }

textarea, input[type="text"] {
  width: 100%;
  padding: 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1.05rem; /* ≥16px verhindert Zoom auf iOS */
}

textarea { resize: vertical; min-height: 130px; }

textarea:focus, input:focus, button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
  border-color: transparent;
}

input:disabled { opacity: 0.45; }

.field-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0 18px; }
.counter { margin: 0 2px 0 auto; color: var(--muted); font-size: 0.85rem; text-align: right; }

/* KI-Spracheingabe */
.mic {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  min-height: 44px;
  padding: 0 16px;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  font-size: 0.95rem;
}
.mic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
/* Fragefeld leeren – bewusst unauffälliger als der Mikrofon-Knopf */
.clear-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}
.clear-text svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.clear-text:hover { color: var(--text); border-color: var(--muted); }
.mic.recording { border-color: var(--error); background: var(--error); color: #fff; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--error) 18%, transparent); } }
.voice-status, .voice-hint, .field-help { margin: -10px 2px 18px; color: var(--muted); font-size: 0.88rem; }
.voice-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.link-button {
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.field-help { margin-top: 6px; }
.counter.near { color: var(--error); }

button {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.primary { background: var(--accent); color: var(--accent-text); font-size: 1.1rem; }

/* Link, der wie ein Knopf aussieht */
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  border-radius: 14px;
  font-weight: 700;
  text-decoration: none;
}
.button:focus-visible, .action:focus-visible, .foot a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.cta h2 { margin-bottom: 6px; }
.button.cta-second { margin-top: 10px; border: 1.5px solid var(--accent); color: var(--accent); }
.back-link { display: inline-block; margin: 0 0 8px; color: var(--muted); font-size: 0.95rem; text-decoration: none; }
.back-link:hover, .back-link:focus-visible { color: var(--text); }
.cta p { margin: 0 0 16px; color: var(--muted); }

/* Ansprechpartner */
.team { margin-top: 8px; }
.section-title {
  margin: 0 4px 12px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.plz-help { margin: -4px 0 12px; color: var(--muted); font-size: 0.9rem; }
.plz-card input { font-size: 1.25rem; letter-spacing: 0.12em; }
.advisor:not(:empty) { margin-top: 16px; animation: pop 0.25s ease-out; }
.lang-card { margin-top: 16px; }
.lang-card h3 { margin-bottom: 12px; }
.lang-buttons { display: grid; gap: 10px; }
.lang-button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 60px;
  padding: 10px 16px;
  border: 1.5px solid var(--accent);
  border-radius: 14px;
  background: transparent;
  color: var(--accent);
  text-align: left;
}
.lang-button span { color: var(--muted); font-size: 0.9rem; font-weight: 500; }
.lang-button[aria-expanded="true"] { background: var(--accent); color: var(--accent-text); }
.lang-button[aria-expanded="true"] span { color: inherit; opacity: 0.85; }
.person-note { grid-column: 1 / -1; margin: -6px 0 0; color: var(--muted); font-size: 0.85rem; }
.person {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  column-gap: 14px;
  row-gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}
.avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.person-info { display: flex; flex-direction: column; min-width: 0; }
.person-info strong { font-size: 1.05rem; }
.person-info span { color: var(--muted); font-size: 0.9rem; }
.person-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 8px;
}
.action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 64px;
  padding: 8px 4px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.action:first-child { border-color: var(--accent); color: var(--accent); }
.action svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.primary:disabled { opacity: 0.6; cursor: progress; }
.secondary { background: transparent; color: var(--text); border: 1.5px solid var(--line); }

.error { margin: 14px 0 0; color: var(--error); font-weight: 600; }

.success { text-align: center; padding: 32px 20px; }
.success p { color: var(--muted); margin: 0 0 24px; }

.check {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  animation: pop 0.35s ease-out;
}

@keyframes pop {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}


.notice p { margin: 0; color: var(--muted); }

.foot { margin-top: 28px; color: var(--muted); font-size: 0.85rem; text-align: center; }
.foot p { margin: 0 0 8px; }
.consent { margin: 12px 2px 0; color: var(--muted); font-size: 0.82rem; line-height: 1.45; text-align: center; }
.consent a, .legal a { color: inherit; text-underline-offset: 3px; }
.legal {
  margin: 18px 0 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  line-height: 1.55;
  text-align: left;
}
/* Aufklappbar: Zeile „Datenschutzhinweis ▸“ */
.legal summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.legal summary::-webkit-details-marker { display: none; }
.legal summary::after { content: "▸"; transition: transform 0.2s; }
.legal[open] summary::after { transform: rotate(90deg); }
.legal summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.legal[open] summary { margin-bottom: 8px; }
.legal p { margin: 0 0 8px; }

/* An wen richtet sich die Frage? – Dropdown, damit die Seite auch bei vielen Speakern kurz bleibt */
.speaker-field { margin: 0 0 18px; }
.speaker-select {
  width: 100%;
  min-height: 52px;
  padding: 12px 44px 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6878' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 20px;
  color: inherit;
  font: inherit;
  font-size: 1.05rem; /* ≥16px verhindert Zoom auf iOS */
  font-weight: 600;
  appearance: none;
  cursor: pointer;
}
.speaker-select:invalid { color: var(--muted); font-weight: 400; }
.speaker-select option { background: var(--card); color: var(--text); font-weight: 400; }
.speaker-select:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: transparent; }
.speaker-field.invalid .speaker-select { border-color: var(--error); }
.foot a { color: inherit; text-underline-offset: 3px; border-radius: 4px; }

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