/* Ez Êzîdî me – ruhig, warm: Creme, Gold, Rot. Mobil zuerst. */
:root {
  --creme: #FAF5EA;
  --creme-tief: #F2E9D6;
  --karte: #FFFDF8;
  --gold: #C8962E;
  --gold-dunkel: #8C6418;
  --gold-hell: #F1E2BE;
  --rot: #A8322D;
  --rot-hell: #F6E1DD;
  --text: #3A2E22;
  --text-leise: #6E5F4E;
  --linie: #E3D6BC;
  --gruen: #3F6B3A;
  --radius: 14px;
  --schatten: 0 1px 2px rgba(80, 55, 20, .06), 0 4px 14px rgba(80, 55, 20, .07);
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--creme);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 17px;
  line-height: 1.5;
  min-height: 100vh;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }

/* Kopfzeile */
.kopf {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: rgba(250, 245, 234, .94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--linie);
}
.kopf-marke {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 0; padding: 4px; cursor: pointer;
  font-weight: 650; font-size: 18px; color: var(--gold-dunkel);
  min-height: 44px;
}
.kopf-sonne { width: 36px; height: 36px; flex: none; }
.kopf-sprache {
  border: 1px solid var(--linie); background: var(--karte);
  border-radius: 999px; padding: 6px 14px; min-height: 40px;
  font-size: 15px; cursor: pointer;
}
.prototyp-band {
  background: var(--rot); color: #fff; text-align: center;
  font-size: 13px; font-weight: 600; letter-spacing: .02em;
  padding: 4px 12px;
}

main {
  max-width: 560px; margin: 0 auto;
  padding: 16px 16px calc(32px + env(safe-area-inset-bottom));
  outline: none;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 8px; }
h1 { font-size: 28px; color: var(--gold-dunkel); }
h2 { font-size: 22px; }
h3 { font-size: 18px; color: var(--gold-dunkel); }
p { margin: 0 0 12px; }
.leise { color: var(--text-leise); font-size: 15px; }
.mitte { text-align: center; }

/* Karten */
.karte {
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 18px 16px;
  margin-bottom: 16px;
}

/* Sprachauswahl */
.sprachwahl-kopf { text-align: center; padding: 12px 0 8px; }
.sprachwahl-kopf img { width: 120px; height: 120px; }
.sprachwahl-hinweis { color: var(--text-leise); font-size: 14px; margin: 8px 0 18px; }
.sprachliste { display: grid; gap: 10px; }
.sprachknopf {
  display: flex; flex-direction: column; align-items: flex-start;
  width: 100%; text-align: start;
  background: var(--karte); border: 1px solid var(--linie);
  border-radius: var(--radius); padding: 14px 18px; min-height: 64px;
  cursor: pointer; box-shadow: var(--schatten);
}
.sprachknopf:hover, .sprachknopf:focus-visible { border-color: var(--gold); }
.sprachknopf[aria-current="true"] { border: 2px solid var(--gold); background: var(--gold-hell); }
.sprachknopf .sprachname { font-weight: 650; font-size: 19px; }
.sprachknopf .appname { color: var(--gold-dunkel); font-size: 15px; }

/* Startseite */
.start-sonne { display: block; width: 140px; height: 140px; margin: 8px auto 12px; }
.zaehler { text-align: center; }
.frage { font-size: 19px; font-weight: 650; color: var(--rot); margin: 8px 0 14px; }
.zaehler-zahl {
  font-size: 44px; font-weight: 700; color: var(--rot);
  line-height: 1.1; font-variant-numeric: tabular-nums;
}
.zaehler-text { color: var(--text-leise); }

/* Knöpfe */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 22px;
  border-radius: 12px; border: 1px solid transparent;
  font-weight: 650; font-size: 17px; cursor: pointer;
  text-decoration: none;
}
.knopf:disabled { opacity: .55; cursor: default; }
.knopf-haupt { background: var(--rot); color: #fff; }
.knopf-haupt:hover:not(:disabled) { background: #922A26; }
.knopf-gold { background: var(--gold); color: #fff; }
.knopf-neben { background: var(--karte); border-color: var(--linie); color: var(--text); }
.knopf-gefahr { background: var(--karte); border-color: var(--rot); color: var(--rot); }
.knopf-gefahr-voll { background: var(--rot); color: #fff; }
.knopf-klein { min-height: 40px; padding: 6px 14px; font-size: 15px; font-weight: 600; }
.knopf-breit { width: 100%; }
.knopf-text { background: none; border: 0; color: var(--gold-dunkel); text-decoration: underline; padding: 6px; min-height: 40px; cursor: pointer; font-weight: 600; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.knopfreihe { display: flex; gap: 10px; margin-top: 20px; }
.knopfreihe .knopf { flex: 1; }
.knopfstapel { display: grid; gap: 10px; margin-top: 16px; }

/* Schritte */
.schritt-anzeige { margin-bottom: 14px; }
.schritt-text { font-size: 14px; color: var(--text-leise); margin-bottom: 6px; }
.schritt-balken { display: flex; gap: 6px; }
.schritt-balken span { flex: 1; height: 6px; border-radius: 3px; background: var(--linie); }
.schritt-balken span.an { background: var(--gold); }

/* Formular */
.feld { margin-bottom: 16px; }
.feld label, .feld .label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 16px; }
.pflicht { color: var(--rot); margin-inline-start: 2px; }
.feld input[type="text"], .feld input[type="tel"], .feld input[type="email"],
.feld input[type="date"], .feld input[type="number"], .feld select {
  width: 100%; min-height: 50px;
  padding: 10px 12px; font-size: 17px;
  background: #fff; border: 1px solid #CDBB98; border-radius: 10px;
  appearance: none; -webkit-appearance: none;
}
.feld select {
  background-image: linear-gradient(45deg, transparent 50%, var(--gold-dunkel) 50%), linear-gradient(135deg, var(--gold-dunkel) 50%, transparent 50%);
  background-position: calc(100% - 20px) 22px, calc(100% - 14px) 22px;
  background-size: 6px 6px; background-repeat: no-repeat;
  padding-inline-end: 36px;
}
[dir="rtl"] .feld select { background-position: 14px 22px, 20px 22px; }
.feld input:focus, .feld select:focus { border-color: var(--gold); outline: 3px solid var(--gold-hell); }
.feld.fehler input, .feld.fehler select { border-color: var(--rot); background: #FFF8F7; }
.fehlertext { color: var(--rot); font-size: 14px; margin-top: 4px; font-weight: 600; }
.pflicht-legende { font-size: 14px; color: var(--text-leise); margin-bottom: 12px; }

/* Ja/Nein-Wahl */
.wahl { display: flex; gap: 10px; }
.wahl button {
  flex: 1; min-height: 50px; border-radius: 10px; cursor: pointer;
  border: 1px solid #CDBB98; background: #fff; font-weight: 600;
}
.wahl button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #fff; }

/* Unterbereiche */
.unterbox {
  border: 1px solid var(--linie); border-radius: 12px;
  padding: 14px; margin-bottom: 14px; background: var(--creme);
}
.unterbox-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.unterbox-kopf h3 { margin: 0; }
.zeile2 { display: grid; grid-template-columns: 1fr 120px; gap: 10px; }
.zeile2 .feld { margin-bottom: 0; }
.datum3 { display: grid; grid-template-columns: 0.8fr 1.4fr 1fr; gap: 8px; margin-bottom: 4px; }
.datum3 select { padding-inline-start: 10px; padding-inline-end: 28px !important; background-position: calc(100% - 16px) 22px, calc(100% - 10px) 22px !important; }
[dir="rtl"] .datum3 select { background-position: 10px 22px, 16px 22px !important; }

/* Einwilligung */
.punkte { padding-inline-start: 20px; margin: 0 0 14px; }
.punkte li { margin-bottom: 8px; }
.hinweis-kinder {
  border-inline-start: 4px solid var(--rot);
  background: var(--rot-hell);
  padding: 12px 14px; border-radius: 8px; margin-bottom: 16px;
  font-weight: 600;
}
.entwurf-hinweis { font-size: 13px; color: var(--text-leise); font-style: italic; }
.haken {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px; border-radius: 12px; border: 2px solid var(--linie);
  background: #fff; cursor: pointer;
}
.haken input { width: 26px; height: 26px; flex: none; margin: 2px 0 0; accent-color: var(--rot); }
.haken.fehler { border-color: var(--rot); }

/* Zusammenfassung / Profil */
.daten { margin: 0; }
.daten div { display: grid; grid-template-columns: 42% 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--creme-tief); }
.daten div:last-child { border-bottom: 0; }
.daten dt { color: var(--text-leise); font-size: 15px; }
.daten dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.abschnitt-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.id-box {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 14px; background: var(--gold-hell); border-radius: 8px;
  padding: 10px 12px; overflow-wrap: anywhere; direction: ltr; text-align: left;
  margin: 6px 0 8px;
}

/* Meldungen */
.meldung { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 600; }
.meldung-fehler { background: var(--rot-hell); color: var(--rot); }
.meldung-ok { background: #E5EFE1; color: var(--gruen); }
.erfolg-symbol { font-size: 56px; line-height: 1; color: var(--gruen); margin: 8px 0; }

/* Bestätigungsdialog */
.dialog-hintergrund {
  position: fixed; inset: 0; background: rgba(40, 28, 12, .45);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50;
  padding: 16px;
}
.dialog {
  background: var(--karte); border-radius: 18px; padding: 20px 18px;
  max-width: 520px; width: 100%; box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
@media (min-width: 600px) { .dialog-hintergrund { align-items: center; } }

.laden { display: inline-block; width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: dreh 0.8s linear infinite; }
@keyframes dreh { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .laden { animation: none; } }
