/* Nischen-Funnel — Prototyp. Mobile-first, eine Spalte, keine externen Schriften (schnell + DSGVO). */

:root {
  --ink: #14171D;
  --muted: #59606F;
  --faint: #878E9D;
  --surface: #FFFFFF;
  --tint: #F5F7FB;
  --rule: #DDE1E7;
  --accent: #2346A0;
  --accent-hover: #1C3A86;
  --accent-soft: #EAF0FC;
  --ok: #2C6650;
  --ok-soft: #E6F0EA;
  --warn: #8A6A12;
  --warn-soft: #F6EFD9;
  --err: #B3261E;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 23, 29, .06), 0 2px 8px rgba(20, 23, 29, .04);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
}
:focus-visible { outline: 3px solid #8FB0F5; outline-offset: 2px; }
h1:focus { outline: none; }
button { -webkit-tap-highlight-color: transparent; }

/* ---------- Rahmen ---------- */

.kopf, .app, .fuss { max-width: 480px; margin: 0 auto; }

.kopf {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px 8px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
}
.zurueck {
  width: 36px;
  height: 36px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.marke { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.marke img { width: 28px; height: 28px; }
.proto-btn {
  margin-left: auto;
  padding: 8px 11px;
  border: 1px dashed var(--warn);
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font: 600 12px/1 var(--font);
  cursor: pointer;
}

.app { padding: 16px 20px 32px; }
.enter { animation: rein .28s ease-out; }
@keyframes rein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.fuss { padding: 8px 20px 32px; font-size: 13px; color: var(--faint); text-align: center; }
.fuss a { color: var(--faint); }

.progress { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; height: 5px; background: #E4E8F0; }
.progress[hidden] { display: none; }
#progress-bar { display: block; width: 0; height: 100%; background: var(--accent); border-radius: 0 3px 3px 0; transition: width .35s ease; }

/* ---------- Typo ---------- */

.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 14px; font-weight: 700; letter-spacing: .01em; }
.display { margin: 0 0 12px; font-size: 34px; line-height: 1.08; font-weight: 800; letter-spacing: -.025em; text-wrap: balance; }
.lead { margin: 0 0 22px; color: var(--muted); text-wrap: pretty; }
.q-title { margin: 0 0 10px; font-size: 26px; line-height: 1.18; font-weight: 800; letter-spacing: -.02em; text-wrap: balance; }
.q-title.klein { margin-bottom: 14px; font-size: 20px; text-align: center; }
.hint { margin: 0 0 20px; color: var(--muted); }
.micro { margin: 12px 0 0; color: var(--faint); font-size: 13px; text-align: center; }
.micro.links { text-align: left; }
.proto-hinweis { margin: 18px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 13px; }

/* ---------- Start ---------- */

.frage-karte { padding: 18px 16px 14px; border: 1px solid var(--rule); border-radius: 20px; background: var(--tint); }

.kacheln { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kachel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow), inset 0 0 0 1.5px var(--rule);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.kachel:active { transform: scale(.98); }
.k-emoji { display: grid; place-items: center; height: 64px; font-size: 30px; }
.k-text { display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 10px 8px; background: var(--accent); color: #fff; font-weight: 700; font-size: 16px; line-height: 1.2; }
.kachel:hover .k-text, .kachel.an .k-text { background: var(--accent-hover); }
.kachel.an { box-shadow: 0 0 0 3px var(--accent-soft), inset 0 0 0 2px var(--accent); }

.block { margin-top: 32px; padding-top: 26px; border-top: 1px solid var(--rule); }
.block.ende { border-top: 0; padding-top: 0; }
.block p { margin: 0 0 8px; }
.b-title { margin: 0 0 14px; font-size: 21px; font-weight: 800; letter-spacing: -.015em; }

.schritte { display: grid; gap: 14px; margin: 0 0 8px; padding: 0; list-style: none; counter-reset: s; }
.schritte li { position: relative; padding-left: 42px; counter-increment: s; }
.schritte li::before {
  content: counter(s);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
}

.kosten { margin: 0; overflow: hidden; border: 1px solid var(--rule); border-radius: var(--radius); }
.kosten div { padding: 11px 14px; }
.kosten div + div { border-top: 1px solid var(--rule); }
.kosten dt { color: var(--muted); font-size: 14px; }
.kosten dd { margin: 0; font-weight: 700; }

.team { display: flex; flex-wrap: wrap; gap: 8px; }
.avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 14px; font-weight: 700; }
.team p { flex-basis: 100%; margin-top: 6px; }

.faq { border-bottom: 1px solid var(--rule); }
.faq summary { position: relative; padding: 14px 32px 14px 0; font-weight: 700; list-style: none; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; top: 11px; right: 4px; color: var(--accent); font-size: 22px; font-weight: 400; }
.faq[open] summary::after { content: "–"; }
.faq p { margin: 0 0 14px; color: var(--muted); }

/* ---------- Fragen ---------- */

.optionen { display: grid; gap: 10px; margin: 0 0 20px; }
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 14px 16px;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.option:hover { border-color: #B8C2D6; }
.option:active { transform: scale(.99); }
.option.an { border-color: var(--accent); background: var(--accent-soft); }
.o-emoji { width: 28px; font-size: 21px; text-align: center; }
.o-text { flex: 1; font-weight: 600; line-height: 1.3; }
.o-mark { flex: none; width: 22px; height: 22px; border: 1.5px solid #B9C0CC; background: var(--surface) center / 14px no-repeat; }
.o-mark.kreis { border-radius: 50%; }
.o-mark.box { border-radius: 6px; }
.option.an .o-mark {
  border-color: var(--accent);
  background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ---------- Buttons & Formulare ---------- */

.btn {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 14px 20px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  box-shadow: 0 6px 16px rgba(35, 70, 160, .22);
  color: #fff;
  font: 700 17px/1.2 var(--font);
  cursor: pointer;
}
.btn:hover { background: var(--accent-hover); }
.btn:disabled { background: #C5CCDA; box-shadow: none; cursor: not-allowed; }
.btn.sekundaer { margin-top: 12px; border: 1.5px solid var(--accent); background: var(--surface); box-shadow: none; color: var(--accent); }
form .btn { margin-top: 18px; }
a.btn { display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }
.karte a.btn { margin-top: 14px; }
.schritte a, .micro a { color: var(--accent); }

.feld { display: block; margin: 0 0 14px; }
.f-label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.f-label em { color: var(--faint); font-style: normal; font-weight: 400; }
.feld input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1.5px solid var(--rule);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: 17px var(--font); /* ab 16px zoomt iOS nicht hinein */
}
.feld input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.feld input[aria-invalid="true"] { border-color: var(--err); }
.f-fehler { display: block; margin-top: 4px; color: var(--err); font-size: 14px; }
.f-fehler:empty { display: none; }
.check { display: flex; align-items: flex-start; gap: 12px; margin: 6px 0 4px; color: var(--muted); font-size: 14px; }
.check input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); }
.check a { color: var(--accent); }

/* ---------- Prüfung & Ergebnis ---------- */

.pruefung { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; min-height: 55vh; text-align: center; font-size: 18px; }
.pruefung p { max-width: 300px; margin: 0; }
.spinner { width: 44px; height: 44px; border: 4px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: drehen .8s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }

.ergebnis { margin: 8px 0 24px; text-align: center; }
.ergebnis .hint { margin-bottom: 0; }
.e-icon { display: inline-grid; place-items: center; width: 60px; height: 60px; margin-bottom: 16px; border-radius: 50%; font-size: 28px; font-weight: 800; }
.frei .e-icon { background: var(--ok-soft); color: var(--ok); }
.pruefen .e-icon, .vergeben .e-icon { background: var(--warn-soft); color: var(--warn); }
.termin-zeile { margin: 0 0 6px; font-size: 18px; font-weight: 700; }

/* ---------- Termin ---------- */

.kalender { min-height: 560px; margin: 0 -12px; }
.kalender-laden { padding-top: 48px; color: var(--faint); text-align: center; }
.kalender:has(iframe) .kalender-laden { display: none; }

/* ---------- Danke ---------- */

.karte { margin-top: 22px; padding: 18px; border: 1px solid var(--rule); border-radius: 18px; background: var(--tint); }
.karte p { margin: 0 0 10px; }
.k-titel { font-weight: 800; }
.zusatz { margin-top: 16px; }
.z-titel { font-size: 15px; font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 14px; border: 1.5px solid var(--rule); border-radius: 999px; background: var(--surface); color: var(--ink); font: 600 14px var(--font); text-decoration: none; cursor: pointer; }
.chip.an { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* ---------- Prototyp-Panel (nur mit ?debug=1) ---------- */

.panel { width: min(560px, calc(100% - 24px)); max-height: 86vh; padding: 18px; border: 0; border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); color: var(--ink); }
.panel::backdrop { background: rgba(20, 23, 29, .45); }
.panel-kopf { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.schliessen { width: 34px; height: 34px; border: 1px solid var(--rule); border-radius: 50%; background: var(--surface); cursor: pointer; }
.p-titel { margin: 18px 0 8px; font-size: 14px; font-weight: 700; }
.panel pre { max-height: 260px; margin: 0; padding: 12px; overflow: auto; border-radius: 10px; background: #0E1116; color: #E5E9F0; font-size: 12px; }
.ereignisse { max-height: 200px; margin: 0; padding-left: 22px; overflow: auto; font-size: 13px; }
.ereignisse li { margin-bottom: 6px; }
.ereignisse span { color: var(--faint); }
.ereignisse small { display: block; color: var(--muted); word-break: break-all; }

/* ---------- Breiter & ruhiger ---------- */

@media (min-width: 520px) {
  .app { padding-top: 28px; }
  .display { font-size: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .enter { animation: none; }
  .spinner { animation-duration: 2.4s; }
  #progress-bar, .kachel, .option { transition: none; }
}
