@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/nunito-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/nunito-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/fonts/nunito-latin-800-normal.woff2') format('woff2');
}

/* Farben aus dem Vereinslogo: Regenbogen auf Recyclingpapier */
:root {
  --paper: #efebe4;
  --paper-deep: #e6e0d6;
  --field: #fbfaf7;
  --ink: #2a2a2b;
  --ink-soft: #5e5c58;
  --line: #9ab5c9;
  --line-soft: #c9d6df;
  --blue: #8fb0c6;
  --blue-ink: #3f6886;
  --pink: #e4b4b6;
  --peach: #efcd9e;
  --lilac: #cbb6c8;
  --danger: #b3412f;
  --ok: #3d7a55;
  --radius: 14px;
  --font: 'Nunito', ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--paper);
  /* feine Papierfaser */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .3 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  overflow-x: hidden;
}

/* ---------- Ballons wie auf dem Papierformular ---------- */
.balloons { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.b {
  position: absolute;
  width: 110px;
  height: 132px;
  border-radius: 50% 50% 48% 48% / 55% 55% 45% 45%;
  opacity: 0.55;
  filter: blur(0.3px);
}
.b::after { /* Schnur */
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 160px;
  background: linear-gradient(#7d8b96, transparent);
  opacity: 0.5;
}
.b1 { background: radial-gradient(circle at 35% 30%, #fff8 0 8%, transparent 24%), var(--blue); left: -46px; top: 24px; }
.b2 { background: radial-gradient(circle at 35% 30%, #fff8 0 8%, transparent 24%), var(--lilac); left: 30px; top: 150px; width: 90px; height: 108px; }
.b3 { background: radial-gradient(circle at 35% 30%, #fff8 0 8%, transparent 24%), var(--peach); right: -40px; top: 210px; }
.b4 { background: radial-gradient(circle at 35% 30%, #fff8 0 8%, transparent 24%), var(--pink); right: 28px; top: 40px; width: 84px; height: 100px; }
.b5 { background: radial-gradient(circle at 35% 30%, #fff8 0 8%, transparent 24%), var(--blue); left: -30px; bottom: 60px; width: 96px; height: 114px; }

@media (max-width: 720px) {
  .b { width: 64px; height: 78px; opacity: 0.4; }
  .b2, .b3, .b5 { display: none; }
  .b1 { left: -24px; top: 12px; }
  .b4 { right: -18px; top: 70px; width: 58px; height: 70px; }
}

/* ---------- Layout ---------- */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
}

.masthead { text-align: center; padding: 8px 0 8px; }
.logo { width: 152px; height: auto; display: block; margin: 0 auto 8px; }
h1 { font-size: 2rem; font-weight: 800; margin: 0 0 6px; letter-spacing: -0.01em; }
.lead { font-size: 1.1rem; margin: 0 0 12px; }
.sub { color: var(--ink-soft); margin: 0 auto; max-width: 32em; font-size: 0.98rem; }

.block {
  margin-top: 28px;
  padding: 22px 18px 24px;
  background: rgba(255, 255, 255, 0.42);
  border: 1.5px solid var(--line-soft);
  border-radius: 20px;
}
h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0 0 16px;
}
.num {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 0.95rem;
  color: var(--ink);
}
.block:nth-of-type(1) .num { background: var(--blue); }
.block:nth-of-type(2) .num { background: var(--peach); }
.block:nth-of-type(3) .num { background: var(--pink); }
.block:nth-of-type(4) .num { background: var(--lilac); }

.row { display: grid; gap: 0 14px; }
.row.two { grid-template-columns: 1fr 1fr; }
.row.plz { grid-template-columns: 7.5em 1fr; }
@media (max-width: 460px) {
  .row.two { grid-template-columns: 1fr; }
}

/* ---------- Felder ---------- */
.field { margin-bottom: 14px; min-width: 0; }
label { display: block; font-weight: 700; font-size: 0.95rem; margin-bottom: 5px; }
.opt { font-weight: 400; color: var(--ink-soft); font-size: 0.85rem; margin-left: 4px; }

input:not([type='checkbox']):not([type='radio']) {
  width: 100%;
  min-height: 50px;
  padding: 11px 14px;
  font: inherit;
  font-size: 17px; /* verhindert Zoom auf iOS */
  color: var(--ink);
  background: var(--field);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
input[type='date'] { display: block; }
input:focus-visible { border-color: var(--blue-ink); box-shadow: 0 0 0 3px rgba(63, 104, 134, 0.18); }
input.readonly:not([type='checkbox']) { background: transparent; border-style: dashed; color: var(--ink-soft); }
input.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
input[aria-invalid='true'] { border-color: var(--danger); }
input::placeholder { color: #a7a39b; }

.hint { color: var(--ink-soft); font-size: 0.88rem; margin: 6px 0 0; }
.hint.center { text-align: center; margin-top: 12px; }
.ok-hint { color: var(--ok); font-size: 0.88rem; font-weight: 700; margin: 6px 0 0; }
.error { color: var(--danger); font-size: 0.88rem; font-weight: 700; margin: 6px 0 0; }
.error:empty { display: none; }

.check {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 12px;
  align-items: start;
  font-weight: 400;
  font-size: 0.97rem;
  margin: 16px 0 0;
  cursor: pointer;
}
.check input {
  width: 24px;
  height: 24px;
  margin: 1px 0 0;
  accent-color: var(--blue-ink);
  cursor: pointer;
}

.note { margin: 0 0 14px; }

/* ---------- Beitrag ---------- */
.amounts { border: 0; padding: 0; margin: 0 0 4px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; min-width: 0; }
@media (max-width: 460px) {
  .amounts { grid-template-columns: repeat(4, 1fr); }
  .chip:last-child { grid-column: 1 / -1; }
}
.chip { margin: 0; position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: block;
  padding: 11px 6px;
  text-align: center;
  font-weight: 800;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--field);
  transition: background 0.15s, border-color 0.15s;
}
.chip input:checked + span { background: var(--peach); border-color: #c99c5c; }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(63, 104, 134, 0.25); }
.euro { margin-top: 12px; max-width: 14em; }

.facts { margin: 18px 0 0; padding: 0 0 0 18px; color: var(--ink-soft); font-size: 0.92rem; }
.facts li { margin-bottom: 6px; }
.facts li::marker { color: var(--blue); }

/* ---------- Unterschrift ---------- */
.sign {
  position: relative;
  height: 190px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background: var(--field);
  touch-action: none;
  margin-bottom: 4px;
}
.sign.has-error { border-color: var(--danger); }
.sign canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: var(--radius); cursor: crosshair; touch-action: none; }
.sign::after { /* Unterschriftslinie */
  content: '';
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 44px;
  border-bottom: 1.5px solid var(--line-soft);
  pointer-events: none;
}
.sign-placeholder {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 52px;
  text-align: center;
  color: #a7a39b;
  pointer-events: none;
  transition: opacity 0.2s;
}
.sign.signed .sign-placeholder { opacity: 0; }
.sign-clear { position: absolute; right: 10px; top: 8px; }

.link-btn {
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--blue-ink);
  background: none;
  border: 0;
  padding: 6px 8px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn.inline { padding: 0; font-size: inherit; }

.privacy {
  margin-top: 14px;
  padding: 14px 16px;
  font-size: 0.88rem;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
}
.privacy h3 { margin: 0 0 6px; font-size: 1rem; color: var(--ink); }
.privacy p { margin: 0 0 8px; }
a { color: var(--blue-ink); }

/* ---------- Absenden ---------- */
.form-error {
  margin-top: 22px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: #f6e1dc;
  color: var(--danger);
  font-weight: 700;
}

.submit, .secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  margin-top: 24px;
  font: inherit;
  font-size: 1.12rem;
  font-weight: 800;
  color: #fff;
  background: var(--blue-ink);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 0 #2d4f68;
  transition: transform 0.08s, box-shadow 0.08s, background 0.15s;
}
.submit:active { transform: translateY(2px); box-shadow: 0 2px 0 #2d4f68; }
.submit:focus-visible, .secondary:focus-visible { outline: 3px solid var(--peach); outline-offset: 3px; }
.submit[disabled] { cursor: progress; background: #6c8aa0; }
.spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.submit[disabled] .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.secondary { color: var(--ink); background: var(--field); border: 1.5px solid var(--line); box-shadow: none; }

/* ---------- Erfolg ---------- */
.done { text-align: center; margin-top: 28px; padding: 32px 20px; background: rgba(255, 255, 255, 0.5); border-radius: 20px; outline: none; }
.done h2 { justify-content: center; font-size: 1.6rem; }
.done-badge {
  width: 76px;
  height: 76px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: conic-gradient(var(--lilac) 0 25%, var(--peach) 0 50%, var(--pink) 0 75%, var(--blue) 0);
}
.done-badge svg { background: var(--ok); border-radius: 50%; padding: 8px; width: 56px; height: 56px; }
.ref { color: var(--ink-soft); }

.foot { text-align: center; color: var(--ink-soft); font-size: 0.85rem; margin-top: 36px; }
.foot p { margin: 2px 0; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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