/* Unterschriftsseite: eine Schrift (Inter, selbst gehostet), vier Größen (30 · 17 · 15 · 13), Text schwarz oder grau,
   Rot nur für die eine Aktion je Bildschirm. Keine Inline-Stile (CSP style-src 'self'). */
@font-face { font-family: Inter; font-weight: 400; font-style: normal; font-display: swap; src: url("/assets/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: Inter; font-weight: 600; font-style: normal; font-display: swap; src: url("/assets/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: Inter; font-weight: 700; font-style: normal; font-display: swap; src: url("/assets/inter-latin-700-normal.woff2") format("woff2"); }

:root {
  --red: #B6203F; --burgund: #691324;
  --ink: #1D1B1C; --ink2: #625D5F; --ink3: #8F8A8C;
  --line: rgba(29,27,28,.12); --line2: rgba(29,27,28,.24);
  --page: #EDEDF0; --stage: #E1E0E5; --white: #fff;
  --ok: #2E8A57; --err: #8A1E1E;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--ink); font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px; line-height: 22px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
.shell { max-width: 680px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; background: var(--white); display: flex; flex-direction: column;
  box-shadow: 0 0 0 1px rgba(29,27,28,.08); }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 24px; padding-top: max(14px, env(safe-area-inset-top));
  border-bottom: 2px solid var(--burgund); }
.brand { color: var(--red); font-weight: 700; letter-spacing: .24em; font-size: 15px; line-height: 1; }
.brand small { display: block; font-size: 7px; font-weight: 600; letter-spacing: .2em; margin-top: 4px; }
.sub { font-size: 13px; line-height: 18px; color: var(--ink2); text-align: right; }
.app { flex: 1; padding: 24px 24px 16px; display: flex; flex-direction: column; outline: none; }
.foot { padding: 12px 24px; padding-bottom: max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-size: 13px; line-height: 18px; color: var(--ink2);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

h1 { font-size: 30px; line-height: 36px; font-weight: 700; margin: 0 0 8px; outline: none; overflow-wrap: break-word; hyphens: auto; }   /* lange Titel (Sicherheitsunterweisung) sprengen sonst 390 px */
h2 { font-size: 17px; line-height: 24px; font-weight: 600; margin: 0 0 6px; }
p { margin: 0 0 12px; }
.mute { color: var(--ink2); font-size: 13px; line-height: 18px; }
.lead { color: var(--ink); }
.section { border-bottom: 1.5px solid var(--ink); padding: 18px 0 6px; margin: 0; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink);
  display: flex; justify-content: space-between; gap: 12px; }
.ok { color: var(--ok); } .err { color: var(--err); }
.notice { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line2); border-radius: 8px; font-size: 15px; }
.notice.err { border-color: var(--err); }

/* Aktionen: unten, ganz rechts die eine rote */
.actions { margin-top: auto; padding-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.btn { display: block; width: 100%; min-height: 52px; padding: 12px 16px; border-radius: 8px; border: 1px solid var(--line2); background: var(--white);
  font-weight: 600; text-align: center; cursor: pointer; touch-action: manipulation; }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn:disabled { background: #E6E3E4; border-color: transparent; color: var(--ink3); cursor: default; }
.btn:focus-visible, .opt:focus-visible, .link:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.link { background: none; border: 0; padding: 4px 0; text-decoration: underline; color: var(--ink2); font-size: 13px; cursor: pointer; align-self: center; }
@media (min-width: 560px) { .actions { flex-direction: row-reverse; } .btn { width: auto; min-width: 180px; flex: 0 0 auto; } .actions .link { margin-right: auto; align-self: center; } }

/* Dokumentliste */
.pos { display: grid; grid-template-columns: 30px 1fr auto; gap: 0 12px; align-items: baseline; padding: 13px 0; border-bottom: 1px solid var(--line); }
.pos .nr { color: var(--ink2); font-size: 13px; font-variant-numeric: tabular-nums; }
.pos .t { font-weight: 600; }
.pos .z { font-size: 13px; color: var(--ink2); white-space: nowrap; }
.pos .z.now { color: var(--ink); font-weight: 600; }
.pos .z.done { color: var(--ok); }
.pos .z.no { color: var(--err); }

/* Seitenbilder */
.pages { display: flex; flex-direction: column; gap: 14px; margin: 14px 0; background: var(--stage); padding: 14px; border-radius: 8px; }
.sheet { position: relative; background: #fff; box-shadow: 0 6px 18px rgba(27,21,25,.22); min-height: 120px; }
.sheet img { display: block; width: 100%; height: auto; }
.sheet.pending { aspect-ratio: 210 / 297; display: flex; align-items: center; justify-content: center; }   /* a page-high placeholder: only a few sheets are near the visible area */
.sheet .wait { padding: 40px 12px; text-align: center; color: var(--ink2); font-size: 13px; }
.sheet .field { position: absolute; border: 2px solid var(--red); border-radius: 4px; pointer-events: none; }
.pageno { font-size: 13px; line-height: 18px; color: var(--ink2); text-align: center; margin-top: 6px; }

/* Fragen */
.opt { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; width: 100%; text-align: left; padding: 14px 4px; background: none;
  border: 0; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 15px; line-height: 22px; touch-action: manipulation; }
.opt i { display: block; width: 18px; height: 18px; border: 1.5px solid var(--ink); margin-top: 2px; font-style: normal; font-size: 13px; line-height: 15px; text-align: center; }
.opt.round i { border-radius: 50%; }
.opt[aria-checked="true"] i { background: var(--ink); color: #fff; }
.opt small { display: block; font-size: 13px; line-height: 18px; margin-top: 2px; }
.opt:disabled { cursor: default; }
.q { font-size: 17px; line-height: 24px; font-weight: 600; margin: 16px 0 6px; }
.field-input { width: 100%; padding: 12px; border: 1px solid var(--line2); border-radius: 8px; background: #fff; min-height: 52px; }
textarea.field-input { min-height: 96px; resize: vertical; }
.explain { margin: 16px 0 10px; }
.explain p { white-space: pre-line; }   /* der Korrekturtext steht zeilenweise: ein Umbruch je Option, dann der Merksatz */
.explain .section { padding-top: 0; }
/* Bilder der Fragen: Phone oben über der Frage (bis 320 px hoch), Tablet quer rechts neben Frage und Optionen; Antippen = Seitenbreite */
.qgrid { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.qtext { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.qpics { display: flex; flex-direction: column; gap: 12px; margin: 12px 0 4px; min-width: 0; }
.qpic { display: block; width: 100%; padding: 0; border: 1px solid var(--line2); border-radius: 8px; background: var(--page); cursor: zoom-in; touch-action: manipulation; overflow: hidden; }
.qpic[aria-expanded="true"] { cursor: zoom-out; }
.qpic:disabled { cursor: default; }
.qpic:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.qbox { display: flex; align-items: center; justify-content: center; width: 100%; max-height: 320px; }
.qimg { display: block; width: 100%; height: 100%; object-fit: contain; }
.qwait { padding: 12px; text-align: center; color: var(--ink2); font-size: 13px; line-height: 18px; }
.qgrid.zoom .qbox { max-height: none; }
@supports selector(:has(*)) {
  @media (min-width: 900px) and (orientation: landscape) {
    .shell:has(.qgrid.withpic) { max-width: 980px; }
    .qgrid.withpic { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px; align-items: start; }
    .qgrid.withpic:not(.zoom) .qpics { grid-column: 2; grid-row: 1; position: sticky; top: 12px; margin-top: 16px; }
    .qgrid.withpic:not(.zoom) .qtext { grid-column: 1; grid-row: 1; align-self: stretch; }
    .qgrid.withpic:not(.zoom) .qbox { max-height: 62vh; }
    .qgrid.withpic.zoom { grid-template-columns: minmax(0, 1fr); }
  }
}
.sum { border-top: 1.5px solid var(--ink); margin: 14px 0; }
.sum div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }

/* Kundenformular */
.kform { flex: 1; display: flex; flex-direction: column; }
.ff { border: 0; padding: 0; margin: 18px 0 0; min-width: 0; }
.lbl { display: block; padding: 0; margin: 0 0 6px; font-weight: 600; }
.req { font-weight: 400; color: var(--ink2); font-size: 13px; }
.hint { color: var(--ink2); font-size: 13px; line-height: 18px; margin: 0 0 6px; }
.choices { border-top: 1px solid var(--line); }
.choice { display: flex; gap: 12px; align-items: flex-start; min-height: 48px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; touch-action: manipulation; }
.choice input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); }
.ferr { color: var(--err); font-size: 13px; line-height: 18px; margin-top: 6px; }
.ferr:empty { display: none; }
.ff.bad .field-input { border-color: var(--err); }
.ff.bad .choices { border-top-color: var(--err); }
.field-input:focus-visible, .choice input:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

/* Unterschrift */
.padwrap { position: relative; border: 1px solid var(--line2); border-radius: 8px; background: #fff; margin: 10px 0 8px; }
.pad { display: block; width: 100%; aspect-ratio: 5 / 2; touch-action: none; cursor: crosshair; }
.padline { position: absolute; left: 18px; right: 18px; bottom: 36px; border-top: 1px solid var(--ink); pointer-events: none; }
.padhint { position: absolute; left: 18px; bottom: 12px; font-size: 13px; line-height: 18px; color: var(--ink2); pointer-events: none; }
.consent { font-weight: 600; margin: 14px 0 0; }

/* Ablehnen */
.reasons { margin: 8px 0 12px; }

.center { text-align: center; margin: auto 0; padding: 30px 0; }
.noscript { padding: 24px; }
