/* Hoffmann & Freund – Corporate Design (Styleguide 2024): Akzent HF-Rot, Grund Weiß/Hellgrau, Text Anthrazit */
@font-face { font-family: 'Prometo'; src: url('fonts/Prometo.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Prometo'; src: url('fonts/Prometo-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Prometo'; src: url('fonts/Prometo-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Prometo'; src: url('fonts/Prometo-XBold.woff2') format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Prometo'; src: url('fonts/Prometo-Black.woff2') format('woff2'); font-weight: 900; font-display: swap; }

:root {
  --hf: #AA0E31;
  --hf-dark: #8a0b28;
  --hf-tint: #f8e9ec;
  --ink: #1D1D1B;
  --muted: #6b6b68;
  --line: #e2e2df;
  --bg: #f4f4f2;
  --card: #ffffff;
  --ok: #2f7a3a;
  --ok-tint: #e8f3ea;
  --warn: #9a6200;
  --warn-tint: #fdf3e0;
  --info-tint: #eaf0f7;
  --radius: 14px;
  --font-head: 'Prometo', 'Helvetica Neue LT Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-body: 'Helvetica Neue LT Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font-body); }
a { color: var(--hf); }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .5em; }
h1 { font-weight: 900; font-size: clamp(1.8rem, 5vw, 2.6rem); }
h2 { font-weight: 800; font-size: 1.35rem; }
h3 { font-weight: 700; font-size: 1.05rem; margin-top: 1.5em; }
p { margin: 0 0 .8em; }
code { background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); font-size: .92em; }

.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.is-admin .wrap { max-width: 1180px; }

/* Kopfzeile */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; flex-wrap: wrap; }
.topbar__logo img { height: 44px; display: block; }
.topbar__nav { display: flex; gap: 6px; flex-wrap: wrap; }
.topbar__nav a { color: var(--ink); text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 500; }
.topbar__nav a:hover { background: var(--hf-tint); color: var(--hf); }

/* Hero */
.hero { padding: 8px 0 20px; }
.hero__lead { font-size: 1.15rem; max-width: 40em; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.pill { display: inline-block; padding: 7px 18px; border-radius: 999px; background: var(--card); border: 2px solid var(--ink); font-family: var(--font-head); font-weight: 700; }
.pill--accent { border-color: var(--hf); color: var(--hf); }

/* Karten */
.card { background: var(--card); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card--narrow { max-width: 460px; margin: 40px auto; }
.card--intro { border-left: 6px solid var(--hf); }
.card--thanks { border: 2px solid var(--ok); background: var(--ok-tint); }
.card--thanks h2 { color: var(--ok); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.grid2 .card { margin-bottom: 0; }
.grid2 + * { margin-top: 20px; }

/* Überschrift mit Bogen (Gestaltungselement aus dem Logo) */
.arc-heading { display: flex; align-items: center; gap: 12px; }
.arc-heading::before { content: ''; flex: none; width: 12px; height: 26px; border: 5px solid var(--hf); border-left: 0; border-radius: 0 26px 26px 0; }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { padding: 4px 0 4px 28px; position: relative; }
.checklist li::before { content: '✓'; position: absolute; left: 0; color: var(--hf); font-weight: 700; }

/* Meldungen */
.alert { padding: 12px 16px; border-radius: 10px; margin: 0 0 20px; }
.alert--ok { background: var(--ok-tint); color: var(--ok); }
.alert--error { background: var(--hf-tint); color: var(--hf-dark); }
.alert--info { background: var(--info-tint); }

/* Bewertungsskala 1–6 */
.ratings__head { display: grid; grid-template-columns: 1fr auto; gap: 16px; }
.ratings__legend { display: flex; justify-content: space-between; width: 324px; font-size: .78rem; color: var(--muted); }
.ratings__legend em { font-style: normal; }
.ratings__row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.ratings__label { margin: 0; }
.scale { display: flex; gap: 6px; }
.scale input, .yesno input { position: absolute; opacity: 0; pointer-events: none; }
.scale label, .yesno label {
  display: inline-flex; align-items: center; justify-content: center;
  width: 49px; height: 44px; border: 2px solid var(--line); border-radius: 999px;
  cursor: pointer; font-family: var(--font-head); font-weight: 700; user-select: none;
  transition: background .12s, border-color .12s, color .12s;
}
.yesno { display: flex; gap: 8px; margin: 8px 0; }
.yesno label { width: auto; padding: 0 22px; }
.scale label:hover, .yesno label:hover { border-color: var(--hf); }
.scale input:checked + label, .yesno input:checked + label { background: var(--hf); border-color: var(--hf); color: #fff; }
.scale input:focus-visible + label, .yesno input:focus-visible + label { outline: 3px solid var(--ink); outline-offset: 2px; }
.scale--error label { border-color: var(--hf); background: var(--hf-tint); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset:disabled label { cursor: default; }

/* Offene Fragen */
.question { padding: 16px 0; border-top: 1px solid var(--line); }
.question:first-of-type { border-top: 0; }
.question__label { font-weight: 600; margin-bottom: 8px; }
.question__sub { margin: 4px 0 8px; }
.qnum { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--hf); color: #fff; font-family: var(--font-head); font-weight: 800; font-size: .85rem; margin-right: 6px; vertical-align: 1px; }

/* Formulare */
textarea, input[type=text], input[type=password] {
  width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 10px;
  font: inherit; color: inherit; background: #fff; resize: vertical;
}
textarea:focus, input:focus { outline: none; border-color: var(--hf); }
.field { display: block; margin-bottom: 14px; font-weight: 500; }
.field input, .field textarea { margin-top: 6px; font-weight: 400; }

.btn {
  display: inline-block; padding: 13px 28px; border-radius: 999px; border: 2px solid var(--hf);
  background: var(--hf); color: #fff; font: 700 1rem var(--font-head); cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--hf-dark); border-color: var(--hf-dark); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--hf-tint); border-color: var(--hf); color: var(--hf); }
.btn--danger { background: transparent; color: var(--hf); }
.btn--danger:hover { color: #fff; }
.btn--small { padding: 6px 14px; font-size: .85rem; }
.actions { display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }
.card form + form { margin-top: 10px; }

/* Admin */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 18px 20px; }
.stat__num { display: block; font: 900 2rem var(--font-head); }
.stat__label { color: var(--muted); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-top: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table--answers td.num { font: 800 1.2rem var(--font-head); width: 60px; }
.linkcell { display: flex; gap: 6px; align-items: center; min-width: 360px; }
.linkinput { font-size: .8rem !important; padding: 6px 10px !important; font-family: ui-monospace, Menlo, monospace !important; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--bg); color: var(--muted); white-space: nowrap; }
.badge--ok { background: var(--ok-tint); color: var(--ok); }
.badge--warn { background: var(--warn-tint); color: var(--warn); }
.badge--info { background: var(--info-tint); color: #2b4c74; }
.meta { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }
.answer { padding: 12px 0; border-top: 1px solid var(--line); }
.answer__q { font-weight: 600; margin-bottom: 4px; }
.answer__a { background: var(--bg); padding: 10px 14px; border-radius: 10px; }
.answers { list-style: none; padding: 0; margin: 0 0 10px; }
.answers li { background: var(--bg); padding: 10px 14px; border-radius: 10px; margin-bottom: 8px; }
.answers__who { display: block; font-weight: 700; font-size: .85rem; margin-bottom: 2px; text-decoration: none; }
.dist { display: flex; gap: 4px; align-items: flex-end; height: 44px; }
.dist__bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; width: 22px; height: 100%; }
.dist__bar span { display: block; width: 100%; background: var(--hf); border-radius: 4px 4px 0 0; min-height: 2px; }
.dist__bar em { font-style: normal; font-size: .7rem; color: var(--muted); }

.footer { color: var(--muted); font-size: .85rem; padding-top: 10px; padding-bottom: 40px; }

/* Mobil */
@media (max-width: 680px) {
  .card { padding: 18px; }
  .ratings__head { display: none; }
  .ratings__row { grid-template-columns: 1fr; gap: 10px; }
  .scale { justify-content: space-between; }
  .scale label { width: auto; flex: 1; }
  .actions .btn { flex: 1; text-align: center; }
  .topbar__logo img { height: 36px; }
}

/* Honeypot (Spam-Schutz) – für Menschen unsichtbar */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.actions { align-items: center; }
.actions__hint { margin: 0 auto 0 0; }

/* Verteilungsbalken ohne Inline-Styles (CSP) */
.dist__bar .h0 { height: 0; } .dist__bar .h1 { height: 10%; } .dist__bar .h2 { height: 20%; }
.dist__bar .h3 { height: 30%; } .dist__bar .h4 { height: 40%; } .dist__bar .h5 { height: 50%; }
.dist__bar .h6 { height: 60%; } .dist__bar .h7 { height: 70%; } .dist__bar .h8 { height: 80%; }
.dist__bar .h9 { height: 90%; } .dist__bar .h10 { height: 100%; }

.card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: .5em; }
.card__head h2 { margin: 0; }

/* Decoder */
.decode { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-radius: 12px; margin-bottom: 20px; }
.decode--ok { background: var(--ok-tint); border: 2px solid var(--ok); }
.decode--bad { background: var(--hf-tint); border: 2px solid var(--hf); }
.decode__label { font-size: .85rem; color: var(--muted); }
.decode__name { font: 900 1.6rem var(--font-head); }
.decode__status { margin: 4px 0; }
