/* Upload-Seite (/upload): Anmeldung, Dokumente hinzufügen, Schwärzen, Fertig. Maße aus Figma 6281:37566 / 37657 / 37684 / 37756 / 37606 (1440 px).
   Schrift ist Google Sans wie auf der Startseite; die Figma-Entwürfe zeigen Inter, daher können Zeilenumbrüche um Pixel abweichen. */
@font-face {
  font-family: 'Google Sans';
  src: url('fonts/GoogleSans-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #1e3a5f;
  --ink-strong: #13283f;
  --sub: #44648f;
  --text-2: #717171;
  --text-3: #9f9f9f;
  --primary: #161616;
  --line: #becee4;
  --glass: rgba(255, 255, 255, 0.66);
  --shadow: 0 20px 60px rgba(29, 61, 91, 0.09);
  --accent: #2da3ce;
  --chip: #e1f3f7;
  --chip-ink: #0b3b45;
  --bar: #06b6d4;
  --danger: #8f2323;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: 'Google Sans', sans-serif;
  font-optical-sizing: auto;
  color: var(--ink);
  background: #fff;
  min-height: 100vh;
  min-height: 100dvh;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #2da3ce; outline-offset: 3px; }
/* Überschriften bekommen nur programmatisch Fokus (Ansichtswechsel); ein Rahmen darum wäre irreführend. */
h1:focus, h1:focus-visible { outline: none; }
.noscript { padding: 24px; text-align: center; color: var(--ink); }

.app { min-height: 100vh; min-height: 100dvh; }
.view { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; }
.view--app { background: linear-gradient(to bottom, #e6f3f9, #f5f8fa); }
.view--login, .view--done {
  background: #fff url('assets/gradient-bg.png') no-repeat center bottom / cover;
}
.icon { display: inline-flex; flex: none; }

/* ── Kopfzeile ── */
.nav {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 36px;
  background: #fff;
  border-bottom: 1px solid #d9e7ee;
}
.nav--public, .nav--plain { border-bottom: 0; background: transparent; }
.logo { display: block; width: 48px; height: 48px; transform: rotate(1.41deg); }
.eu { display: block; width: 249px; max-width: 45vw; height: auto; }
.nav__user { display: flex; align-items: center; gap: 36px; font-size: 20px; font-weight: 500; line-height: 64px; white-space: nowrap; }
.nav__id-label { color: var(--text-3); }
.nav__id-value { color: var(--text-2); }
.nav__logout { color: var(--accent); font-size: 20px; font-weight: 500; line-height: 64px; padding: 0 4px; }
.nav__logout:hover { text-decoration: underline; }

/* ── Bühne und Überschriften ── */
.stage { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 24px 24px 24px; }
.stage--narrow { width: min(100%, 1008px); gap: 36px; padding-top: 36px; }
.stage--wide { width: min(100%, 1328px); gap: 36px; padding-top: 36px; align-items: stretch; }
.stage--done { width: min(100%, 866px); gap: 24px; padding-top: 24px; flex: 1; }
.head { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.head--center { align-items: center; text-align: center; }
.head__title { font-size: 48px; line-height: 64px; font-weight: 500; letter-spacing: -1.53px; color: var(--ink); }
.head__title--hero { font-size: 64px; line-height: 90px; font-weight: 570; color: var(--ink-strong); }
.head__title--done { line-height: 57px; color: var(--ink-strong); }
.head__sub { font-size: 24px; line-height: 32px; color: var(--sub); }
.head__sub--hero { color: #404c59; max-width: 592px; }

/* ── Buttons und Felder ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 38px; min-height: 44px;
  font-size: 14px; font-weight: 600; letter-spacing: -0.14px; line-height: 20px; white-space: nowrap;
  transition: background 0.2s, opacity 0.2s;
}
.btn--dark { background: var(--primary); color: #fff; }
.btn--dark:hover:not(:disabled) { background: #000; }
.btn--soft { background: rgba(22, 22, 22, 0.08); color: var(--primary); }
.btn--outline { border: 1px solid var(--primary); color: var(--primary); }
.btn--outline:hover { background: rgba(22, 22, 22, 0.05); }
.btn--outline.is-on { background: var(--primary); color: #fff; }
.btn--sm { border-radius: 8px; min-height: 36px; padding: 8px 12px; }
.btn--xl { width: min(100%, 340px); border-radius: 100px; padding: 14px 16px; font-size: 20px; font-weight: 500; letter-spacing: -0.4px; line-height: 22px; }
.btn--block { width: 100%; }
.btn--w240 { width: 240px; max-width: 100%; }
.btn--white { background: #fff; color: var(--ink); }
.btn--white:hover { background: #f0f6f8; }
.btn--ghost { color: #fff; border: 1px solid rgba(255, 255, 255, 0.2); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.12); }
.btn:disabled { opacity: 1; }
.btn--dark:disabled { opacity: 0.55; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: #161616; flex: none; }
.iconbtn:hover:not(:disabled) { background: rgba(22, 22, 22, 0.06); }
.iconbtn:disabled { opacity: 0.35; }
.link { color: #287796; font-size: 16px; line-height: 24px; font-weight: 500; }
.link:hover { text-decoration: underline; }

/* ── Anmeldung ── */
.view--login .stage { align-items: center; justify-content: flex-start; flex: 1; padding-top: 16px; padding-bottom: 32px; }
.card { background: var(--glass); border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 28px; box-shadow: var(--shadow); }
.card--login { width: min(100%, 470px); padding: 27px 22px; }
.form { display: flex; flex-direction: column; align-items: stretch; gap: 24px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field__label { font-size: 14px; line-height: 19.5px; font-weight: 500; color: #344d63; }
.field__wrap { position: relative; }
.field__input {
  width: 100%; height: 52px; padding: 0 15px; border-radius: 13px;
  background: #f9fbfc; border: 1px solid #ced9e2; font-size: 16px; font-weight: 500; color: var(--ink-strong);
}
.field__input::placeholder { color: rgba(19, 40, 63, 0.5); }
.field__input--pw { padding-right: 50px; }
.field__input[aria-invalid] { border-color: var(--danger); }
.eye { position: absolute; top: 5px; right: 6px; width: 42px; height: 42px; border-radius: 21px; display: grid; place-items: center; color: #5d6164; }
.eye:hover { background: rgba(22, 22, 22, 0.06); }
.form .btn--dark { height: 50px; font-size: 16px; font-weight: 500; letter-spacing: 0; box-shadow: 0 9px 12px rgba(17, 24, 32, 0.14); background: #111820; border-radius: 999px; }
.form .link { align-self: center; }
.form__hint { text-align: center; font-size: 16px; line-height: 24px; font-weight: 500; color: #5d6164; }
.form__help { font-size: 14px; line-height: 20px; color: #404c59; background: rgba(255, 255, 255, 0.7); border-radius: 12px; padding: 12px 14px; }
.form__error { color: var(--danger); font-size: 14px; line-height: 20px; font-weight: 500; }
.lock { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 16px; line-height: 32px; }

/* ── Dokumente hinzufügen ── */
.drop {
  width: 100%; background: var(--glass); border: 1.5px dashed var(--line); border-radius: 28px;
  display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 42px 24px; text-align: center;
  transition: background 0.2s, border-color 0.2s;
}
.drop--over { background: rgba(165, 229, 250, 0.45); border-color: #2da3ce; }
.drop--compact { flex-direction: row; justify-content: space-between; padding: 24px; gap: 16px; text-align: left; }
.drop__icon { display: grid; place-items: center; padding: 12px; border-radius: 8px; background: rgba(155, 173, 197, 0.12); color: #3d5a80; }
.drop__lead { display: flex; align-items: center; gap: 16px; color: #3d5a80; }
.drop__title { font-size: 20px; line-height: 24px; font-weight: 500; color: var(--ink); }
.drop__or { font-size: 16px; line-height: 24px; font-weight: 500; color: #5d6164; }
.drop__hint { font-size: 16px; line-height: 24px; font-weight: 500; color: var(--text-3); }
.notes { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: -20px; }
.notes:empty { display: none; }
.note { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--danger); background: rgba(255, 255, 255, 0.7); border-radius: 12px; padding: 10px 14px; }
.list { width: 100%; border: 1px solid var(--line); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px; background: var(--glass); border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row__lead { display: flex; align-items: center; gap: 16px; min-width: 0; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 20px 8px; border-radius: 8px; background: rgba(155, 173, 197, 0.12); color: #5d6164; font-size: 12px; line-height: 16px; font-weight: 500; flex: none; min-width: 62px; }
.row__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.row__name { font-size: 20px; line-height: 24px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
/* Sehr lange Dateinamen: höchstens zwei Zeilen, der volle Name steht im title (sonst wird die Zeile bzw. auf dem Handy die ganze Dateiliste meterhoch). */
.row__name, .rv__file-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.row__meta { font-size: 16px; line-height: 24px; color: var(--text-3); }
.row__trail { display: flex; align-items: center; gap: 24px; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 100px; background: var(--chip); color: var(--chip-ink); font-size: 15px; line-height: 22px; font-weight: 500; letter-spacing: -0.3px; }
.progress { width: 276px; display: flex; flex-direction: column; gap: 4px; }
.progress__label { font-size: 16px; line-height: 24px; color: var(--text-3); }
.bar { height: 8px; border-radius: 999px; background: rgba(156, 163, 175, 0.2); overflow: hidden; }
.bar__fill { height: 8px; background: var(--bar); transition: width 0.15s linear; }
.row__error { display: flex; align-items: center; gap: 8px; max-width: 340px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--danger); }
.bottom { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.bottom__text { font-size: 16px; line-height: 24px; font-weight: 500; color: var(--text-2); }
.foot { margin-top: auto; padding: 16px 24px; text-align: center; font-size: 14px; line-height: 24px; color: var(--text-3); }
.foot--light { color: #fff; }
.view--app .stage { flex: 0 0 auto; }

/* ── Prüfung ── */
.rv { display: grid; grid-template-columns: 280px minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.rv__files { display: flex; flex-direction: column; gap: 12px; }
.rv__file { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; padding: 16px 20px; border-radius: 20px; background: var(--glass); font-size: 16px; line-height: 24px; color: var(--ink); width: 100%; }
.rv__file.is-active { background: rgba(165, 229, 250, 0.66); box-shadow: var(--shadow); }
.rv__file:hover:not(:disabled):not(.is-active) { background: rgba(255, 255, 255, 0.9); }
.rv__file-name { overflow-wrap: anywhere; }
.rv__file-count { font-weight: 500; white-space: pre; }
.rv__viewer { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); background: #dbdde0; display: flex; flex-direction: column; min-height: 640px; }
.rv__bar { background: #f8f8f9; display: flex; align-items: center; justify-content: space-between; padding: 16px; gap: 12px; }
.rv__pager { display: flex; align-items: center; gap: 8px; font-size: 16px; line-height: 24px; color: var(--text-2); }
.rv__pager .iconbtn { width: 32px; height: 32px; }
.rv__drawhint { background: #fff8e1; color: #5b4a00; font-size: 14px; line-height: 20px; padding: 8px 16px; }
.rv__stage { flex: 1; padding: 28px 36px; display: flex; justify-content: center; align-items: flex-start; overflow: auto; }
.rv__page { position: relative; width: min(100%, 520px); background: #fff; box-shadow: 0 5px 20px rgba(29, 61, 91, 0.1); }
.rv__page img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.rv__overlay { position: absolute; inset: 0; touch-action: none; }
.rv__overlay.is-draw { cursor: crosshair; }
.box { position: absolute; background: #111b2b; border-radius: 1px; }
/* Automatische Boxen fangen keine Zeigerereignisse ab, damit man auch über ihnen ein Rechteck aufziehen kann. */
.box:not(.box--manual) { pointer-events: none; }
.box--off { background: transparent; border: 1.5px dashed #c0392b; }
.box--manual { background: #111b2b; outline: 2px solid #2da3ce; }
.box--manual:hover:not(:disabled) { background: #2b3a4e; }
.rv__rubber { position: absolute; border: 1.5px dashed #2da3ce; background: rgba(45, 163, 206, 0.18); pointer-events: none; }
.rv__empty { padding: 48px; text-align: center; color: var(--text-2); }
.rv__panel { background: #fff; border-radius: 20px; box-shadow: 0 5px 20px rgba(29, 61, 91, 0.1); padding: 20px; display: flex; flex-direction: column; gap: 22px; }
.rv__head { display: flex; flex-direction: column; gap: 4px; }
.rv__title { font-size: 20px; line-height: 24px; font-weight: 500; color: var(--ink); }
.rv__count { font-size: 16px; line-height: 24px; color: var(--text-2); }
.findings { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.finding { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px; border-radius: 16px; background: #f0f6f8; text-align: left; font-size: 16px; line-height: 24px; color: var(--text-2); }
.finding--note, .finding--none { display: block; }
button.finding:hover:not(:disabled) { background: #e6f0f4; }
.finding__box { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: #fff; border: 1.5px solid #bceafa; color: var(--ink); flex: none; }
.finding__box.is-on { background: #bceafa; border-color: #bceafa; }
.finding__text { display: flex; flex-direction: column; min-width: 0; }
.finding__label { font-weight: 500; color: var(--ink); }
.finding__value { overflow-wrap: anywhere; }
.rv__cta { display: flex; flex-direction: column; gap: 8px; }
.rv__note { font-size: 12px; line-height: 24px; font-weight: 500; color: var(--text-2); }

/* ── Fertig ── */
.done__icon { display: grid; place-items: center; padding: 16px; border-radius: 37px; background: #bceafa; color: var(--ink); }
.done__list { width: min(100%, 640px); list-style: none; border: 1px solid var(--line); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); }
.done__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; background: var(--glass); border-bottom: 1px solid var(--line); }
.done__row:last-child { border-bottom: 0; }
.done__name { display: flex; align-items: center; gap: 8px; font-size: 16px; line-height: 24px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.done__name .icon { color: #1c8f7a; }
.done__row.is-failed .done__name .icon, .done__row.is-failed .done__meta { color: var(--danger); }
.done__meta { font-size: 16px; line-height: 22px; letter-spacing: -0.32px; color: var(--text-2); text-align: right; }
.done__warn { color: #fff; background: rgba(143, 35, 35, 0.75); border-radius: 12px; padding: 10px 16px; font-size: 14px; line-height: 20px; }
.done__cta { padding: 8px; border-radius: 46px; background: rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.5); }
.stage--done .btn--ghost { min-height: 44px; }

.fatal { max-width: 560px; margin: 20vh auto; padding: 24px; text-align: center; display: flex; flex-direction: column; gap: 12px; }
.fatal h1 { font-size: 28px; font-weight: 500; color: var(--ink); }

/* ── Schmale Fenster ── */
@media (max-width: 1100px) {
  .rv { grid-template-columns: 240px minmax(0, 1fr); }
  .rv__panel { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .nav { padding: 12px 16px; }
  .logo { width: 36px; height: 36px; }
  .eu { width: 150px; }
  .nav__user { gap: 16px; font-size: 14px; line-height: 20px; }
  .nav__logout { font-size: 14px; line-height: 20px; padding: 10px 4px; }
  .head__title { font-size: 32px; line-height: 40px; letter-spacing: -0.8px; }
  .head__title--hero { font-size: 36px; line-height: 44px; }
  .head__title--done { line-height: 40px; }
  .head__sub { font-size: 18px; line-height: 26px; }
  .stage { padding: 16px; }
  .stage--narrow, .stage--wide { gap: 24px; padding-top: 24px; }
  .drop { padding: 28px 16px; }
  .drop--compact { flex-direction: column; align-items: stretch; text-align: center; }
  .drop__lead { justify-content: center; }
  .row { flex-direction: column; align-items: stretch; gap: 16px; padding: 16px; }
  .row__trail { justify-content: space-between; flex-wrap: wrap; gap: 12px; }
  .row__name { font-size: 17px; line-height: 22px; }
  .progress { width: 100%; flex: 1; }
  .bottom { flex-direction: column; align-items: stretch; gap: 12px; }
  .btn--w240 { width: 100%; }
  .rv { grid-template-columns: 1fr; gap: 16px; }
  .rv__files { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .rv__file { width: 220px; flex: none; }
  .rv__viewer { min-height: 0; }
  .rv__stage { padding: 16px; }
  .done__row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .done__meta { text-align: left; }
}
@media (max-width: 480px) {
  .eu { width: 120px; }
  .nav__id-label { display: none; }
  .card--login { padding: 22px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Zusätze für die echte Engine: Hinweise zu unsicheren Funden, fehlgeschlagenem Scan und abgelaufener Sitzung */
.chip--warn { background: #fff3d6; color: #5b4300; }
.finding__hint { font-size: 12px; line-height: 16px; font-weight: 500; color: #8a5a00; }
.finding--warn { background: #fff3d6; color: #5b4300; }
.form__notice { font-size: 14px; line-height: 20px; font-weight: 500; color: #404c59; background: rgba(255, 255, 255, 0.7); border-radius: 12px; padding: 10px 14px; }
