/* BZKI Fragebogen – Gestaltung
   Farben: Dark Indigo #292259, Electric Purple #6F38A6, Bright Violet #793AFF,
           Peach Orange #FF8762, Charcoal Black #0A0913, Slate Gray #6E7191 */


:root {
  --indigo: #292259;
  --purple: #6F38A6;
  --violet: #793AFF;
  --peach: #FF8762;
  --ink: #0A0913;
  --slate: #6E7191;
  --rule: #D9D5E6;
  --tint: #F1EEF8;
  --paper: #FFFFFF;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 6px;
  --focus: 0 0 0 3px rgba(121, 58, 255, .35);
  box-sizing: border-box;
}
*, *::before, *::after { box-sizing: inherit; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.55 var(--font); font-feature-settings: "kern";
}
a { color: var(--purple); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3 { color: var(--indigo); line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 2rem; font-weight: 600; }
h2 { font-size: 1.35rem; font-weight: 600; margin-top: 2rem; }
h3 { font-size: 1.05rem; font-weight: 600; margin-top: 1.5rem; }
p { margin: 0 0 1rem; max-width: 42em; }
small, .muted { color: var(--slate); }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

/* ---- Rahmen ---- */
.wrap { max-width: 680px; margin: 0 auto; padding: 0 1.25rem 4rem; }
.wrap-wide { max-width: 1120px; }
header.top { display: flex; align-items: center; justify-content: space-between; padding: 1.5rem 0 1.25rem; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 0 0 .5rem; }
.page-head h1 { margin: 0; }
h2.lead { font-size: 1.4rem; font-weight: 600; margin: .75rem 0 1.25rem; color: var(--indigo); }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--indigo); text-decoration: none; font-weight: 500; }
.brand img { height: 44px; width: auto; display: block; }
.brand span { color: var(--slate); font-weight: 400; }
footer.bottom { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: .875rem; color: var(--slate); display: flex; gap: 1.5rem; flex-wrap: wrap; }

/* ---- Fortschritt ---- */
.progress { position: fixed; inset: 0 0 auto 0; height: 4px; background: var(--tint); z-index: 10; }
.progress > i { display: block; height: 100%; background: var(--purple); transition: width .3s ease; }
@media (prefers-reduced-motion: reduce) { .progress > i { transition: none; } }

/* ---- Formulare ---- */
label.field { display: block; margin: 1.25rem 0; }
label.field > span { display: block; font-weight: 500; margin-bottom: .35rem; }
input[type=text], input[type=email], input[type=number], select, textarea {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--slate); border-radius: var(--r);
  padding: .6rem .75rem; width: 100%; max-width: 28rem;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, .scale label:focus-within {
  outline: none; box-shadow: var(--focus);
}
.check { display: flex; gap: .75rem; align-items: flex-start; margin: 1.25rem 0; max-width: 42em; }
.check input { width: 1.15rem; height: 1.15rem; margin-top: .25rem; flex: none; accent-color: var(--purple); }
button, .btn {
  font: 500 1rem/1 var(--font); color: #fff; background: var(--indigo);
  border: 1px solid var(--indigo); border-radius: var(--r); padding: .8rem 1.4rem; cursor: pointer;
  text-decoration: none; display: inline-block;
}
button:hover, .btn:hover { background: var(--purple); border-color: var(--purple); }
.btn-quiet { background: transparent; color: var(--indigo); }
.btn-quiet:hover { background: var(--tint); color: var(--indigo); }
.btn-danger { background: transparent; color: var(--ink); border-color: var(--peach); }
.btn-danger:hover { background: var(--peach); border-color: var(--peach); color: var(--ink); }
.actions { display: flex; gap: .75rem; align-items: center; justify-content: space-between; margin-top: 2rem; flex-wrap: wrap; }
.error { border-left: 3px solid var(--peach); padding: .5rem 1rem; margin: 1rem 0; background: #FFF4EF; max-width: 42em; }
.notice { border-left: 3px solid var(--purple); padding: .5rem 1rem; margin: 1rem 0; background: var(--tint); max-width: 42em; }

input.ro { background: var(--tint); border-color: var(--rule); color: var(--ink); }
.trust { border-left: 3px solid var(--purple); padding: .25rem 1rem; margin: 1.5rem 0; }
.trust p { margin: .5rem 0; font-size: .95rem; }
.tight { margin-top: -.5rem; }
.small { font-size: .8rem; }
.alpha-low { color: #B04A25; font-weight: 600; }
.knapp { color: #6B4E00; background: #FCEFC7; padding: .05rem .4rem; border-radius: 3px; font-size: .85em; }
.typeline { font-size: 1.1rem; }
.pattern-warn { border-left: 3px solid #E0B12B; background: #FCEFC7; color: #4A3700; padding: .6rem 1rem; margin: .5rem 0 1rem; max-width: none; }
table.axes { max-width: 34rem; }
.inline-form.spaced { margin-bottom: 1.5rem; }
.dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; vertical-align: middle; }
.dot-ok { background: #2E9E5B; } .dot-fail { background: #D9452C; } .dot-none { background: var(--rule); }

/* ---- Antwortskala: das eine, prägende Element ---- */
.item { background: var(--tint); border-radius: 12px; padding: 1.5rem 1.75rem 1.6rem; margin: 0 0 1.25rem; border: 0; min-inline-size: 0; }
.item .stmt { display: block; font-size: 1.2rem; font-weight: 600; margin: 0 0 1.25rem; color: var(--indigo); line-height: 1.35; padding: 0; }
.scale { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1.25rem; }
.scale .end { font-size: .95rem; color: var(--slate); line-height: 1.25; }
.scale .end.left { text-align: right; }
.scale .end.right { text-align: left; }
.scale .opts { display: flex; justify-content: center; gap: .9rem; }
.scale label { position: relative; width: 48px; height: 48px; display: grid; place-items: center; cursor: pointer; border-radius: 50%; }
.scale input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.scale i {
  width: 34px; height: 34px; border-radius: 50%; display: block;
  border: 2px solid var(--slate); background: var(--paper);
  transition: transform .12s ease, border-color .12s ease, background-color .12s ease;
}
.scale label:hover i { border-color: var(--purple); transform: scale(1.06); }
.scale input:checked + i { background: var(--purple); border-color: var(--purple); box-shadow: inset 0 0 0 6px var(--paper); }
.scale input:focus-visible + i { box-shadow: var(--focus); }
.item.missing { box-shadow: inset 0 0 0 2px var(--peach); }
.item.missing .stmt::after { content: " – bitte beantworten"; color: var(--peach); font-weight: 400; font-size: .95rem; }
@media (max-width: 600px) {
  body { font-size: 16px; }
  .item { padding: 1.25rem 1rem 1.35rem; border-radius: 10px; }
  .item .stmt { font-size: 1.1rem; }
  .scale { grid-template-columns: 1fr 1fr; grid-template-areas: "opts opts" "left right"; gap: .75rem .5rem; }
  .scale .opts { grid-area: opts; gap: .4rem; }
  .scale .end.left { grid-area: left; text-align: left; }
  .scale .end.right { grid-area: right; text-align: right; }
  .scale label { width: 44px; height: 44px; }
  .scale i { width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) { .scale i, .scale label:hover i { transition: none; transform: none; } }

/* ---- Tabellen ---- */
table { border-collapse: collapse; width: 100%; font-size: .95rem; margin: 1rem 0 2rem; }
th, td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 500; color: var(--slate); font-size: .85rem; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.sub td { padding-left: 1.75rem; color: var(--ink); }
tr.dom td { font-weight: 500; background: var(--tint); }
.table-scroll { overflow-x: auto; }

/* ---- Band-Kennzeichnung ---- */
.band { display: inline-block; min-width: 1.6rem; text-align: center; font-weight: 600; font-size: .85rem; line-height: 1.5rem; border-radius: 4px; padding: 0 .4rem; }
.band-1 { background: var(--indigo); color: #fff; }
.band-2 { background: var(--paper); color: var(--indigo); box-shadow: inset 0 0 0 1.5px var(--indigo); }
.band-3 { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--peach); }
.lvl { font-size: .85rem; padding: .05rem .45rem; border-radius: 3px; background: var(--tint); color: var(--indigo); white-space: nowrap; }
.lvl-hit  { background: #DDF3E4; color: #14532D; box-shadow: inset 0 0 0 1px #9BD9B0; }
.lvl-half { background: #FCEFC7; color: #6B4E00; box-shadow: inset 0 0 0 1px #F0D77A; }
.lvl-miss { background: #FBE1DB; color: #7A2412; box-shadow: inset 0 0 0 1px #F2B5A6; }
.lvl small { font-weight: 400; opacity: .8; }
.lvl { display: inline-block; margin: 0 .25rem .3rem 0; }
.legend { font-size: .9rem; color: var(--slate); max-width: none; }
td.nowrap, th.nowrap { white-space: nowrap; }

/* ---- Backend ---- */
nav.admin { display: flex; gap: 1.25rem; flex-wrap: wrap; padding: .75rem 0 1rem; border-bottom: 1px solid var(--rule); margin-bottom: 1.5rem; font-size: .95rem; align-items: center; }
nav.admin a { color: var(--indigo); text-decoration: none; padding: .25rem 0; border-bottom: 2px solid transparent; }
nav.admin a.on { border-bottom-color: var(--purple); }
nav.admin form { margin-left: auto; }
nav.admin button { padding: .4rem .8rem; font-size: .875rem; }
.warn { border-left: 3px solid var(--peach); background: #FFF4EF; padding: .6rem 1rem; margin: 0 0 1.5rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1.25rem; margin: 1rem 0; font-size: .95rem; }
.kv dt { color: var(--slate); }
.kv dd { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }
.inline-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.inline-form input[type=number] { width: 4.5rem; max-width: 4.5rem; padding: .35rem .5rem; }
.inline-form input[type=text] { max-width: 16rem; padding: .35rem .5rem; }
.inline-form select { max-width: 14rem; padding: .35rem .5rem; }
.inline-form button { padding: .45rem .9rem; font-size: .9rem; }
.thr table input { width: 5.5rem; max-width: 5.5rem; padding: .3rem .45rem; font-size: .9rem; }
.thr label.field input { width: 100%; max-width: 40rem; }
