/* Bundestheater Wissens-Portal — Designsprache des internen Dashboards:
   neutrale Flächen, 1px-Hairlines, gedeckte Statusfarben, ruhige Typografie. */
:root {
  --page: #f9f9f7;
  --card: #ffffff;
  --panel: #f5f5f3;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #6f6e69; /* dunkler als früher: 4,5:1 Kontrast auch auf Panel-Flächen (WCAG AA) */
  --line: rgba(11, 11, 11, 0.1);
  --line-solid: #e1e0d9;
  --accent: #2a78d6;
  --good: #0ca30c;
  --good-text: #006300;
  --warn: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --radius: 10px;
}
* { box-sizing: border-box; }
/* WICHTIG: `hidden` muss immer gewinnen. Klassen wie .gate setzen display:flex und
   würden das eingebaute [hidden] sonst überstimmen — die Anmeldeseite bliebe
   sichtbar über dem Portal stehen. */
[hidden] { display: none !important; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.25; margin: 0; }
button { font: inherit; cursor: pointer; }
input, textarea { font: inherit; color: var(--ink); }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Anmeldung: bildschirmfüllendes Tor ----------
   position:fixed + gesperrtes body-Scrollen: der Portalinhalt dahinter ist
   vor der Anmeldung weder sichtbar noch erscrollbar. Papierton = Hintergrund
   des Titelbilds (#fbfaf9), damit Bild und Fläche nahtlos ineinander übergehen. */
body.gate-locked { overflow: hidden; }
.gate {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  background: #fbfaf9;
  overflow-y: auto; overflow-x: hidden;
  opacity: 1; transition: opacity 450ms ease;
}
.gate.leaving { opacity: 0; pointer-events: none; }
.gate-top {
  display: flex; align-items: center; gap: 14px;
  padding: 22px clamp(20px, 4vw, 44px) 0;
  animation: gate-fade 600ms ease both;
}
.velentis-logo.gate-logo { height: 30px; width: auto; }
.gate-tagline { font-size: 15px; color: var(--ink-2); letter-spacing: 0.02em; }
.gate-art {
  /* füllt den verfügbaren Platz zwischen Kopf und Karte — passt sich jeder Bildschirmhöhe an */
  flex: 1 1 auto; min-height: 150px; max-height: 430px;
  background: url('/auth-bg.jpg') no-repeat center / contain;
  margin: 10px clamp(8px, 3vw, 40px);
  animation: gate-fade 900ms ease both;
}
.gate-cardwrap { display: flex; justify-content: center; padding: 0 20px 28px; }
.gate-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: clamp(28px, 4vw, 42px) clamp(24px, 4vw, 42px) 28px;
  max-width: 480px; width: 100%;
  box-shadow: 0 1px 2px rgba(11, 11, 11, 0.04), 0 16px 48px rgba(11, 11, 11, 0.07);
  animation: gate-rise 550ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes gate-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gate-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.gate-card .brand { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.gate-card h1 { font-size: 27px; margin: 6px 0 10px; letter-spacing: -0.015em; }
.lead { color: var(--ink-2); margin: 0 0 24px; font-size: 15.5px; }
.gate-card label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 16px; }
.gate-card input[type="password"], .gate-card input[type="text"] {
  width: 100%; padding: 14px 16px; font-size: 18px; border: 1px solid var(--line-solid);
  border-radius: 10px; margin-bottom: 10px; background: #fff;
}
.gate-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(42, 120, 214, 0.15); }
.showcode {
  display: flex; align-items: center; gap: 8px;
  font-size: 14.5px; color: var(--ink-2); font-weight: 400 !important;
  margin: 0 0 16px; cursor: pointer; user-select: none;
}
.showcode input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.login-hint { font-size: 15.5px; color: var(--ink-2); margin-top: 14px; }
.gate-foot {
  margin-top: auto; text-align: center; color: var(--muted); font-size: 14px;
  padding: 18px 20px 22px;
}
/* Sanfter Übergang in den Inhalt nach der Anmeldung */
#app.enter { animation: gate-fade 500ms ease both; }
@media (prefers-reduced-motion: reduce) {
  .gate, .gate-top, .gate-art, .gate-card, #app.enter { animation: none; transition: none; }
}
@media (max-height: 620px) { .gate-art { display: none; } }

/* ---------- Kurzbestätigung (Toast) ---------- */
.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 60; background: var(--ink); color: #fff;
  border-radius: 999px; padding: 10px 22px; font-size: 15px; font-weight: 600;
  box-shadow: 0 8px 28px rgba(11, 11, 11, 0.25);
  animation: gate-rise 300ms ease both;
}

/* ---------- Knöpfe ---------- */
.btn {
  border: 1px solid var(--line-solid); background: var(--card); color: var(--ink);
  border-radius: 8px; padding: 9px 16px; min-height: 42px;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #2b2b29; }
.btn.big { width: 100%; font-size: 17px; padding: 12px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { color: var(--ink); }
.btn.choice { font-size: 15.5px; padding: 10px 20px; }
.btn.choice.selected { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.btn:disabled { opacity: 0.55; cursor: wait; }

.error { color: var(--critical); font-weight: 600; font-size: 14.5px; }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 12px 24px; background: rgba(249, 249, 247, 0.92); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.topbar .brand { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.topbar .sub { display: block; color: var(--ink-2); font-size: 12.5px; font-weight: 400; }

main { max-width: 860px; margin: 0 auto; padding: 28px 20px 80px; }

/* ---------- Anleitung ---------- */
.howto {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 24px; margin-bottom: 20px;
}
.howto h2 { font-size: 13px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 12px; }
.steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { display: flex; gap: 12px; align-items: baseline; font-size: 15px; }
.steps li::before {
  counter-increment: step; content: counter(step);
  flex: 0 0 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-solid); border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.namerow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.namerow label { font-weight: 600; font-size: 15px; }
.namerow input { padding: 9px 12px; border: 1px solid var(--line-solid); border-radius: 8px; font-size: 16px; min-width: 220px; }
.namerow input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(42, 120, 214, 0.15); }
.namerow .hint { color: var(--ink-2); font-size: 14.5px; flex-basis: 100%; }

/* ---------- Fortschritt ---------- */
.progress-wrap { margin-bottom: 22px; }
.progress-text { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.progress-text strong { color: var(--ink); }
.progress { height: 6px; border-radius: 999px; background: var(--line-solid); overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--good); transition: width 300ms ease; }

/* ---------- Tabs & Filter ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tab {
  border: 1px solid transparent; background: transparent; border-radius: 8px;
  padding: 8px 14px; font-size: 14.5px; color: var(--ink-2);
}
.tab:hover { background: rgba(11, 11, 11, 0.04); color: var(--ink); }
.tab.active { background: var(--card); border-color: var(--line-solid); color: var(--ink); font-weight: 600; }
.tab .count { color: var(--muted); font-weight: 400; }
.filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.chip {
  border: 1px solid var(--line-solid); background: var(--card); border-radius: 999px;
  padding: 5px 13px; font-size: 13px; color: var(--ink-2);
}
.chip:hover { border-color: var(--ink-2); }
.chip.active { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.tab-explain { color: var(--ink-2); font-size: 14px; margin: 6px 0 18px; }

/* ---------- Karten ---------- */
.item {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: 12px;
  transition: border-color 140ms ease;
}
.item:hover { border-color: rgba(11, 11, 11, 0.2); }
.item .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.badge {
  font-size: 12px; font-weight: 600; color: var(--ink);
  border: 1px solid var(--line-solid); background: var(--card); border-radius: 999px; padding: 2px 10px;
}
.cat {
  font-size: 12px; font-weight: 500; color: var(--ink-2);
  border: 1px solid var(--line-solid); border-radius: 999px; padding: 2px 10px;
  display: inline-flex; align-items: center; gap: 6px;
}
.cat .dot { width: 7px; height: 7px; border-radius: 999px; display: inline-block; }
.meta .nr { margin-left: auto; font-size: 12px; color: var(--muted); }
.qtext { font-size: 16.5px; font-weight: 600; margin: 0 0 10px; letter-spacing: -0.005em; }

.kontext {
  background: var(--panel); border-left: 3px solid var(--line-solid); border-radius: 0 8px 8px 0;
  padding: 10px 14px; margin: 0 0 14px; font-size: 14px; color: var(--ink-2);
}
.kontext .klabel {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 3px;
}

.versionbox { border: 1px solid var(--line-solid); border-radius: 8px; padding: 10px 14px; margin: 0 0 8px; }
.versionbox .vlabel {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 2px;
}
.versionbox .vtext { font-size: 14.5px; }

.answerarea { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.answerlabel { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 8px; }
.choices { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
textarea.free {
  width: 100%; min-height: 76px; padding: 11px 13px; border: 1px solid var(--line-solid);
  border-radius: 8px; resize: vertical; font-size: 15px;
}
textarea.free:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(42, 120, 214, 0.15); }
.savebar { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.savemsg { color: var(--good-text); font-weight: 600; font-size: 14px; }
.savemsg.err { color: var(--critical); }
.draftmsg { margin-left: auto; color: #7a5a00; font-size: 14px; font-weight: 600; }
.draftnote {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; color: var(--ink-2);
  border: 1px dashed var(--warn); border-radius: 999px; padding: 4px 13px;
  margin-bottom: 8px; background: #fff8ec;
}
/* Speichern-Knopf hebt sich hervor, solange ein unabgeschickter Entwurf existiert */
.btn.primary.attention { box-shadow: 0 0 0 3px rgba(42, 120, 214, 0.28); }

/* ---------- Alles erledigt ---------- */
.alldone {
  background: rgba(12, 163, 12, 0.06); border: 1px solid rgba(12, 163, 12, 0.25);
  border-radius: var(--radius); padding: 26px 28px; margin-bottom: 16px;
  display: flex; gap: 16px; align-items: center;
}
.alldone .bigcheck {
  flex: 0 0 44px; height: 44px; border-radius: 999px; background: var(--good);
  color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 700;
}
.alldone h3 { font-size: 18px; margin-bottom: 2px; }
.alldone p { margin: 0; color: var(--ink-2); font-size: 14.5px; }

.item.done { background: var(--card); }
.done-line { font-size: 15px; display: flex; align-items: baseline; gap: 8px; }
.done-line .check { color: var(--good); font-weight: 700; }
.done-by { color: var(--muted); font-size: 13px; margin-top: 4px; }
.linklike { background: none; border: none; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; padding: 0; font-size: 13px; }

.empty { color: var(--ink-2); font-size: 14.5px; }

footer { text-align: center; color: var(--muted); font-size: 13px; padding: 26px 16px 40px; }

@media (max-width: 560px) {
  .topbar .sub { display: none; }
  .meta .nr { margin-left: 0; }
}

/* ---------- Quellen-Links ---------- */
.srcbox {
  border: 1px solid var(--line-solid); border-radius: 8px;
  padding: 10px 14px; margin: 0 0 14px; background: var(--card);
}
.srcbox .klabel {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.srclinks { display: flex; flex-wrap: wrap; gap: 6px; }
.srclink {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line-solid); border-radius: 999px;
  padding: 4px 12px; font-size: 13px; color: var(--accent);
  text-decoration: none; background: var(--card); max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: border-color 140ms ease, background 140ms ease;
}
.srclink:hover { border-color: var(--accent); background: rgba(42, 120, 214, 0.06); }
.srclink .ext { font-size: 11px; color: var(--muted); }
.srclink.inbox { margin-top: 6px; }
.versionbox .srclink { align-self: flex-start; }
.versionbox { display: flex; flex-direction: column; align-items: flex-start; }
.chip .dot { width: 7px; height: 7px; border-radius: 999px; display: inline-block; margin-right: 6px; vertical-align: 1px; }

/* ---------- Projektstand ---------- */
.stand-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 4px;
}
.tile.hero { grid-column: 1 / -1; gap: 8px; }
.tile-big { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.tile-num { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.tile-label { color: var(--ink-2); font-size: 14px; }
.stand-sec {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 24px; margin-bottom: 14px;
}
.stand-sec h3 { font-size: 13px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 14px; }
.hausrow { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.hausname { flex: 0 0 200px; font-size: 14.5px; font-weight: 600; }
.hausbar { flex: 1; height: 8px; border-radius: 999px; background: var(--line-solid); overflow: hidden; }
.hausbar-fill { height: 100%; background: var(--good); border-radius: 999px; }
.hauszahl { flex: 0 0 64px; text-align: right; font-size: 13.5px; color: var(--ink-2); }
.phasen { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.phasen li { display: flex; gap: 12px; align-items: flex-start; }
.ph-icon {
  flex: 0 0 26px; height: 26px; border-radius: 999px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 13px; font-weight: 700; margin-top: 1px;
}
.ph-done .ph-icon { background: var(--good); color: #fff; }
.ph-active .ph-icon { background: var(--accent); color: #fff; }
.ph-open .ph-icon { background: var(--line-solid); color: var(--ink-2); }
.phasen strong { font-size: 15.5px; }
.ph-status { color: var(--ink-2); font-size: 13.5px; }
.phasen p { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.feed li { font-size: 14.5px; }
.feed .check { color: var(--good); font-weight: 700; margin-right: 4px; }
@media (max-width: 560px) { .hausname { flex-basis: 110px; } }

/* ---------- Schriftgrößen-Umschalter ---------- */
.font-toggle { display: inline-flex; border: 1px solid var(--line-solid); border-radius: 8px; overflow: hidden; }
.fbtn { border: none; background: var(--card); color: var(--ink-2); padding: 5px 11px; font-size: 13px; line-height: 1; }
.fbtn.big { font-size: 17px; }
.fbtn.active { background: var(--ink); color: #fff; }
html.big-type body { font-size: 17.5px; }
html.big-type .qtext { font-size: 19px; }
html.big-type .lead, html.big-type .steps li, html.big-type textarea.free,
html.big-type .versionbox .vtext, html.big-type .empty { font-size: 17px; }
html.big-type .kontext, html.big-type .tab-explain, html.big-type .done-line { font-size: 16px; }
html.big-type .btn { font-size: 17px; }
html.big-type .tab { font-size: 16px; }
html.big-type .answerlabel, html.big-type .savemsg { font-size: 15px; }

/* ---------- Verbindungs-Hinweis ---------- */
.netbanner {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  z-index: 60; max-width: min(560px, calc(100vw - 32px));
  background: #fff8ec; border: 1px solid var(--warn); border-radius: 12px;
  color: var(--ink); padding: 12px 18px; font-size: 14.5px;
  box-shadow: 0 8px 28px rgba(11, 11, 11, 0.14);
}

/* ---------- „Nächste offene Frage“ ---------- */
.nextpill {
  position: fixed; right: 22px; bottom: 22px; z-index: 40;
  border: 1px solid var(--ink); background: var(--ink); color: #fff;
  border-radius: 999px; padding: 11px 20px; font-size: 14.5px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(11, 11, 11, 0.22);
  transition: transform 140ms ease, background 140ms ease;
}
.nextpill:hover { background: #2b2b29; transform: translateY(-1px); }
.item { scroll-margin-top: 70px; }
.item.spotlight { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(42, 120, 214, 0.18); }

.printrow { display: flex; justify-content: flex-end; margin-bottom: 10px; }

/* ---------- Druckansicht ---------- */
@media print {
  .topbar, .howto, .tabs, .filter, .tab-explain, .gate, .toast, .netbanner,
  .nextpill, .printrow, .answerarea, footer .velentis-logo { display: none !important; }
  body { background: #fff; }
  main { max-width: 100%; padding: 0; }
  .item { break-inside: avoid; border: 1px solid #bbb; box-shadow: none; }
  .progress-wrap::after { content: 'Stand: Ausdruck aus dem Bundestheater Wissens-Portal'; display: block; color: #666; font-size: 11px; margin-top: 4px; }
}

/* ---------- Velentis-Branding ---------- */
.velentis-logo { display: block; height: auto; }
.login-logo { height: 44px; width: auto; margin: 0 auto 18px; }
.login-card { text-align: left; }
.login-logo { margin-left: 0; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-logo { height: 22px; width: auto; opacity: 0.9; }
.footer-logo { height: 26px; width: auto; margin: 0 auto 8px; }
footer div { margin-top: 2px; }
