/* =========================================================================
   5D Institut – Visitenkarten-Scan
   Werte übernommen aus der Design-Übergabe (design/README.md).
   Referenzbreite 390px, Inhalt nach oben auf 440px begrenzt.
   ========================================================================= */

@import url('/fonts.css');

:root {
  /* Marke */
  --crimson: #9d0332;
  --crimson-dark: #c41244;
  --neon: #ff3d6e;
  --rose: #ff8fae;

  /* Flächen */
  --navy: #1a202c;
  --navy-deep: #141926;
  --plum: #3a0c22;
  --page: #0d1119;
  --video-bg: #05070c;
  --success: #4ade80;

  /* Text */
  --text: #ffffff;
  --text-86: rgba(255, 255, 255, 0.86);
  --text-66: rgba(255, 255, 255, 0.66);
  --text-50: rgba(255, 255, 255, 0.5);
  --text-40: rgba(255, 255, 255, 0.4);

  /* Glas */
  --glass: rgba(255, 255, 255, 0.055);
  --glass-line: rgba(255, 255, 255, 0.1);

  /* Maße */
  --gutter: 22px;
  --shell: 440px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --accent-gradient: linear-gradient(135deg, #ff3d6e 0%, #c41244 100%);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page);
  color: var(--text);
  font-family: Barlow, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

a { color: #f2839f; text-decoration: none; }
a:hover { color: #ffd0dd; }

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

@keyframes scanline { 0% { top: 8%; } 100% { top: 92%; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------------ Gerüst */

.app {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(95% 55% at 100% 0%, rgba(157, 3, 50, .60) 0%, rgba(157, 3, 50, 0) 62%),
    radial-gradient(80% 50% at 0% 100%, rgba(157, 3, 50, .32) 0%, rgba(157, 3, 50, 0) 65%),
    linear-gradient(165deg, #1a202c 0%, #141926 45%, #3a0c22 100%);
}

.app-header {
  flex: none;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: calc(22px + var(--safe-top)) var(--gutter) 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 13px;
  background: var(--crimson);
  border: 1px solid rgba(255, 255, 255, .16);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.brand-mark img { width: 34px; height: 34px; object-fit: contain; display: block; }

.brand-text { display: flex; flex-direction: column; gap: 1px; }
.brand-name {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -.1px;
}
.brand-kicker {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .52);
}

/* Mittlerer Bereich: nimmt den Rest ein und scrollt bei langem Inhalt */
.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 26px var(--gutter) 0;
  min-height: 0;
}
.view[hidden] { display: none; }
.view-intro { padding-top: 34px; }
.view-enter { animation: rise .3s ease both; }

/* Schiebt den Footer nach unten, wenn der Inhalt kurz ist */
.spacer { flex: 1; min-height: 16px; }

/* ------------------------------------------------------------------ Intro */

.greeting {
  font-family: 'Zilla Slab', Georgia, serif;
  font-size: 17px;
  font-weight: 500;
  font-style: italic;
  color: rgba(255, 255, 255, .58);
  margin-bottom: 10px;
}

.headline {
  font-family: 'Zilla Slab', Georgia, serif;
  font-size: 34px;
  line-height: 1.14;
  font-weight: 600;
  letter-spacing: -.4px;
  text-wrap: pretty;
}

.intro-text {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-66);
  margin-top: 14px;
  max-width: 300px;
  text-wrap: pretty;
}

.steps {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 16px;
  padding: 13px 15px;
  backdrop-filter: blur(12px);
}

.step-no {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 9px;
  background: rgba(255, 61, 110, .16);
  border: 1px solid rgba(255, 61, 110, .32);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--rose);
}

.steps span:last-child {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-86);
  line-height: 1.35;
}

/* ------------------------------------------------------------------ Kamera */

.camera-card {
  position: relative;
  width: 100%;
  aspect-ratio: 0.72;
  border-radius: 24px;
  overflow: hidden;
  background: var(--video-bg);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}

.camera-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.camera-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(5, 7, 12, .45) 0%, rgba(5, 7, 12, 0) 22%,
    rgba(5, 7, 12, 0) 62%, rgba(5, 7, 12, .65) 100%);
}

/* Scan-Rahmen: Abdunklung aussen + vier Ecken + laufende Linie */
.scan-frame {
  position: absolute;
  left: 8%; right: 8%; top: 26%; bottom: 26%;
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(5, 7, 12, .42);
  pointer-events: none;
}

.scan-corner {
  position: absolute;
  width: 34px;
  height: 34px;
  pointer-events: none;
}
.scan-corner-tl { left: 8%;  top: 26%;    border-top: 3px solid var(--neon);    border-left: 3px solid var(--neon);  border-radius: 14px 0 0 0; }
.scan-corner-tr { right: 8%; top: 26%;    border-top: 3px solid var(--neon);    border-right: 3px solid var(--neon); border-radius: 0 14px 0 0; }
.scan-corner-bl { left: 8%;  bottom: 26%; border-bottom: 3px solid var(--neon); border-left: 3px solid var(--neon);  border-radius: 0 0 0 14px; }
.scan-corner-br { right: 8%; bottom: 26%; border-bottom: 3px solid var(--neon); border-right: 3px solid var(--neon); border-radius: 0 0 14px 0; }

.scanline {
  position: absolute;
  left: 10%; right: 10%;
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 61, 110, 0), var(--neon), rgba(255, 61, 110, 0));
  animation: scanline 2.4s ease-in-out infinite alternate;
  pointer-events: none;
}

.camera-badge {
  position: absolute;
  left: 0; right: 0; bottom: 16px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.camera-badge span {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, .9);
  background: rgba(5, 7, 12, .55);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 20px;
  padding: 6px 14px;
  backdrop-filter: blur(8px);
}

.camera-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px;
  text-align: center;
  background: rgba(5, 7, 12, .9);
}
.camera-error[hidden] { display: none; }
.camera-error .sign { font-size: 26px; }
.camera-error .title { font-size: 14px; font-weight: 600; }
.camera-error .detail { font-size: 12.5px; line-height: 1.5; color: var(--text-66); }

.file-pick {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--rose);
  border: 1px solid rgba(255, 61, 110, .4);
  border-radius: 14px;
  padding: 9px 16px;
  cursor: pointer;
}

.camera-hint {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-50);
  margin-top: 16px;
  text-align: center;
}

/* ------------------------------------------------------------------ Ergebnis */

.shot {
  width: 100%;
  aspect-ratio: 1.7;
  border-radius: 18px;
  overflow: hidden;
  background: var(--video-bg);
  border: 1px solid rgba(255, 255, 255, .14);
  position: relative;
  flex: none;
}
/* contain statt cover: die Aufnahme wird nie angeschnitten, der Kunde sieht,
   was tatsaechlich erfasst wurde. Box-Verhaeltnis bleibt wie im Mockup. */
.shot img { width: 100%; height: 100%; object-fit: contain; display: block; }

.shot-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--page);
  background: var(--success);
  border-radius: 20px;
  padding: 4px 10px;
}
.shot-badge[data-state='pruefen'] { background: #fbbf24; }
.shot-badge[data-state='gelesen'] { background: var(--success); }
.shot-badge[data-state='manuell'] { background: rgba(255, 255, 255, .55); }

/* Feldzeilen: Label links (74px), Wert rechts – im Mockup Text, hier editierbar */
.fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}

.field {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  padding: 4px 14px;
}
.field:focus-within { border-color: rgba(255, 61, 110, .55); }

.field > span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .9px;
  text-transform: uppercase;
  color: var(--text-40);
  width: 74px;
  flex: none;
}

.field input,
.field textarea {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: 0;
  padding: 11px 0;
  min-height: 44px;
}
.field input:focus, .field textarea:focus { outline: none; }
.field input::placeholder, .field textarea::placeholder { color: rgba(255, 255, 255, .28); }
.field textarea { resize: none; line-height: 1.4; }

.consent {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  padding: 13px 14px;
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-66);
  cursor: pointer;
}
.consent input {
  width: 20px;
  height: 20px;
  flex: none;
  margin: 1px 0 0;
  accent-color: var(--neon);
}

.notice {
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.5;
  border-radius: 14px;
  padding: 11px 14px;
  background: rgba(255, 61, 110, .12);
  border: 1px solid rgba(255, 61, 110, .34);
  color: #ffc2d2;
}
.notice[hidden] { display: none; }

/* ------------------------------------------------------------------ Erfolg */

.done {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding-bottom: 20px;
}

.done-check {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: var(--page);
  background: var(--success);
  box-shadow: 0 12px 34px rgba(74, 222, 128, .28);
}

.done h2 {
  font-family: 'Zilla Slab', Georgia, serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -.3px;
}
.done p { font-size: 14.5px; color: var(--text-66); max-width: 280px; }

/* ------------------------------------------------------------------ Footer */

.footer-bar {
  flex: none;
  padding: 16px var(--gutter) calc(26px + var(--safe-bottom));
  background: linear-gradient(180deg,
    rgba(13, 17, 25, 0) 0%, rgba(13, 17, 25, .55) 40%, rgba(13, 17, 25, .8) 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-primary {
  height: 58px;
  border: 0;
  border-radius: 19px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(255, 61, 110, .34);
  user-select: none;
  font: inherit;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: .2px;
  color: #fff;
  width: 100%;
  transition: transform .12s ease;
}
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .6; cursor: default; box-shadow: none; }
.btn-primary .glyph { font-size: 18px; line-height: 1; }

.btn-secondary {
  height: 44px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, .78);
  width: 100%;
}
.btn-secondary:hover { background: rgba(255, 255, 255, .07); }
.btn-secondary[hidden] { display: none; }

.footer-note {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-40);
  text-align: center;
}

/* Ladepunkt im Primärbutton */
.dot {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ------------------------------------------------------------------ Admin */

.admin {
  max-width: 1100px;
  margin: 0 auto;
  padding: calc(26px + var(--safe-top)) var(--gutter) calc(30px + var(--safe-bottom));
  min-height: 100dvh;
  background:
    radial-gradient(70% 40% at 100% 0%, rgba(157, 3, 50, .35) 0%, rgba(157, 3, 50, 0) 62%),
    linear-gradient(165deg, #1a202c 0%, #141926 60%, #3a0c22 100%);
}

.admin h1 {
  font-family: 'Zilla Slab', Georgia, serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -.3px;
  margin-bottom: 6px;
}
.admin .lead { font-size: 13.5px; color: var(--text-50); margin-bottom: 20px; }

.admin-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-bar input {
  flex: 1 1 220px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  padding: 12px 14px;
  min-height: 46px;
}
.admin-bar input:focus { outline: none; border-color: rgba(255, 61, 110, .55); }
.admin-bar .btn-primary, .admin-bar .btn-secondary { width: auto; padding-inline: 22px; }
.admin-bar .btn-primary { height: 46px; border-radius: 14px; font-size: 14.5px; }
.admin-bar .btn-secondary { height: 46px; }

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 16px;
}
.admin table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin th, .admin td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  white-space: nowrap;
}
.admin tr:last-child td { border-bottom: 0; }
.admin th {
  color: var(--text-40);
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .9px;
}
.admin td { color: var(--text-86); font-weight: 500; }
.admin .status { font-size: 12.5px; color: var(--text-50); margin: 14px 0; }

/* Admin nutzt denselben Kopf wie die Landingpage, aber ohne Seitenrand */
.admin .app-header { padding-inline: 0; }
.admin h1 { margin-top: 26px; }

/* Intro-Text: nur die zum Ablauf passende Variante ist sichtbar */
.intro-copy[hidden] { display: none; }
.shot[hidden] { display: none; }
