/* =========================================================================
   acc_gen Design-Sprache — Fragebogen-Thema
   Tokens 1:1 aus client/tailwind.config.js (Marken-Grün, Neutrals, Motion).
   Diese Datei ist der einzige Ort für Farbe/Typo — Renderer bleibt neutral.
   ========================================================================= */

:root {
  /* Farbe */
  --c-ink:            #1f2a1d;   /* Überschriften, dunkelste Fläche */
  --c-body:           #4b5b47;   /* Fließtext */
  --c-muted:          #66755f;   /* Sekundärtext (AA auf Weiß) */
  --c-faint:          #7d8a78;   /* schwächster lesbarer Ton */
  --c-accent:         #336443;   /* Primär-Grün: Aktionen, Auswahl, Status */
  --c-accent-hover:   #285236;
  --c-accent-soft:    #85ab8b;
  --c-surface:        #ffffff;
  --c-sunken:         #f8faf7;   /* getönte Panel-Fläche */
  --c-panel:          #f0f4ee;   /* zweite Neutralschicht */
  --c-surface-accent: #eef4ec;   /* grün getönt, aktive Hinweise */
  --c-line:           #e8ede6;
  --c-line-strong:    #dde3db;
  --c-topbar:         #0f172a;   /* Produkt-Topbar (live gemessen) */
  --c-seite:          #f4f6f3;   /* Seitenfläche des Portals */
  --c-warn:           #8a6d2b;   /* Hinweis/Abweichung */
  --c-warn-bg:        #fdf8ec;
  --c-warn-line:      #e6d9b6;
  --c-danger:         #8c3b34;
  --c-ok:             #2f7a4d;

  /* Typografie */
  --f-sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Form */
  --radius:    10px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --max-w:     760px;

  /* Motion (out-strong aus dem acc_gen-Tokenset) */
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --dur:  150ms;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--c-body);
  background: var(--c-seite);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 40px 20px 96px; }

/* --- Kopf ------------------------------------------------------------- */
header { margin-bottom: 34px; }
.kopf-logo { height: 30px; width: auto; margin-bottom: 20px; display: block; }
h1 { font-size: 1.72rem; line-height: 1.22; letter-spacing: -0.02em; color: var(--c-ink);
     font-weight: 600; margin: 0 0 10px; }
.meta-info { font-size: 10px; font-weight: 600; letter-spacing: .5px;
     text-transform: uppercase; color: var(--c-body); }
.hinweis-band { margin-top: 16px; padding: 12px 15px; border-radius: var(--radius);
     background: var(--c-surface-accent); border: 1px solid var(--c-line);
     border-left: 3px solid var(--c-accent); font-size: .87rem; color: var(--c-body); }
.hinweis-band.identifizierend { background: var(--c-warn-bg); border-color: var(--c-warn-line);
     border-left-color: var(--c-warn); }
.intro { margin-top: 20px; font-size: 1rem; color: var(--c-body); }
.intro b { color: var(--c-ink); font-weight: 600; }

/* --- Abschnitte -------------------------------------------------------- */
h2 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.015em; color: var(--c-ink);
     margin: 44px 0 6px; }
.schritt { display: block; font-size: 10px; font-weight: 600; letter-spacing: .5px;
     text-transform: uppercase; color: var(--c-accent); margin-bottom: 5px; }
.abschnitt-hinweis { color: var(--c-muted); font-size: .9rem; margin: 0 0 16px; }
.optional-tag { font-size: 10px; font-weight: 600; letter-spacing: .5px;
     text-transform: uppercase; color: var(--c-muted); border: 1px solid var(--c-line-strong);
     border-radius: var(--radius-pill); padding: 2px 9px; margin-left: 8px; vertical-align: middle; }

/* --- Frage-Block ------------------------------------------------------- */
.frage-block { background: var(--c-surface); border: 1px solid var(--c-line);
     border-radius: var(--radius); padding: 20px; margin-bottom: 14px; }
.frage-block.fehlt { border-color: var(--c-danger); box-shadow: 0 0 0 3px rgba(140,59,52,.08); }
.frage-text { font-weight: 600; color: var(--c-ink); font-size: 1rem; margin-bottom: 4px; }
.frage-hilfe { font-size: .86rem; color: var(--c-muted); margin-bottom: 12px; }
.pflicht { color: var(--c-danger); font-weight: 600; }
.feld-fehler { display: none; font-size: .8rem; color: var(--c-danger); margin-top: 8px; }
.frage-block.fehlt .feld-fehler { display: block; }

/* --- Optionen (radio / checkbox) --------------------------------------- */
.option { display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px;
     border: 1px solid var(--c-line-strong); border-radius: var(--radius-sm);
     margin-top: 8px; cursor: pointer; font-size: .95rem;
     transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.option:hover { border-color: var(--c-accent-soft); background: var(--c-sunken); }
.option:has(input:checked) { border-color: var(--c-accent); background: var(--c-surface-accent); }
.option input { accent-color: var(--c-accent); margin: 3px 0 0; flex: none; }
.option:has(input:focus-visible) { outline: 2px solid rgba(51,100,67,.55); outline-offset: 2px; }

/* --- Freitext ---------------------------------------------------------- */
.freitext-input, .zahl-input {
     width: 100%; font: inherit; font-size: .95rem; color: var(--c-ink);
     border: 1px solid var(--c-line-strong); border-radius: var(--radius-sm);
     padding: 9px 12px; background: var(--c-sunken); resize: vertical; }
.zahl-input { width: auto; min-width: 140px; }
.freitext-input:focus, .zahl-input:focus { outline: none; border-color: var(--c-accent);
     box-shadow: 0 0 0 3px rgba(51,100,67,.12); }
.zaehler { font-family: var(--f-mono); font-size: .7rem; color: var(--c-faint);
     text-align: right; margin-top: 4px; }
.einheit { font-size: .9rem; color: var(--c-muted); margin-left: 8px; }

/* --- Skala / NPS ------------------------------------------------------- */
.skala { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.skala label { flex: 1 1 0; min-width: 44px; text-align: center; cursor: pointer;
     border: 1px solid var(--c-line-strong); border-radius: var(--radius-sm);
     padding: 10px 4px; font-family: var(--f-mono); font-size: .9rem; color: var(--c-ink);
     user-select: none; transition: all var(--dur) var(--ease); }
.skala label:hover { border-color: var(--c-accent-soft); background: var(--c-sunken); }
.skala input { position: absolute; opacity: 0; pointer-events: none; }
.skala label:has(input:checked) { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
.skala-fuss { display: flex; justify-content: space-between; gap: 12px;
     font-size: .78rem; color: var(--c-muted); margin-top: 6px; }

/* --- Matrix (Zeile + Auswahl-Pillen) ----------------------------------- */
.matrix-zeile { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: center;
     padding: 13px 0; border-bottom: 1px solid var(--c-line); }
.matrix-zeile:last-of-type { border-bottom: none; }
.matrix-text { font-size: .95rem; color: var(--c-ink); }
.matrix-text b { font-weight: 600; }
.matrix-notiz { display: block; font-size: .8rem; color: var(--c-muted); margin-top: 2px; font-weight: 400; }
.matrix-wahl { display: flex; gap: 4px; }
.matrix-wahl label { font-size: .8rem; border: 1px solid var(--c-line-strong);
     border-radius: var(--radius-pill); padding: 5px 12px; cursor: pointer;
     white-space: nowrap; user-select: none; transition: all var(--dur) var(--ease); }
.matrix-wahl label:hover { border-color: var(--c-accent-soft); }
.matrix-wahl input { position: absolute; opacity: 0; pointer-events: none; }
.matrix-wahl label:has(input:checked) { background: var(--c-accent); border-color: var(--c-accent); color: #fff; font-weight: 500; }
.matrix-wahl label:has(input:checked[data-ton="warn"])   { background: var(--c-warn);   border-color: var(--c-warn); }
.matrix-wahl label:has(input:checked[data-ton="danger"]) { background: var(--c-danger); border-color: var(--c-danger); }
.matrix-wahl label:has(input:checked[data-ton="neutral"]){ background: var(--c-muted);  border-color: var(--c-muted); }
@media (max-width: 560px) { .matrix-zeile { grid-template-columns: 1fr; } }

/* --- Schieberegler ----------------------------------------------------- */
.regler { margin: 20px 0; }
.regler:first-child { margin-top: 6px; }
.regler-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.regler-name { font-weight: 600; font-size: .96rem; color: var(--c-ink); }
.regler-wert { font-family: var(--f-mono); font-weight: 600; font-size: 1.02rem;
     color: var(--c-accent); white-space: nowrap; }
.regler-wert.abweichend { color: var(--c-warn); }
.regler-erlaeuterung { font-size: .85rem; color: var(--c-muted); margin: 2px 0 10px; }
.regler-fuss { display: flex; justify-content: space-between; gap: 10px;
     font-size: .76rem; color: var(--c-faint); margin-top: 4px; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; background: transparent; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--c-line-strong); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--c-line-strong); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px;
     margin-top: -10px; border-radius: 50%; background: var(--c-accent); border: 3px solid #fff;
     box-shadow: 0 1px 4px rgba(31,42,29,.3); cursor: grab;
     transition: transform var(--dur) var(--ease); }
input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%;
     background: var(--c-accent); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(31,42,29,.3); cursor: grab; }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.08); cursor: grabbing; }
input[type=range]:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--c-accent-soft); outline-offset: 2px; }

.marke { position: relative; height: 20px; }
.marke i { position: absolute; top: 9px; width: 2px; height: 11px; background: var(--c-accent-soft);
     transform: translateX(-1px); }
.marke i::after { content: attr(data-t); position: absolute; top: -12px; left: 50%;
     transform: translateX(-50%); font-family: var(--f-mono); font-size: .62rem;
     color: var(--c-muted); white-space: nowrap; }

/* --- Gewichtungs-Summe ------------------------------------------------- */
.summe { display: flex; justify-content: space-between; align-items: center; gap: 12px;
     background: var(--c-ink); color: #fff; border-radius: var(--radius); padding: 13px 18px; margin-top: 16px; }
.summe-zahl { font-family: var(--f-mono); font-size: 1.1rem; font-weight: 600; }
.summe small { display: block; opacity: .72; font-size: .78rem; font-weight: 400; }

.zuruecksetzen { background: none; border: 1px solid var(--c-line-strong); border-radius: var(--radius-pill);
     padding: 6px 14px; font: inherit; font-size: .78rem; color: var(--c-muted); cursor: pointer;
     margin-top: 12px; transition: all var(--dur) var(--ease); }
.zuruecksetzen:hover { border-color: var(--c-accent); color: var(--c-accent); }

/* --- Absenden ---------------------------------------------------------- */
.submit-wrap { margin-top: 34px; text-align: center; }
.btn-primary { background: var(--c-ink); color: #fff; border: none; border-radius: var(--radius);
     padding: 14px 30px; font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer;
     transition: background-color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.btn-primary:hover { background: #2d3a2a; }
.btn-primary:active { transform: scale(.97); }
.btn-primary[disabled] { opacity: .55; cursor: progress; }
.btn-neben { background: #fff; color: var(--c-accent); border: 1px solid var(--c-accent);
     border-radius: var(--radius); padding: 11px 22px; font: inherit; font-weight: 600;
     cursor: pointer; margin-top: 12px; transition: all var(--dur) var(--ease); }
.btn-neben:hover { background: var(--c-surface-accent); }
.btn-neben:active { transform: scale(.97); }
.submit-hinweis { font-size: .82rem; color: var(--c-faint); margin-top: 12px; }
.fehler-band { display: none; margin-top: 14px; padding: 12px 15px; border-radius: var(--radius);
     background: #fdf1f0; border: 1px solid #e8cdca; color: var(--c-danger); font-size: .88rem; text-align: left; }

/* --- Danke / Ergebnis -------------------------------------------------- */
.danke { display: none; background: var(--c-surface); border: 1px solid var(--c-line);
     border-left: 3px solid var(--c-accent); border-radius: var(--radius); padding: 26px;
     opacity: 1; transition: opacity 250ms var(--ease); }
.danke h2 { margin-top: 0; }
.danke textarea { width: 100%; min-height: 180px; font-family: var(--f-mono); font-size: .76rem;
     border: 1px solid var(--c-line-strong); border-radius: var(--radius-sm); padding: 10px; margin-top: 10px; }

footer { margin-top: 40px; font-size: .76rem; color: var(--c-faint); text-align: center; }
footer a { color: var(--c-muted); }

/* --- Modul „Gewichtungsmodell": Kriterien-Gruppen und Live-Rangfolge ---- */
.krit-gruppe { padding-top: 4px; }
.krit-gruppe + .krit-gruppe { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--c-line); }
.krit-gruppe-titel { font-weight: 600; color: var(--c-ink); font-size: .98rem; margin-bottom: 2px; }
.krit-gruppe-zusatz { color: var(--c-muted); font-weight: 400; }

.rang { display: grid; grid-template-columns: 26px 1fr auto auto; gap: 10px; align-items: center;
     padding: 8px 0; border-bottom: 1px solid var(--c-line); font-size: .92rem; }
.rang:last-child { border-bottom: none; }
.rang-nr { font-family: var(--f-mono); font-size: .8rem; color: var(--c-faint); }
.balken-spalte { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.balken-name { line-height: 1.3; color: var(--c-ink); }
.rang-bal { height: 6px; border-radius: 3px; background: var(--c-accent); min-width: 3px;
     transition: width var(--dur) var(--ease); }
.rang-pct { font-family: var(--f-mono); font-size: .85rem; width: 54px; text-align: right; color: var(--c-body); }
.rang-delta { font-size: .78rem; width: 42px; text-align: right; color: var(--c-faint); }
.rang-delta.hoch { color: var(--c-ok); }
.rang-delta.runter { color: var(--c-danger); }
.fussnote { font-size: .84rem; color: var(--c-muted); margin: 12px 0 0; }

/* --- Produkt-Chrome: Topbar wie im Account-Trainer-Portal ---------------- */
.topbar { background: var(--c-topbar); color: #fff; height: 57px; display: flex;
     align-items: center; gap: 11px; padding: 0 24px; position: relative; z-index: 2; }
.topbar img { width: 26px; height: 26px; border-radius: 7px; display: block; }
.topbar-marke { font-size: .95rem; font-weight: 600; letter-spacing: -0.01em; color: #fff; }
.topbar-rechts { margin-left: auto; font-size: 10px; font-weight: 600; letter-spacing: .5px;
     text-transform: uppercase; color: rgba(255,255,255,.55); }

/* Datennetz-Hintergrund (statische Fassung von NeuralBg, subtle-Variante) */
#netz { position: fixed; inset: 57px 0 0 0; width: 100%; height: calc(100% - 57px);
     z-index: 0; pointer-events: none; opacity: .55;
     /* Lesespalte freihalten — entspricht der inSafeZone-Logik von NeuralBg:
        das Muster lebt an den Rändern, der Text steht auf ruhiger Fläche. */
     -webkit-mask-image: linear-gradient(to right, #000 0%, #000 14%, transparent 34%,
                                         transparent 66%, #000 86%, #000 100%);
     mask-image: linear-gradient(to right, #000 0%, #000 14%, transparent 34%,
                                 transparent 66%, #000 86%, #000 100%); }
/* Schmale Viewports: kein Platz neben der Spalte → Muster ganz aus. */
@media (max-width: 1100px) { #netz { display: none; } }
.wrap { position: relative; z-index: 1; }

/* --- Rechtstexte -------------------------------------------------------- */
.recht h2 { font-size: 1.02rem; margin: 28px 0 8px; }
.recht p, .recht li { font-size: .92rem; color: var(--c-body); }
.recht ul { padding-left: 20px; }
.recht .frage-block p:last-child { margin-bottom: 0; }

/* --- Ladezustand -------------------------------------------------------- */
.laedt { display: flex; align-items: center; gap: 10px; padding: 60px 0;
     color: var(--c-muted); font-size: .92rem; }
.laedt-punkt { width: 9px; height: 9px; border-radius: 50%; background: var(--c-accent);
     animation: laedt-puls 1.1s ease-in-out infinite; }
@keyframes laedt-puls { 0%,100% { opacity: 1; transform: scale(1); }
                        50% { opacity: .35; transform: scale(.7); } }
