/* Lasi Prototyp — Styles nach 2SHIFT CI.
   Palette: 2SHIFT Blue #0C15C3 (dominant), Deep Navy #060C75, Indigo #4950DA,
   Akzente Amber #FFBC00 / Violet #7D40D8, Neutrals Weiß/#E8E8E8/Schwarz.
   Typo: Aptos (Fallback: neutrale Grotesk), Titel in CAPS.
   H3-Anforderung bleibt: große Touchziele, hoher Kontrast, Handschuh-Bedienung. */

:root {
  --blue: #0C15C3;
  --navy: #060C75;
  --indigo: #4950DA;
  --violet: #7D40D8;
  --plum: #300473;
  --amber: #FFBC00;
  --bg: #ffffff;
  --card: #ffffff;
  --ink: #000000;
  --muted: #5a5f6e;
  --border: #e8e8e8;
  --danger: #c0392b;
  --radius: 14px;
  /* Signatur-Gradient: Deep Navy → 2SHIFT Blue → Indigo */
  --hero: radial-gradient(120% 160% at 85% -20%, var(--indigo) 0%, var(--blue) 45%, var(--navy) 100%);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Aptos", "Inter", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.45;
}

header.appbar {
  background: var(--hero);
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}
header.appbar h1 {
  font-family: "Aptos Display", "Aptos", "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 20px;
  margin: 0;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
header.appbar .sub { font-size: 14px; opacity: 0.8; }
header.appbar .brand { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
header.appbar img.logo { height: 22px; display: block; }

main { max-width: 760px; margin: 0 auto; padding: 16px; }

/* Ruhiger Footer auf weißen Inhaltsflächen (CI: Logo unten, gedeckt) */
footer.brandfoot { max-width: 760px; margin: 24px auto 16px; padding: 0 16px; }
footer.brandfoot img { height: 18px; opacity: 0.9; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

.card.tappable { cursor: pointer; transition: transform 0.05s; }
.card.tappable:active { transform: scale(0.99); }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--muted); font-size: 15px; }
.big { font-size: 22px; font-weight: 700; }

/* Buttons: min. 56px Höhe (Handschuh-tauglich), Primär = 2SHIFT Blue */
button, .btn {
  display: block;
  width: 100%;
  min-height: 56px;
  border: none;
  border-radius: var(--radius);
  font-size: 19px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  padding: 14px 18px;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: var(--blue);
}
button:disabled { background: #b8bcd6; cursor: not-allowed; }
button.secondary, .btn.secondary { background: #eef0fb; color: var(--navy); }
button.ok { background: var(--navy); }
button.ghost { background: transparent; color: var(--muted); font-weight: 500; min-height: 44px; }

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.badge.ok { background: #e8eafd; color: var(--blue); }
.badge.open { background: #fff4d1; color: #8a6400; }
.badge.skip { background: #fdecea; color: var(--danger); }

/* Sync-Status-Chip (PRD: sichtbarer Sync-Status) — Amber als Akzent für „ausstehend" */
#syncStatus {
  font-size: 14px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
#syncStatus.pending { color: var(--amber); }
#syncStatus.offline { color: #ff9c9c; }

/* Sprach-Umschalter DE/EN im Header */
.langswitch {
  width: auto;
  min-height: 36px;
  padding: 4px 12px;
  font-size: 14px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  color: #fff;
  flex: none;
}

/* Diktat-Button: Aufnahme läuft */
#voiceBtn.recording {
  background: var(--amber);
  color: var(--navy);
  animation: voicepulse 1.2s ease-in-out infinite;
}
@keyframes voicepulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 188, 0, 0.55); }
  50% { box-shadow: 0 0 0 10px rgba(255, 188, 0, 0); }
}

/* Foto-Erfassung */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.photo-grid .shot { position: relative; }
.photo-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
}
.photo-grid .stamp {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  font-size: 11px;
  color: #fff;
  background: rgba(6, 12, 117, 0.7);
  border-radius: 6px;
  padding: 2px 6px;
  text-align: center;
}
.photo-grid .confirmed {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--blue);
  color: #fff;
  border-radius: 999px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

/* In-App-Kamera (getUserMedia).
   Vorschaubild füllt den ganzen Screen; die Steuerleiste schwebt fest am unteren
   Rand darüber (wie native Kamera-Apps) — so ist der Auslöser immer sofort
   sichtbar, unabhängig von Kamera-Seitenverhältnis, Fensterhöhe oder mobiler
   Browser-Leiste. */
#camera {
  position: fixed;
  inset: 0;
  background: #000;
  display: none;
  z-index: 200;
}
#camera.open { display: block; }
#camera video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
#camera .controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  /* 3-Spalten-Grid: Auslöser sitzt in der Mittelspalte immer exakt zentriert,
     unabhängig von der Textbreite der seitlichen Buttons */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  /* Scrim, damit die Buttons auch über hellem Vorschaubild lesbar bleiben */
  background: linear-gradient(to top, rgba(6, 12, 117, 0.92) 30%, rgba(6, 12, 117, 0));
}
#camera .shutter {
  width: 84px;
  height: 84px;
  min-height: 84px;
  border-radius: 50%;
  background: #fff;
  border: 6px solid var(--amber);
  padding: 0;
  flex: none;
  font-size: 0;
  transition: opacity 0.15s;
}
#camera .shutter:active { transform: scale(0.94); }
/* „Kamera startet…“: Auslöser sofort sichtbar, aber sichtbar noch nicht bereit */
#camera .shutter:disabled {
  background: rgba(255, 255, 255, 0.55);
  opacity: 0.7;
  animation: shutterwarm 1s ease-in-out infinite;
}
@keyframes shutterwarm {
  0%, 100% { border-color: var(--amber); }
  50% { border-color: rgba(255, 188, 0, 0.4); }
}
#camera .controls button:not(.shutter) {
  background: rgba(255, 255, 255, 0.18);
  min-height: 56px;
  width: auto;
  padding: 12px 20px;
  font-size: 16px;
}
#camera .controls #cameraCancel { justify-self: start; }
#camera .controls #cameraDone { justify-self: end; }
#camera .counter {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  left: 14px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 15px;
  z-index: 1;
}
#camera .flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.08s;
}

/* Pflicht-Checkbox: sehr großes Touchziel */
label.check {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 19px;
  font-weight: 600;
  cursor: pointer;
  margin: 12px 0;
}
label.check input { width: 30px; height: 30px; flex: none; accent-color: var(--blue); }
label.check.checked { border-color: var(--blue); background: #f0f2fe; }
/* Sichtbarer Pflicht-Marker; verschwindet, sobald angehakt */
label.check .req {
  margin-left: auto;
  flex: none;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 999px;
  padding: 2px 9px;
}
label.check.checked .req { display: none; }

textarea {
  width: 100%;
  min-height: 90px;
  font: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

/* Vollbild-Foto (Backoffice) */
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(6, 12, 117, 0.96);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  flex-direction: column;
  gap: 10px;
}
#lightbox.open { display: flex; }
#lightbox img { max-width: 96vw; max-height: 84vh; border-radius: 8px; }
#lightbox .meta { color: #cdd3f2; font-size: 14px; }
#lightbox button { width: auto; min-height: 48px; background: var(--indigo); }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; font-size: 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }
