/* theaterwerk – CI: Beige, Rot #C20Y98M100K12, Bricolage Grotesque */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('/fonts/BricolageGrotesque-Variable.ttf') format('truetype-variations');
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --beige: #f4ede1;
  --beige-soft: #faf6ee;
  --beige-deep: #e9dfcd;
  --rot: #b4132c;
  --rot-hell: #d4566a;
  --tinte: #2b2422;
  --tinte-soft: #6d615c;
  --linie: rgba(43, 36, 34, .14);
  --radius: 18px;
  --schatten: 0 1px 2px rgba(43, 36, 34, .04), 0 12px 32px -12px rgba(43, 36, 34, .18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--beige);
  color: var(--tinte);
  font-family: 'Bricolage Grotesque', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-variation-settings: 'wght' 400, 'wdth' 100, 'opsz' 16;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* dezente Papierstruktur */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(43, 36, 34, .05) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: .5;
  z-index: 0;
}

.wrap { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: 0 24px 96px; }

/* ---------- Kopf ---------- */

header.site {
  position: relative;
  z-index: 1;
  padding: 34px 0 8px;
}
header.site .inner {
  max-width: 1080px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
header.site img.logo { height: 46px; width: auto; display: block; }

nav.site { display: flex; gap: 6px; flex-wrap: wrap; }
nav.site a {
  color: var(--tinte);
  text-decoration: none;
  font-variation-settings: 'wght' 500;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background .18s ease, color .18s ease;
}
nav.site a:hover { background: var(--beige-deep); }
nav.site a.active { background: var(--rot); color: var(--beige-soft); }

/* ---------- Typografie ---------- */

h1, h2, h3 { font-variation-settings: 'wght' 600, 'wdth' 100; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.35rem, 3vw, 1.85rem); letter-spacing: -.01em; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
.lead { font-size: clamp(1.05rem, 2vw, 1.24rem); color: var(--tinte-soft); max-width: 62ch; }
.muted { color: var(--tinte-soft); }
.small { font-size: .88rem; }

/* ---------- Karten ---------- */

.card {
  background: var(--beige-soft);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--schatten);
}
.card + .card { margin-top: 20px; }

.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* ---------- Kennzahlen ---------- */

.kpi { text-align: left; }
.kpi .num {
  font-size: clamp(2.1rem, 6vw, 3rem);
  font-variation-settings: 'wght' 700;
  color: var(--rot);
  line-height: 1;
  letter-spacing: -.02em;
}
.kpi .lbl { color: var(--tinte-soft); font-size: .92rem; margin-top: 6px; }

/* ---------- Balken ---------- */

.bar {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--beige-deep);
  margin: 8px 0 4px;
}
.bar .ja { background: var(--rot); }
.bar .nein { background: #c9bca6; }
.bar .skip { background: repeating-linear-gradient(45deg, #ded3bd, #ded3bd 4px, #eae0cc 4px, #eae0cc 8px); }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .84rem; color: var(--tinte-soft); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.legend .k-ja { background: var(--rot); }
.legend .k-nein { background: #c9bca6; }
.legend .k-skip { background: #ded3bd; }

/* ---------- Fragenliste ---------- */

.qrow { padding: 16px 0; border-top: 1px solid var(--linie); }
.qrow:first-of-type { border-top: 0; }
.qrow .head { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.qrow .no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--beige-deep); color: var(--tinte-soft);
  font-size: .8rem; font-variation-settings: 'wght' 600;
  margin-right: 10px; flex: none;
}
.qrow .text { flex: 1; font-variation-settings: 'wght' 500; }
.qrow .pct { font-variation-settings: 'wght' 700; color: var(--rot); white-space: nowrap; }

/* ---------- Formular ---------- */

label.field { display: block; margin-bottom: 6px; font-variation-settings: 'wght' 500; }

input[type=text], input[type=number], select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--linie);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  color: var(--tinte);
}
input:focus, select:focus, button:focus-visible {
  outline: 2px solid var(--rot);
  outline-offset: 2px;
}

button {
  font: inherit;
  font-variation-settings: 'wght' 600;
  border: 0;
  border-radius: 999px;
  padding: 13px 26px;
  cursor: pointer;
  transition: transform .12s ease, background .18s ease;
}
.btn-primary { background: var(--rot); color: var(--beige-soft); }
.btn-primary:hover { background: #9c1026; }
.btn-primary:disabled { background: #cbbfa8; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--tinte); border: 1px solid var(--linie); }
.btn-ghost:hover { background: var(--beige-deep); }
button:active { transform: translateY(1px); }

.stepper { display: flex; align-items: center; gap: 10px; }
.stepper input { text-align: center; font-variation-settings: 'wght' 600; }
.stepper button {
  width: 44px; height: 44px; padding: 0; border-radius: 50%;
  background: var(--beige-deep); color: var(--tinte); font-size: 1.2rem;
}
.stepper button:hover { background: #dccfb6; }

/* Ja/Nein-Schnellwahl */
.counter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--linie); background: #fff; color: var(--tinte-soft);
  padding: 8px 14px; border-radius: 999px; font-variation-settings: 'wght' 500;
}
.chip.active { background: var(--rot); border-color: var(--rot); color: var(--beige-soft); }

.hint { font-size: .84rem; color: var(--tinte-soft); margin-top: 6px; }

.notice {
  border-left: 4px solid var(--rot);
  background: #fff;
  padding: 14px 18px;
  border-radius: 10px;
  margin: 0 0 18px;
}

/* ---------- Fortschritt ---------- */

.progress {
  position: sticky; top: 0; z-index: 5;
  background: rgba(244, 237, 225, .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--linie);
  padding: 12px 0;
  margin-bottom: 24px;
}
.progress .inner { max-width: 1080px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 14px; }
.progress .track { flex: 1; height: 6px; border-radius: 999px; background: var(--beige-deep); overflow: hidden; }
.progress .track span { display: block; height: 100%; background: var(--rot); width: 0; transition: width .25s ease; }

/* ---------- Tabelle ---------- */

table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--linie); }
th { font-variation-settings: 'wght' 600; color: var(--tinte-soft); font-size: .84rem; text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }

/* ---------- Fuß ---------- */

footer.site {
  position: relative; z-index: 1;
  border-top: 1px solid var(--linie);
  margin-top: 56px; padding: 28px 0;
  color: var(--tinte-soft); font-size: .88rem;
}
footer.site .inner { max-width: 1080px; margin: 0 auto; padding: 0 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer.site a { color: var(--tinte-soft); }

/* ---------- Vorher/Nachher Doppelbalken ---------- */

.dual { margin: 8px 0 4px; }
.dual-row { display: flex; align-items: center; gap: 12px; margin-bottom: 5px; }
.dual-lbl {
  flex: none; width: 74px; font-size: .78rem; color: var(--tinte-soft);
  text-transform: uppercase; letter-spacing: .05em;
}
.dual .bar { flex: 1; margin: 0; height: 12px; }
.dual-val {
  flex: none; width: 62px; text-align: right; font-size: .88rem;
  font-variant-numeric: tabular-nums; font-variation-settings: 'wght' 500;
}

.diff {
  font-variation-settings: 'wght' 700; font-size: .92rem;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.diff.up { color: #1d7a4a; }
.diff.down { color: #a8161f; }
.diff.same { color: var(--tinte-soft); }

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

.adminbox { border: 1px dashed var(--linie); border-radius: 12px; padding: 16px; background: #fff; }
.qline { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.qline .idx {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--beige-deep); color: var(--tinte-soft);
  display: inline-flex; align-items: center; justify-content: center; font-size: .8rem;
}
.qline textarea {
  flex: 1; font: inherit; padding: 9px 12px; border: 1px solid var(--linie);
  border-radius: 10px; resize: vertical; min-height: 44px; background: #fff; color: var(--tinte);
}
.qline .del {
  flex: none; width: 34px; height: 34px; border-radius: 50%; padding: 0;
  background: transparent; border: 1px solid var(--linie); color: var(--tinte-soft);
}
.qline .del:hover { background: #f6dfe2; color: var(--rot); }

textarea.big {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--linie);
  border-radius: 10px; background: #fff; color: var(--tinte); resize: vertical;
}

.status { font-size: .86rem; margin-left: 10px; }
.status.ok { color: #1d7a4a; }
.status.err { color: #a8161f; }

.hidden { display: none !important; }

@media (max-width: 640px) {
  .wrap { padding: 0 18px 72px; }
  header.site .inner, .progress .inner, footer.site .inner { padding: 0 18px; }
  .card { padding: 20px; }
  header.site img.logo { height: 36px; }
  .grid.cols-3 { grid-template-columns: 1fr; }
}

@media print {
  nav.site, .progress, footer.site, .no-print { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
}
