/* Personalfragebogen – dunkles Design mit roten Akzenten, mobile first */
:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-2: #1c1c1c;
  --ink: #f4f2ee;
  --muted: #9a9894;
  --line: #2a2a2a;
  --line-strong: #3a3a3a;
  --red: #e3262d;
  --red-hover: #ff3b42;
  --red-soft: rgba(227, 38, 45, .12);
  --red-ink: #ff6b70;
  --ok: #3ccf7f;
  --err: #ff6b70;
  --warn: #f2b84b;
  --radius: 14px;
  --nav-h: 80px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
body::before { /* dezenter roter Schein oben */
  content: ""; position: fixed; inset: -30vh -20vw auto; height: 60vh; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(227, 38, 45, .16), transparent 65%);
}
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--ink); }

/* ---------- Kopf ---------- */
.top { position: sticky; top: 0; z-index: 10; background: rgba(10, 10, 10, .82); backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 680px; margin: 0 auto; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 12px; min-height: 60px; }
.top-logo { height: 34px; width: auto; max-width: 120px; object-fit: contain; filter: invert(1); }
.top-title { font-weight: 700; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; }
.top-title::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-right: 10px; vertical-align: 1px; box-shadow: 0 0 12px var(--red); }
.top-typ { margin-left: auto; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--red-ink); background: var(--red-soft); border: 1px solid rgba(227, 38, 45, .35); border-radius: 99px; padding: 4px 11px; }
.progress { height: 3px; background: var(--line); }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, #b3121a, var(--red) 60%, var(--red-hover)); box-shadow: 0 0 10px rgba(227, 38, 45, .6); transition: width .35s ease; }

/* ---------- Inhalt ---------- */
main { position: relative; z-index: 1; flex: 1; width: 100%; max-width: 680px; margin: 0 auto; padding: 28px 16px calc(var(--nav-h) + 32px); }
h1 { font-size: 32px; line-height: 1.12; margin: 0 0 16px; letter-spacing: -.025em; font-weight: 800; }
h2 { font-size: 13px; margin: 36px 0 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
h2.h-question { font-size: 24px; letter-spacing: -.015em; text-transform: none; color: var(--ink); font-weight: 800; margin-top: 44px; }
.lead { font-size: 18px; margin: 0 0 20px; color: #d8d6d1; }
.lead strong { color: var(--ink); }
.step-count { margin: 0 0 8px; font-size: 12px; color: var(--red-ink); text-transform: uppercase; letter-spacing: .16em; font-weight: 700; }
.small-print, .hint { font-size: 14px; color: var(--muted); margin: 4px 0 8px; }
.center { text-align: center; }

.prep { list-style: none; padding: 0; margin: 0; counter-reset: p; display: grid; gap: 10px; }
.prep li { counter-increment: p; position: relative; padding: 16px 16px 16px 60px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.prep li::before { content: counter(p, decimal-leading-zero); position: absolute; left: 16px; top: 16px; font-weight: 800; font-size: 15px; color: var(--red); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.prep strong { display: block; font-weight: 650; }
.prep span { color: var(--muted); font-size: 15px; }

.note { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: 10px; padding: 13px 15px; font-size: 15px; margin: 16px 0; color: #d8d6d1; }
.note strong { color: var(--ink); }
.subhead { font-weight: 700; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--red-ink); margin: 22px 0 6px; padding-top: 18px; border-top: 1px solid var(--line); width: 100%; }

/* ---------- Auswahlkarten ---------- */
.typ-choice { display: grid; gap: 12px; }
.card-btn { text-align: left; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 20px 52px 20px 20px; cursor: pointer; display: grid; gap: 4px; position: relative; transition: border-color .2s, background .2s, transform .15s; }
.card-btn::after { content: ""; position: absolute; right: 20px; top: 50%; width: 10px; height: 10px; border-top: 2px solid var(--muted); border-right: 2px solid var(--muted); transform: translateY(-50%) rotate(45deg); transition: border-color .2s, right .2s; }
.card-btn strong { font-size: 20px; letter-spacing: -.01em; }
.card-btn span { color: var(--muted); font-size: 15px; }
.card-btn:hover, .card-btn[aria-pressed="true"] { border-color: var(--red); background: linear-gradient(180deg, var(--red-soft), transparent 80%), var(--surface); }
.card-btn:hover::after { border-color: var(--red); right: 16px; }
.card-btn:active { transform: scale(.99); }

.logo-grid { display: grid; gap: 12px; }
.logo-card { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 24px; height: 132px; display: grid; place-items: center; cursor: pointer; transition: border-color .2s, box-shadow .2s, background .2s, transform .15s; }
.logo-card img { max-width: 100%; max-height: 76px; object-fit: contain; filter: invert(1); opacity: .92; transition: opacity .2s; }
.logo-card:hover { border-color: var(--red); background: linear-gradient(180deg, var(--red-soft), transparent 80%), var(--surface); }
.logo-card:hover img { opacity: 1; }
.logo-card[aria-pressed="true"] { border-color: var(--red); box-shadow: 0 0 0 1px var(--red), 0 8px 30px rgba(227, 38, 45, .25); }
.logo-card:active { transform: scale(.99); }

/* ---------- Felder ---------- */
.fields { display: flex; flex-wrap: wrap; gap: 0 12px; }
.field { width: 100%; margin: 0 0 22px; border: 0; padding: 0; min-width: 0; }
.field.half { width: calc(50% - 6px); }
.field.small input { max-width: 160px; }
.field.half.small input { max-width: none; }
label, .label, legend { display: block; font-weight: 600; font-size: 15px; margin: 0 0 8px; padding: 0; color: #e6e4df; }
.req { color: var(--red); }
input[type=text], input[type=email], input[type=tel], input[type=date], select {
  width: 100%; height: 54px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface);
  font-size: 17px; /* ≥16px verhindert Zoom auf iOS */ appearance: none; -webkit-appearance: none; color: var(--ink);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input[type=date] { display: block; min-width: 0; line-height: 54px; }
input[type=date]::-webkit-date-and-time-value { text-align: left; }
input[type=date]::-webkit-calendar-picker-indicator { filter: invert(1) opacity(.6); }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%239a9894' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
select option { background: #1c1c1c; color: var(--ink); }
input:hover, select:hover { border-color: #4a4a4a; }
input:focus, select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(227, 38, 45, .25); background: var(--surface-2); }
.choice input:focus-visible + span, button:focus-visible, .sig:focus { outline: 2px solid var(--red); outline-offset: 2px; }
input::placeholder { color: #5f5d5a; }
.field.invalid input, .field.invalid select, .field.invalid .sig, .field.invalid .choice span { border-color: var(--err); }
.err { color: var(--err); font-size: 14px; margin: 7px 0 0; }
.err:empty { display: none; }
.warn { color: var(--warn); font-size: 14px; margin: 7px 0 0; }

.choices { display: grid; gap: 8px; }
.choices.inline { grid-template-columns: 1fr 1fr; }
.choice { position: relative; margin: 0; font-weight: 400; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span { display: block; padding: 14px 14px 14px 48px; border: 1px solid var(--line-strong); border-radius: 12px; min-height: 54px; position: relative; font-size: 16px; line-height: 1.4; background: var(--surface); transition: border-color .15s, background .15s; }
.choice:hover span { border-color: #4a4a4a; }
.choice span::before { content: ""; position: absolute; left: 15px; top: 15px; width: 20px; height: 20px; border: 2px solid #5a5856; border-radius: 50%; transition: all .15s; }
.choice input[type=checkbox] + span::before { border-radius: 6px; }
.choice input:checked + span { border-color: var(--red); background: linear-gradient(180deg, var(--red-soft), rgba(227, 38, 45, .04)), var(--surface); }
.choice input:checked + span::before { border-color: var(--red); background: var(--red); box-shadow: inset 0 0 0 4px var(--surface); }
.choice input[type=checkbox]:checked + span::before { box-shadow: none; background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='11'%3E%3Cpath d='M1 5.5l4 4L13 1' fill='none' stroke='white' stroke-width='2.5'/%3E%3C/svg%3E") center no-repeat; }
.consent span { font-size: 14px; color: var(--muted); }
.consent input:checked + span { color: #d8d6d1; }
.cb-title { font-weight: 600; margin: 0 0 8px; font-size: 15px; }

details.help { margin: 8px 0 0; font-size: 15px; }
details.help summary { cursor: pointer; color: var(--red-ink); font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; }
details.help summary::-webkit-details-marker { display: none; }
details.help summary::before { content: "?"; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
details.help[open] summary::before { content: "–"; }
details.help p { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; margin: 6px 0 0; color: #d8d6d1; }
details.help.big { margin: 20px 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
details.help.big summary { font-size: 15px; }
details.help.big p { background: none; border: 0; padding: 8px 0 0; }

/* Upload */
.upload { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.upload-info { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); padding: 12px 15px; border-radius: 12px; width: 100%; }
.upload-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.upload-name::before { content: "✓ "; color: var(--ok); font-weight: 700; }

/* Unterschrift – bewusst hell wie Papier */
.sig-wrap { position: relative; }
.sig { display: block; width: 100%; height: 190px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fbfaf7; touch-action: none; cursor: crosshair; }
.sig-line { position: absolute; left: 18px; right: 18px; bottom: 36px; border-top: 1px solid #cfccc5; font-size: 12px; color: #9a9894; padding-top: 5px; pointer-events: none; }
.sig-wrap.signed .sig-line { color: transparent; }
.sig-clear { position: absolute; top: 8px; right: 10px; color: #b3121a !important; }

/* Buttons */
.btn { height: 54px; padding: 0 24px; border-radius: 12px; border: 1px solid transparent; font-weight: 700; font-size: 17px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; letter-spacing: .01em; transition: background .15s, border-color .15s, transform .1s, box-shadow .15s; }
.btn:active { transform: scale(.98); }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 6px 24px rgba(227, 38, 45, .35); }
.btn-primary:hover { background: var(--red-hover); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: #555; }
.btn[disabled] { opacity: .6; cursor: progress; }
.link { background: none; border: 0; padding: 4px; color: var(--red-ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 14px; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: rgba(10, 10, 10, .88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.nav-inner { max-width: 680px; margin: 0 auto; padding: 12px 16px; display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.nav [data-back] { min-width: 100px; }

/* Übersicht / Fertig */
.missing-list { padding: 0; list-style: none; display: grid; gap: 8px; margin: 0 0 14px; }
.missing-list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 13px 15px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: 10px; font-size: 15px; }
.missing-list .link { white-space: nowrap; }
.review-ok .lead { color: var(--ok); }
.done-icon { width: 76px; height: 76px; border-radius: 50%; background: var(--red); color: #fff; font-size: 38px; font-weight: 700; display: grid; place-items: center; margin: 28px 0 20px; box-shadow: 0 0 0 10px var(--red-soft), 0 10px 40px rgba(227, 38, 45, .45); }

.foot { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; width: 100%; padding: 0 16px calc(var(--nav-h) + 24px); display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); }
.foot .link { color: var(--muted); margin-left: auto; padding: 0; font-size: 13px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Datenschutzseite */
main ul { padding-left: 20px; }
main li { margin: 0 0 6px; }

@media (min-width: 640px) {
  main { padding-top: 48px; }
  h1 { font-size: 40px; }
  .typ-choice, .logo-grid { grid-template-columns: 1fr 1fr; }
  .logo-grid .logo-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .nav-inner { grid-template-columns: auto auto; justify-content: space-between; }
  .nav [data-next] { min-width: 200px; }
}
@media (max-width: 380px) {
  .field.half { width: 100%; }
}
@media (max-width: 330px) {
  .choices.inline { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
