/* M&S Video-Upload – Farben aus dem M&S-Redesign (navy/apricot). Keine externen Fonts (DSGVO). */
:root {
  --navy: #152a45;
  --deep: #0e1d31;
  --blue: #3c5980;
  --slate: #51607a;
  --tint: #e7ecf3;
  --line: #c9d3e0;
  --apricot: #e2a76f;
  --apricot-dark: #b9773c;
  --apricot-light: #f6e4d2;
  --paper: #ffffff;
  --page: #f3f5f9;
  --text: #152a45;
  --muted: #51607a;
  --error: #b00020;
  --error-bg: #fbe9ec;
  --ok: #1d6b45;
  --ok-bg: #e3f2ea;
  --radius: 10px;
  --display: "Barlow Condensed", "Roboto Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 16px/1.5 var(--font);
}
a { color: var(--blue); }
a:hover { color: var(--navy); }
h1, h2 { font-family: var(--display); line-height: 1.1; margin: 0 0 .5rem; letter-spacing: .01em; }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); font-weight: 700; }
h2 { font-size: 1.5rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); font-size: .92rem; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
:focus-visible { outline: 3px solid var(--apricot); outline-offset: 2px; }

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }
.wrap-wide { max-width: 1100px; }

/* ---------------------------------------------------------------- Kopf */
.topbar { background: var(--navy); color: #fff; border-bottom: 4px solid var(--apricot); }
.topbar-inner { display: flex; align-items: center; gap: 14px; min-height: 60px; }
.brand {
  font-family: var(--display); font-weight: 800; font-size: 1.5rem; letter-spacing: .02em;
  padding: 2px 10px; background: var(--apricot); color: var(--deep); border-radius: 4px;
}
.topbar-title { font-family: var(--display); font-size: 1.25rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.topbar .btn-link { margin-left: auto; color: #fff; }

main { padding-top: 28px; padding-bottom: 40px; }
.foot { display: flex; gap: 18px; padding-bottom: 32px; font-size: .9rem; }
.foot a { color: var(--muted); }

/* ---------------------------------------------------------------- Karten */
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px;
}
.card-narrow { max-width: 420px; margin-left: auto; margin-right: auto; }
.card-error { border-left: 6px solid var(--error); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

.intro { margin-bottom: 20px; }
.lead { font-size: 1.08rem; }
.specs { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 14px 0 12px; }
.specs li {
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 14px; font-size: .93rem;
}

/* ---------------------------------------------------------------- Sucher (Upload-Fläche)
   Das eine laute Element: ein Kamera-Sucher mit Eckmarken und der Mindestauflösung als Riesenzahl. */
.viewfinder {
  position: relative; display: flex; align-items: center; justify-content: center;
  aspect-ratio: 16 / 9; min-height: 220px; max-height: 360px; width: 100%;
  background: var(--deep); color: #fff; border-radius: var(--radius);
  cursor: pointer; overflow: hidden; isolation: isolate;
  transition: background .15s ease;
}
.viewfinder::after {
  /* hochkant-Rahmen 9:16 als dünne Linie: beide Formate sind willkommen */
  content: ""; position: absolute; top: 12%; bottom: 12%; left: 50%;
  aspect-ratio: 9 / 16; transform: translateX(-50%);
  border: 1px dashed rgba(226, 167, 111, .45); border-radius: 6px; z-index: -1;
}
.vf-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: -2;
  font-family: var(--display); font-weight: 800; line-height: 1;
  font-size: clamp(7rem, 30vw, 15rem); letter-spacing: -.02em;
  color: transparent; -webkit-text-stroke: 2px rgba(226, 167, 111, .35);
  user-select: none;
}
.vf-c { position: absolute; width: 34px; height: 34px; border: 0 solid var(--apricot); }
.vf-tl { top: 16px; left: 16px; border-top-width: 4px; border-left-width: 4px; }
.vf-tr { top: 16px; right: 16px; border-top-width: 4px; border-right-width: 4px; }
.vf-bl { bottom: 16px; left: 16px; border-bottom-width: 4px; border-left-width: 4px; }
.vf-br { bottom: 16px; right: 16px; border-bottom-width: 4px; border-right-width: 4px; }
.vf-text { display: grid; gap: 4px; text-align: center; padding: 0 56px; }
.vf-text strong { font-family: var(--display); font-size: clamp(1.4rem, 4vw, 2rem); letter-spacing: .02em; }
.vf-text span { color: var(--tint); }
.viewfinder:hover, .viewfinder.is-over { background: var(--navy); }
.viewfinder.is-over .vf-c { border-color: #fff; }
.viewfinder:focus-within { outline: 3px solid var(--apricot); outline-offset: 3px; }
.viewfinder.is-locked { cursor: not-allowed; opacity: .6; pointer-events: none; }

/* ---------------------------------------------------------------- Dateiliste */
.files { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 10px; }
.file {
  background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--line);
  border-radius: 8px; padding: 12px 14px;
}
.file.is-ready { border-left-color: var(--blue); }
.file.is-uploading { border-left-color: var(--apricot); }
.file.is-done { border-left-color: var(--ok); }
.file.is-invalid, .file.is-error { border-left-color: var(--error); background: var(--error-bg); }
.file-head { display: flex; align-items: center; gap: 10px; }
.file-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.file-size { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.file-remove {
  border: 0; background: none; font-size: 1.4rem; line-height: 1; color: var(--muted);
  cursor: pointer; padding: 0 4px; border-radius: 4px;
}
.file-remove:hover { color: var(--error); }
.file-meta { color: var(--muted); font-size: .9rem; min-height: 0; }
.file-meta:empty { display: none; }
.file-status { font-size: .93rem; margin-top: 2px; }
.is-invalid .file-status, .is-error .file-status { color: var(--error); font-weight: 600; }
.is-done .file-status { color: var(--ok); font-weight: 600; }
.track { height: 6px; background: var(--tint); border-radius: 999px; overflow: hidden; margin: 8px 0 4px; }
.fill { height: 100%; width: 0; background: var(--apricot); transition: width .2s linear; }
.is-done .fill { background: var(--ok); }

/* ---------------------------------------------------------------- Einwilligung, Aktionen */
.consent {
  display: flex; gap: 12px; align-items: flex-start; margin: 20px 0;
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px;
  font-size: .93rem; cursor: pointer;
}
.consent input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--navy); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.summary { margin: 0; font-weight: 600; }
.summary:empty { display: none; }

.btn {
  font: inherit; font-weight: 700; font-size: 1.02rem;
  background: var(--apricot); color: var(--deep); border: 0; border-radius: 8px;
  padding: 12px 22px; cursor: pointer; min-height: 48px;
}
.btn:hover:not(:disabled) { background: var(--apricot-dark); color: #fff; }
.btn:disabled { background: var(--tint); color: var(--muted); cursor: not-allowed; }
.btn-link { font: inherit; background: none; border: 0; color: var(--blue); text-decoration: underline; cursor: pointer; padding: 4px; }
.btn-small { font: inherit; font-size: .88rem; padding: 4px 10px; border-radius: 6px; cursor: pointer; border: 1px solid var(--line); background: var(--paper); }
.btn-danger { color: var(--error); border-color: var(--error); }
.btn-danger:hover { background: var(--error); color: #fff; }

/* ---------------------------------------------------------------- Admin */
.field { display: grid; gap: 4px; font-size: .9rem; font-weight: 600; }
.field input {
  font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; min-height: 44px; width: 100%; background: #fff; color: var(--text);
}
#login-form { display: grid; gap: 14px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; align-items: end; }
.grid-form .field-wide { grid-column: span 2; }
@media (max-width: 520px) { .grid-form .field-wide { grid-column: 1 / -1; } }
.msg { padding: 10px 12px; border-radius: 8px; margin: 12px 0 0; }
.msg-error { background: var(--error-bg); color: var(--error); }
.msg-ok { background: var(--ok-bg); color: var(--ok); }
.new-link { margin-top: 18px; padding: 16px; background: var(--apricot-light); border-radius: 8px; }
.copy-row { display: flex; gap: 10px; margin-bottom: 8px; }
.copy-row input { flex: 1; min-width: 0; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--tint); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
td.num, th.num { text-align: right; white-space: nowrap; }
td .muted { font-size: .84rem; word-break: break-all; }
.pill { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; background: var(--tint); }
.pill-aktiv, .pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-gesperrt, .pill-rejected, .pill-failed { background: var(--error-bg); color: var(--error); }
.pill-abgelaufen { background: var(--tint); color: var(--muted); }

@media (max-width: 520px) {
  .card { padding: 18px; }
  .vf-text { padding: 0 44px; }
  .actions .btn { width: 100%; }
}
