/* ---------- Farben (hell/dunkel) ---------- */
:root, :root[data-theme="light"] {
  --bg: #f3f5f8; --surface: #ffffff; --surface-2: #eef1f5; --text: #10151c; --muted: #5b6676; --border: #e1e6ed;
  --accent: #0b84e0; --accent-ink: #ffffff; --danger: #c62828; --ok: #1b7f4b;
  --shadow: 0 1px 2px rgba(16, 21, 28, .06), 0 10px 28px rgba(16, 21, 28, .07);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d1015; --surface: #151a21; --surface-2: #1c222b; --text: #e8edf3; --muted: #98a3b3; --border: #262d38;
  --accent: #3aa0f0; --accent-ink: #06121d; --danger: #ff7a7a; --ok: #5fd38e;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0d1015; --surface: #151a21; --surface-2: #1c222b; --text: #e8edf3; --muted: #98a3b3; --border: #262d38;
    --accent: #3aa0f0; --accent-ink: #06121d; --danger: #ff7a7a; --ok: #5fd38e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .35); color-scheme: dark;
  }
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; margin: 0 0 .6em; }
h1 { font-size: clamp(1.7rem, 4.2vw, 2.5rem); font-weight: 750; }
h2 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.center { text-align: center; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Kopf- und Fußzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px clamp(16px, 4vw, 32px); background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; text-decoration: none; }
.brand svg { color: var(--accent); }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
}
.icon-btn:hover { background: var(--surface-2); }
.wrap { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: clamp(20px, 4vw, 40px) 16px 56px; }
body.admin .wrap { max-width: 1200px; }
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 20px clamp(16px, 4vw, 32px);
  border-top: 1px solid var(--border); color: var(--muted); font-size: .88rem;
}
.foot a { color: var(--muted); }

/* ---------- Karten, Buttons ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: clamp(18px, 3vw, 28px);
  box-shadow: var(--shadow); margin: 0 0 20px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; line-height: 1.2;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: .88rem; border-radius: 8px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }

/* ---------- Startseite ---------- */
.hero { padding: clamp(10px, 4vw, 40px) 0 28px; }
.eyebrow { color: var(--accent); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .82rem; margin-bottom: .8em; }
.lead { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--muted); max-width: 46em; }
.section-title { font-size: .95rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 28px 0 14px; }
.company-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.company-card {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 14px; padding: 26px 18px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); text-align: center;
}
.company-card span { font-weight: 650; color: var(--muted); font-size: .92rem; }

/* ---------- Logos (je nach Design hell/dunkel) ---------- */
.logo { width: auto; max-width: 100%; }
.logo-lg { height: 104px; }
.logo-md { height: 64px; }
.logo-sm { height: 28px; }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: inline-block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .logo-light { display: none; }
  :root:not([data-theme]) .logo-dark { display: inline-block; }
}

/* ---------- Video-Seite ---------- */
.video-title { margin-bottom: 18px; }
.player {
  position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #000;
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.description p:last-child { margin-bottom: 0; }
.description p { overflow-wrap: anywhere; }
.related { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rel-item {
  display: flex; align-items: center; gap: 14px; padding: 10px; border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); text-decoration: none; background: var(--surface-2);
}
.rel-item:hover { border-color: var(--accent); }
.rel-item img { width: 128px; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; flex: none; }
.rel-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; background: var(--surface); color: var(--accent); flex: none; }
.rel-text { display: flex; flex-direction: column; min-width: 0; }
.rel-text strong { overflow-wrap: anywhere; }
.rel-text small { color: var(--muted); }
.download { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
.download h2 { margin-bottom: .3em; }
.download > div { flex: 1 1 260px; }
.download p { margin: 0; }
.producers .logo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 36px; }
.share-row { margin-top: 24px; font-size: .92rem; }

/* ---------- QR-Seite ---------- */
.qr-card { max-width: 480px; margin: 0 auto 20px; }
.qr-box { display: inline-block; padding: 14px; background: #fff; border-radius: 14px; border: 1px solid var(--border); margin: 8px 0 14px; }
.qr-box img { display: block; width: min(320px, 70vw); height: auto; }
.qr-url { overflow-wrap: anywhere; font-size: .92rem; }

/* ---------- Formulare ---------- */
label, .label { display: block; font-weight: 650; font-size: .92rem; margin: 0 0 6px; }
.hint { color: var(--muted); font-weight: 400; font-size: .84rem; }
input[type="text"], input[type="url"], input[type="password"], textarea, select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit;
}
textarea { resize: vertical; min-height: 130px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.field { margin-bottom: 18px; }
fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px 16px; margin: 0 0 18px; min-width: 0; }
legend { font-weight: 650; font-size: .92rem; padding: 0 6px; }
.row { display: flex; gap: 10px; align-items: stretch; }
.row > input, .row > select { flex: 1; min-width: 0; }
.error { color: var(--danger); font-weight: 600; margin: 0 0 14px; }
.company-pick { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.pick {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px;
  cursor: pointer; font-weight: 600; background: var(--bg); margin: 0;
}
.pick:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.pick input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.pick .logo { height: 28px; width: 64px; object-fit: contain; }
.chips { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.chips li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.chips .chip-text { min-width: 0; overflow-wrap: anywhere; }
.chips small { display: block; color: var(--muted); }
.yt-preview { display: flex; gap: 12px; align-items: center; margin-top: 10px; }
.yt-preview img { width: 120px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; flex: none; }
.yt-preview span { color: var(--muted); font-size: .9rem; }

/* ---------- Anmeldung ---------- */
.login-card { max-width: 440px; margin: clamp(8px, 6vw, 56px) auto 20px; }
.login-card h1 { font-size: 1.6rem; }
.btn-block { width: 100%; padding: 12px 18px; }
.login-logos { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 28px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border); }

/* ---------- Admin ---------- */
.admin-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; align-items: start; }
@media (max-width: 960px) { .admin-grid { grid-template-columns: minmax(0, 1fr); } }
.admin-grid h2 { font-size: 1.25rem; }
.notice { padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); margin-bottom: 18px; font-weight: 600; }
.result { margin-top: 20px; padding: 16px; border-radius: 12px; border: 1px solid var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.result h3 { margin: 0 0 10px; color: var(--ok); font-size: 1rem; }
.result .row { margin-bottom: 10px; }
.vlist { display: grid; gap: 14px; }
.vitem { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
@media (max-width: 560px) { .vitem { grid-template-columns: minmax(0, 1fr); } }
.vitem img.thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; }
.vitem h3 { font-size: 1rem; margin: 0 0 4px; overflow-wrap: anywhere; }
.vmeta { color: var(--muted); font-size: .84rem; margin-bottom: 8px; }
.vlink { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.vlink input { font-size: .85rem; padding: 6px 10px; }
.vactions { display: flex; flex-wrap: wrap; gap: 8px; }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: 14px; }

/* ---------- Drucken (QR-Code) ---------- */
@media print {
  .topbar, .foot, .btn-row, .muted, .qr-url { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; }
}
@media (prefers-reduced-motion: no-preference) { .btn, .rel-item, .icon-btn { transition: background .15s, border-color .15s, filter .15s; } }
