/* Antrag für eine Kennenlernphase — trockene Amtsformular-/Scan-Optik, als Funnel */
* { box-sizing: border-box; }

:root {
  --ink: #111;
  --line: #111;
  --fill: #f7dfe4;   /* sehr blasses rosa Eingabefeld */
  --fill-focus: #f2cdd5;
  --paper: #ffffff;
  --bg: #d9d9d9;
  --muted: #6a6a6a;
  --err: #8a1a1a;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Arial", "Helvetica Neue", Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.35;
  -webkit-text-size-adjust: 100%;
}

.sheet {
  background: var(--paper);
  max-width: 820px;
  margin: 24px auto;
  padding: 34px 46px 30px;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}

.doc-title {
  text-align: center;
  font-size: 30px;
  font-weight: 700;
  color: #4a4a4a;
  margin: 0 0 4px;
  letter-spacing: .5px;
}

.rule-heavy {
  border: none;
  border-top: 2px solid var(--ink);
  margin: 6px 0 14px;
}

/* Fortschritt */
.progress-wrap { margin: 0 0 18px; }
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 6px;
}
.progress-meta .step-name { font-weight: 700; color: var(--ink); text-transform: uppercase; letter-spacing: .3px; }
.progress-bar {
  height: 12px;
  border: 1.5px solid var(--ink);
  background: #fff;
  position: relative;
  overflow: hidden;
}
.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: var(--fill);
  border-right: 1.5px solid var(--ink);
  transition: width .2s ease;
}

/* Schritte */
.step { display: none; }
.step.active { display: block; }

.block { margin: 0 0 18px; }

.sec {
  font-size: 15px;
  font-weight: 700;
  text-decoration: underline;
  text-transform: uppercase;
  margin: 0 0 4px;
}
.sec-u { text-transform: none; }
.sec-note {
  font-weight: 400;
  text-transform: none;
  text-decoration: none;
  font-size: 13px;
  color: var(--muted);
}
.step-hint { font-size: 13px; color: var(--muted); margin: 0 0 12px; }

.req { color: var(--ink); font-weight: 700; }

/* Feld: Label + Eingabe */
.fld { margin: 0 0 10px; min-width: 0; }
.fld > label {
  display: block;
  font-size: 14px;
  margin: 0 0 3px;
}

input[type="text"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--fill);
  border: none;
  border-bottom: 1.5px solid var(--line);
  border-radius: 0;
  padding: 6px 8px;
  min-height: 34px;
}
select {
  background-image: none;
  padding-right: 8px;
}
textarea {
  min-height: 70px;
  resize: vertical;
  line-height: 1.4;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
  background: var(--fill-focus);
}
input.invalid,
select.invalid,
textarea.invalid {
  outline: 2px solid var(--err);
  outline-offset: -2px;
}

.unit-row { display: flex; align-items: center; gap: 8px; }
.unit-row input { flex: 1 1 auto; }
.unit { flex: 0 0 auto; font-size: 14px; color: var(--muted); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 22px; }

/* Checkbox-/Radio-Reihen */
.optgroup { margin: 2px 0 10px; }
.optgroup > .grp-label {
  display: block;
  font-size: 14px;
  margin: 0 0 4px;
}
.checkrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin: 4px 0;
}
.cb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}
.cb input { position: absolute; opacity: 0; width: 0; height: 0; }
.cb .box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--ink);
  flex: 0 0 auto;
  background: #fff;
  font-size: 13px;
  line-height: 1;
}
.cb input[type="radio"] + .box { border-radius: 50%; }
.cb input:checked + .box { background: var(--fill); }
.cb input:checked + .box::after { content: "✕"; }
.cb input[type="radio"]:checked + .box::after { content: "●"; font-size: 11px; }
.cb input:focus-visible + .box { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Ja/Nein + Freitext Reihe */
.yn-row { margin: 4px 0 10px; }
.yn-row .grp-label { display: block; font-size: 14px; margin: 0 0 4px; }
.yn-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.yn-inline .followup { flex: 1 1 220px; min-width: 160px; }
.yn-inline .followup input { min-height: 30px; }

/* Sonstiges: Ja/Nein Tabelle */
.qtable-wrap { margin-top: 4px; }
.qrow {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px 14px;
  padding: 7px 0;
  border-bottom: 1px solid #ccc;
}
.qrow:first-child { border-top: 1px solid #ccc; }
.qrow .q { font-size: 14px; }
.qrow .yn { display: inline-flex; gap: 14px; white-space: nowrap; }
.qrow .detail { grid-column: 1 / -1; }
.qrow .detail input { min-height: 30px; }

/* Navigation */
.nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 2px solid var(--ink);
}
.btn {
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 11px 18px;
  border: 1.5px solid var(--ink);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  border-radius: 0;
  min-height: 44px;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--fill); }
.btn.wide { flex: 1 1 auto; }
.btn[hidden] { display: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.err-msg {
  color: var(--err);
  font-size: 13px;
  margin: 8px 0 0;
  min-height: 1em;
}

/* Zusammenfassung */
.summary-box {
  border: 1.5px solid var(--ink);
  background: #fbfbfb;
  padding: 12px 14px;
  font-size: 14px;
  white-space: pre-wrap;
  line-height: 1.5;
  max-height: 46vh;
  overflow: auto;
}
.summary-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.share-hint { font-size: 13px; color: var(--muted); min-height: 1em; margin: 2px 0 0; }

.footer {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-top: 14px;
}

/* Mobile: keine horizontale Scrollleiste, sauber gestapelt */
@media (max-width: 640px) {
  body { font-size: 14px; }
  .sheet { margin: 0; padding: 18px 14px 22px; box-shadow: none; }
  .doc-title { font-size: 21px; }
  .grid2, .grid3 { grid-template-columns: 1fr; gap: 0; }
  .nav { flex-wrap: wrap; }
  .btn { flex: 1 1 44%; }
  .qrow { grid-template-columns: 1fr; }
  .qrow .yn { margin-top: 2px; }
}
