/* Ruhige Lesefarben: warmes Creme statt Reinweiss, fast schwarze Schrift und
   ein einziges gedecktes Blaugrün als Akzent. Das Blaugrün bleibt auch bei
   Rot-Grün-Schwäche klar von Creme und Schwarz unterscheidbar. */
:root {
  --ground: #FBF5E6;
  --ink: #14110F;
  --ink-soft: #4A4335;
  --paper: #FFFFFF;
  --accent: #1F5F5B;
  --accent-soft: #DCE9E4;
  --red: #8A1C0E;
  --display: 'Bricolage Grotesque', 'Avenir Next', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

[hidden] { display: none !important; }

h1, h2, h3, p { margin: 0; }

.view {
  width: 100%;
  max-width: 460px;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* ---------- Bausteine ---------- */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.brand img { flex-shrink: 0; display: block; }

.accent { color: var(--accent); }

.btn {
  width: 100%;
  min-height: 58px;
  padding: 0 20px;
  border: 2px solid var(--ink);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 19px;
  cursor: pointer;
  transition: transform 0.08s ease;
}
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.btn.soft { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--ink); }
.btn.ghost {
  min-height: 52px;
  background: transparent;
  color: var(--ink);
  font-family: var(--body);
  font-weight: 700;
  font-size: 16px;
}
.btn.danger { color: var(--red); border-color: var(--red); }
.btn.small {
  width: 50%;
  min-height: 44px;
  align-self: center;
  padding: 0 12px;
  border-radius: 14px;
  font-size: 14px;
  gap: 6px;
}
.btn.danger-solid {
  min-height: 52px;
  background: var(--red);
  border-color: var(--red);
  color: var(--paper);
  font-family: var(--body);
  font-weight: 700;
  font-size: 16px;
}

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.msg {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: 15px;
  font-weight: 500;
}

/* ---------- 1 · The door ---------- */

.door-body {
  flex-grow: 1;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.masthead { display: flex; flex-direction: column; gap: 6px; }
.brand.big { gap: 12px; font-size: clamp(30px, 9vw, 38px); letter-spacing: -0.02em; line-height: 1; }
/* So bemessen, dass der Satz auch auf schmalen Telefonen in eine Zeile passt. */
.tagline {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(16px, 5.5vw, 23px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--accent);
}

.intro { display: flex; flex-direction: column; gap: 10px; }
.intro p { max-width: 400px; }
.intro .more { max-width: none; text-align: right; font-size: 14px; }

.card {
  padding: 20px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Umschalter: dasselbe Formular öffnet eine Seite oder legt eine neue an. */
.modes {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--accent-soft);
  border-radius: 14px;
}
.modes button {
  flex: 1 1 0;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-family: var(--body);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.modes button[aria-pressed="true"] { background: var(--accent); color: var(--paper); }

.mode-note { font-size: 15px; }

fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend, .pin-row > label {
  padding: 0;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 700;
}
.pin-row { display: flex; flex-direction: column; }

.dob { display: flex; gap: 8px; }
.dob .field { flex: 1 1 0; min-width: 0; }
.dob .field.year { flex-grow: 1.6; }

.after-note { text-align: center; font-size: 15px; color: var(--ink-soft); }

.legal-links { margin-top: auto; padding-top: 8px; display: flex; justify-content: center; gap: 8px; }
.legal-links a, .legal a, .intro a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.legal-links a { min-height: 44px; padding: 0 10px; display: flex; align-items: center; font-size: 15px; }

/* ---------- Impressum und Datenschutz ---------- */

.legal { padding: 28px 24px 40px; gap: 14px; }
.legal .brand { color: var(--ink); text-decoration: none; margin-bottom: 10px; }
.legal h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 34px;
  line-height: 1.02;
  letter-spacing: -0.03em;
}
.legal h2 {
  margin-top: 14px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.legal p, .legal li { font-size: 17px; }
.legal ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.legal address { font-style: normal; font-size: 17px; }
.legal .box { padding: 16px 18px; background: var(--accent-soft); border-radius: 18px; }

.field {
  width: 100%;
  height: 58px;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 500;
  font-size: 24px;
  text-align: center;
}
.field::placeholder { color: #6F6757; font-size: 18px; }
.field.pin { font-size: 30px; letter-spacing: 0.5em; padding-left: 0.5em; }
.field.pin.masked { -webkit-text-security: disc; }

.shake { animation: shake 0.3s; }
@keyframes shake {
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.page-hint { font-size: 14px; line-height: 1.4; color: var(--ink-soft); }

/* ---------- Anleitung (how-it-works.html) ---------- */

.steps { display: flex; flex-direction: column; gap: 12px; }
.slide { padding: 16px; background: var(--accent-soft); border-radius: 24px; }
/* Kopfzeile und Überschrift über die volle Breite, darunter Bild neben Text. */
.slide-body { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.slide-body > div { flex: 1; min-width: 0; }
.slide img { flex-shrink: 0; width: 100px; height: auto; }
.slide .step {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}
.slide h2 {
  margin: 2px 0 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 19px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.slide p { font-size: 15px; line-height: 1.45; }

/* Beispielzettel: so könnte die eigene Seite aussehen. */
.example {
  padding: 12px 14px;
  background: var(--paper);
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.slide .example { margin-top: 8px; padding: 8px 10px; border-radius: 10px; font-size: 13px; }
.example-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--accent-soft);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}
.example strong { color: var(--ink); }

/* ---------- 2 · Your page ---------- */

.page {
  height: 100dvh;
  padding: 28px 24px 16px;
  gap: 18px;
}

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.pill {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  background: var(--accent-soft);
  border-radius: 16px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pill.hurry { background: var(--ink); color: var(--paper); }

.paper {
  flex: 1 1 0;
  min-height: 200px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.paper label { padding: 16px 20px 0; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.paper textarea {
  flex-grow: 1;
  width: 100%;
  border: 0;
  resize: none;
  background: transparent;
  padding: 10px 20px 16px;
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink);
}
.paper textarea:focus { outline: none; }
.paper textarea::placeholder { color: #6F6757; }
.paper:focus-within { border-color: var(--accent); }

.paper-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-top: 2px solid var(--accent-soft);
  font-size: 14px;
  font-weight: 500;
}
.paper-foot svg { color: var(--accent); flex-shrink: 0; }
.paper-foot svg.off { visibility: hidden; }
#status { flex-grow: 1; }
.count { color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.actions { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Sicherheitsabfrage ---------- */

.confirm {
  width: calc(100% - 48px);
  max-width: 380px;
  padding: 24px 20px 20px;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 24px;
}
.confirm::backdrop { background: rgba(20, 17, 15, 0.6); }
.confirm h2 {
  margin-bottom: 8px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.confirm .msg { margin-top: 14px; }
.confirm-actions { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }

.noscript { padding: 24px; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .shake { animation: none; }
  .btn { transition: none; }
  /* Die Trickbilder bewegen sich von selbst; ohne sie bleibt der Text. */
  .slide img { display: none; }
}
