/* Belege-App — nüchternes, mobiles Grundlayout */

:root {
  --blau: #1d3557;
  --blau-hell: #2b4d7e;
  --grau-bg: #f1f3f5;
  --grau-rand: #d9dee3;
  --text: #212529;
  --text-grau: #6c757d;
  --gruen: #2b8a3e;
  --rot: #c92a2a;
  --gelb-bg: #fff9db;
  --gelb-rand: #f0c419;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--grau-bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.kopf {
  background: var(--blau);
  color: #fff;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 20px 14px;
}
.kopf h1 { margin: 0; font-size: 22px; font-weight: 700; }
.untertitel { margin: 4px 0 0; font-size: 13px; opacity: 0.8; }

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 14px calc(env(safe-area-inset-bottom, 0px) + 30px);
}

.karte {
  background: #fff;
  border: 1px solid var(--grau-rand);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}
.karte h2 { margin: 0 0 12px; font-size: 16px; }

.einstellungen summary {
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.einstellungen[open] summary { margin-bottom: 12px; }

.feld { margin-bottom: 12px; }
.feld:last-child { margin-bottom: 0; }
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text);
}
input[type="text"], input[type="date"], textarea {
  width: 100%;
  font-size: 16px; /* verhindert iOS-Zoom beim Fokussieren */
  padding: 11px 12px;
  border: 1px solid var(--grau-rand);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}
input:focus, textarea:focus { outline: 2px solid var(--blau-hell); border-color: var(--blau-hell); }
textarea { resize: vertical; }

.hinweis { font-size: 12.5px; color: var(--text-grau); margin: 8px 0 0; }

.fotoButton {
  display: block;
  text-align: center;
  background: var(--blau);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  padding: 14px;
  border-radius: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fotoVorschau { margin-top: 12px; text-align: center; }
.fotoVorschau img {
  max-width: 100%;
  max-height: 320px;
  border-radius: 8px;
  border: 1px solid var(--grau-rand);
}
.linkButton {
  background: none;
  border: none;
  color: var(--rot);
  font-size: 14px;
  margin-top: 8px;
  cursor: pointer;
  padding: 8px;
}
.blauLink { color: var(--blau); font-weight: 600; }
.kiBox { white-space: pre-line; }

.checkzeile {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 400;
  margin: 10px 0;
  cursor: pointer;
}
.checkzeile input { width: 20px; height: 20px; flex-shrink: 0; }

.personZeile {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.personZeile input { flex: 1; min-width: 0; }
.personZeile .entfernen {
  background: none;
  border: none;
  color: var(--rot);
  font-size: 22px;
  line-height: 1;
  padding: 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.zweitButton {
  width: 100%;
  background: #fff;
  border: 1.5px dashed var(--blau);
  color: var(--blau);
  font-size: 15px;
  font-weight: 600;
  padding: 11px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 4px;
}

.summenzeile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  border-top: 1px solid var(--grau-rand);
  margin-top: 14px;
  padding-top: 12px;
}
.summenzeile strong { font-size: 20px; }

.warnbox {
  background: var(--gelb-bg);
  border: 1px solid var(--gelb-rand);
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  margin-top: 12px;
}

.unterschriftFeld {
  display: block;
  width: 100%;
  height: 160px;
  background: #fff linear-gradient(to top, transparent 38px, var(--grau-rand) 38px, var(--grau-rand) 39px, transparent 39px);
  border: 1.5px dashed var(--grau-rand);
  border-radius: 8px;
  touch-action: none; /* verhindert Scrollen beim Unterschreiben */
  cursor: crosshair;
}
.unterschriftZeile {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.unterschriftZeile .hinweis { flex: 1; }
.unterschriftZeile .linkButton { margin-top: 4px; flex-shrink: 0; }

.aktion { margin: 18px 0 10px; }
.hauptButton {
  width: 100%;
  background: var(--gruen);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  padding: 16px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.hauptButton:active { opacity: 0.85; }

.status {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14.5px;
}
.status.ok { background: #ebfbee; border: 1px solid var(--gruen); color: var(--gruen); }
.status.fehler { background: #fff5f5; border: 1px solid var(--rot); color: var(--rot); }

.fussnote {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-grau);
  margin-top: 18px;
  line-height: 1.5;
}
