/* VICE VERSA · gegenvertrag.de
   Richtung „Zustellung“: Gelb des Umschlags der förmlichen Zustellung, sein Papier in Arimo, ihr Stempel in Rot. */

@font-face { font-family: Unbounded; src: url(/fonts/unbounded.woff2) format('woff2'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: Onest; src: url(/fonts/onest.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: Arimo; src: url(/fonts/arimo.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: Hand; src: url(/fonts/homemadeapple.woff2) format('woff2'); font-display: swap; }

:root {
  --gelb: #ffd60a; --gelb-hell: #ffe97a; --tinte: #111; --papier: #fff; --kopie: #e9e9e6;
  --rot: #d1001f; --rot-dunkel: #a80019;
  --display: Unbounded, sans-serif; --text: Onest, sans-serif; --seins: Arimo, Arial, sans-serif;
  --rand: 16px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--gelb); }
body {
  min-height: 100svh; display: flex; flex-direction: column; overflow-x: clip;
  padding: 0 max(var(--rand), env(safe-area-inset-right)) 0 max(var(--rand), env(safe-area-inset-left));
  background: var(--gelb); color: var(--tinte); font: 500 17px/1.5 var(--text);
}
button, input, textarea, a { font: inherit; color: inherit; }
img { display: block; max-width: 100%; height: auto; }
main { flex: 1; display: flex; flex-direction: column; width: 100%; max-width: 460px; margin: 0 auto; }
.ansicht { flex: 1; display: flex; flex-direction: column; }
h1, h2 { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: 26px; line-height: 1.12; margin-top: 8px; }
h1:focus { outline: none; }
.unter { margin-top: 10px; }
.klein, .meldung, .hinweis { font-size: 15px; line-height: 1.4; }
.meldung:empty, .fehler:empty { display: none; }
.meldung { margin-top: 10px; font-weight: 700; }
.hinweis { margin-top: 14px; padding: 12px 14px; background: var(--papier); }
.nur-vorleser { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nur-druck { display: none; }

/* Kopf */
.kopf { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%; max-width: 460px; margin: 0 auto; padding: 14px 0; }
.marke { text-decoration: none; font: 900 17px/1 var(--display); letter-spacing: -0.01em; }
.marke span { display: block; }
.marke .versa { transform: rotate(180deg); color: var(--rot-dunkel); }
.stand { font-size: 13px; font-weight: 600; text-align: right; }

/* Knöpfe: eckig, flach, eine Form */
.k {
  display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 18px;
  border: 0; border-radius: 0; cursor: pointer; text-decoration: none; text-align: center;
  font: 700 17px/1.1 var(--text); transition: transform .12s ease-out;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.k:active { transform: scale(.96); }
.k.ja { background: var(--tinte); color: var(--gelb); }
.k.nein { background: var(--papier); color: var(--tinte); }
.k.leise { background: transparent; text-decoration: underline; text-underline-offset: 4px; min-height: 48px; font-size: 15px; }
.k.zurueck { background: transparent; width: 56px; padding: 0; }
:focus-visible { outline: 3px solid var(--tinte); outline-offset: 3px; }
input:focus-visible, textarea:focus-visible { outline-offset: 0; }
.haupt { margin-top: 18px; width: 100%; }

/* 1 · Sein Vertrag als Kopie */
.seinblatt { margin-top: 18px; padding: 22px 20px 18px; background: var(--kopie); font: 400 15px/1.4 var(--seins); transform: rotate(-.8deg); }
.seinblatt h2 { font: 400 20px/1.2 var(--seins); letter-spacing: 0; text-align: center; text-decoration: underline; }
.seinblatt ol { list-style: none; counter-reset: r; padding: 0; margin-top: 12px; display: grid; gap: 8px; }
.seinblatt li { counter-increment: r; padding-left: 26px; position: relative; }
.seinblatt li::before { content: counter(r) ')'; position: absolute; left: 0; }
.sb-unter { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 18px; font-size: 13px; }
.sb-unter p { display: grid; }
.sb-unter .kreuz { width: 46px; height: 30px; color: var(--rot); margin: 4px 0 -8px 4px; }
.sb-unter .sig { font: 400 20px/30px Hand, cursive; height: 26px; padding-left: 8px; }
.linie { border-top: 2px solid var(--tinte); padding-top: 3px; }
.klebt { position: sticky; bottom: 0; margin-top: auto; padding: 16px 0 max(16px, env(safe-area-inset-bottom)); background: var(--gelb); display: grid; }

/* 2 · Deck */
/* Die fliegende Karte darf die Seite nicht verbreitern: am Schirmrand abschneiden. */
#deck { overflow-x: clip; margin: 0 calc(-1 * var(--rand)); padding: 0 var(--rand); }
.stapel { position: relative; flex: 1; display: flex; margin-top: 16px; min-height: 340px; }
.karte.hinten { position: absolute; inset: 0; background: var(--gelb-hell); transform: rotate(1.8deg) translate(2px, 8px); }
.karte.vorn {
  position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0 20px 20px;
  background: var(--papier); touch-action: pan-y; user-select: none; -webkit-user-select: none; will-change: transform;
}
.karte.vorn.fliegt { transition: transform .2s cubic-bezier(.3, 0, .6, 1); }
.karte.vorn.zurueck { transition: transform .18s ease-out; }
#k-normal, #k-frei { flex: 1; display: flex; flex-direction: column; }
.fetzen {
  margin: 0 -20px; padding: 18px 20px 30px; background: var(--kopie); transform: rotate(-1.1deg) translateY(-6px);
  clip-path: polygon(0 0, 100% 0, 100% 86%, 94% 93%, 87% 85%, 79% 95%, 70% 86%, 61% 94%, 52% 84%, 43% 95%, 33% 86%, 24% 94%, 15% 85%, 7% 93%, 0 86%);
}
.seins { font: 400 15px/1.4 var(--seins); }
.seins .nr { font-weight: 700; }
.seins s { text-decoration-color: var(--rot); text-decoration-thickness: 3px; }
.nein-hand { font: 400 20px/1 Hand, cursive; color: var(--rot); text-align: right; transform: rotate(-5deg); margin-top: 14px; }
.karte h2 { font-size: 26px; line-height: 1.12; margin-top: auto; padding-top: 8px; hyphens: manual; overflow-wrap: break-word; }
.meins { font-size: 22px; line-height: 1.36; margin-top: 12px; margin-bottom: auto; } /* auf hohen Schirmen sitzt der Text mittig statt über einer Lücke */
#k-frei h2 { margin-top: 28px; }
#k-frei textarea {
  margin-top: 14px; width: 100%; padding: 12px; border: 2px solid var(--tinte); border-radius: 0; background: var(--papier);
  font-size: 20px; line-height: 1.35; resize: none; user-select: text; -webkit-user-select: text;
}
#k-frei .klein { margin-top: 6px; }
.wisch { display: flex; justify-content: space-between; margin-top: auto; padding-top: 16px; font-size: 15px; font-weight: 700; }
.wahl { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; padding: 20px 0 max(16px, env(safe-area-inset-bottom)); }

/* 3 · Unterschrift */
#form-u { display: flex; flex-direction: column; flex: 1; margin-top: 18px; }
#form-u label { font-weight: 700; margin-top: 14px; }
#form-u input {
  margin-top: 6px; min-height: 56px; padding: 0 14px; width: 100%;
  border: 2px solid var(--tinte); border-radius: 0; background: var(--papier); font-size: 20px;
}
.fehler { margin-top: 6px; font-size: 15px; font-weight: 700; color: var(--rot-dunkel); }
.sig-vorschau { font: 400 30px/1.5 Hand, cursive; min-height: 52px; margin-top: 8px; padding-left: 10px; border-bottom: 2px solid var(--tinte); overflow: hidden; white-space: nowrap; }
.stempel-knopf {
  margin: auto 0 0; padding: 26px 0 max(16px, env(safe-area-inset-bottom)); border: 0; background: none; cursor: pointer;
  display: grid; justify-items: center; gap: 22px; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.stempel-knopf .k { width: 100%; }
.stempel {
  display: grid; padding: 10px 16px; text-align: center; color: var(--rot); background: var(--papier);
  border: 5px solid var(--rot); outline: 2px solid var(--rot); outline-offset: 4px;
  font: 700 clamp(15px, 5vw, 20px)/1.12 var(--seins); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap;
  transform: rotate(-7deg); transition: transform .14s ease-out;
}
.stempel-knopf:active .stempel { transform: rotate(-7deg) scale(1.12); }
.stempel-knopf.knall .stempel { animation: knall .42s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes knall {
  0% { transform: rotate(-12deg) scale(1.9); opacity: .2; }
  45% { transform: rotate(-6deg) scale(.92); opacity: 1; }
  100% { transform: rotate(-7deg) scale(1); }
}

/* 4 · Ergebnis */
/* Am Schirm nur das Blatt zeigen; gespeichert wird das ganze Story-Bild mit den gelben Randzonen. */
.bild-rahmen { margin-top: 20px; aspect-ratio: 960 / 1358; overflow: hidden; background: var(--papier); }
.bild { width: 112.5%; max-width: none; margin: -26.04% 0 0 -6.25%; -webkit-touch-callout: default; }
.aktionen { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.aktionen .k { font-size: 15px; padding: 0 10px; }

/* Duldungsgebühr: Auswahl als Chips (echte Radio-Knöpfe, nur anders angezogen) */
.gebuehr { border: 0; padding: 0; margin-top: 18px; min-width: 0; }
.gebuehr legend { font-weight: 700; padding: 0; }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.chips label { position: relative; display: flex; align-items: center; min-height: 48px; padding: 8px 12px; background: var(--gelb-hell); font-size: 15px; line-height: 1.2; cursor: pointer; }
.chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chips label:has(:checked) { background: var(--tinte); color: var(--gelb); }
.chips label:has(:focus-visible) { outline: 3px solid var(--tinte); outline-offset: 3px; }

/* 5 · Zustellung */
#zurueckschicken { position: sticky; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 1; }
.faellig { margin-top: 18px; padding: 16px; background: var(--papier); display: grid; gap: 6px; }
.faellig-titel { font: 800 22px/1.15 var(--display); margin-bottom: 8px; }
.anzeige { margin-left: 10px; padding: 2px 6px; border: 1.5px solid currentColor; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.kacheln { margin-top: 28px; }
.kacheln h2 { font-size: 20px; }
.kacheln ul { list-style: none; padding: 0; margin-top: 10px; display: grid; gap: 8px; }
.kacheln a { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 8px 14px; background: var(--papier); text-decoration: none; font-weight: 700; }

/* Fuß */
.fuss { width: 100%; max-width: 460px; margin: 28px auto 0; padding: 14px 0 max(18px, env(safe-area-inset-bottom)); font-size: 13px; line-height: 1.5; }
.fuss a { margin-right: 14px; text-underline-offset: 3px; }
.fuss p + p { margin-top: 6px; }
body:not([data-ansicht=start]):not([data-ansicht=ergebnis]):not([data-ansicht=zustellung]) .fuss { display: none; }

@media (prefers-reduced-motion: reduce) {
  .k, .stempel, .karte.vorn.fliegt, .karte.vorn.zurueck { transition: none; }
  .stempel-knopf.knall .stempel { animation: none; }
}

@media print {
  @page { size: A4; margin: 0; }
  html, body { background: #fff; padding: 0; display: block; min-height: 0; }
  body > :not(#druckbild) { display: none !important; }
  #druckbild { display: block; width: 100%; }
}

/* Textseiten (Datenschutz) */
.text h1 { margin-bottom: 14px; }
.text h2 { font-size: 18px; margin-top: 24px; }
.text p { margin-top: 8px; }
.text a { text-underline-offset: 3px; }
