/* FISI-Einstufung — Design-Tokens & Layout
   14.11.2026 (FernUSG): Optik wie die Portalseite /einstufung (templates/einstufung_selbst.html):
   warme Flächen, Bernstein als neutrale Akzentfarbe. Keine Farben nach Richtigkeit: die gewählte
   Antwort ist nur „gewählt“, nie grün oder rot. */
:root {
  --bg: #f6f4f0;
  --bg-elev: #ffffff;
  --surface-2: #f0ede8;
  --border: #e0dad0;
  --border-strong: #cec8bc;
  --text: #1c1710;
  --text-muted: #5a5040;
  --text-faint: #8c8070;
  --brand: #b8742a;
  --brand-strong: #9a5f1f;
  --brand-soft: rgba(184,116,42,.08);
  --brand-border: rgba(184,116,42,.25);
  --on-brand: #ffffff;
  --shadow: 0 2px 8px rgba(28,23,16,.08), 0 1px 3px rgba(28,23,16,.06);
  --radius: 12px;
  --radius-sm: 8px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --focus: 0 0 0 3px rgba(184,116,42,.35);
  --dur: 160ms;
}
:root[data-theme="dark"], html.dark {
  --bg: #0d1117;
  --bg-elev: #161b22;
  --surface-2: #1c2230;
  --border: #2a3242;
  --border-strong: #3a4356;
  --text: #e7edf5;
  --text-muted: #aeb8c6;
  --text-faint: #7a8797;
  --brand: #d4924a;
  --brand-strong: #e6a968;
  --brand-soft: rgba(212,146,74,.13);
  --brand-border: rgba(212,146,74,.32);
  --on-brand: #1c1710;
  --shadow: 0 2px 10px rgba(0,0,0,.35);
  --focus: 0 0 0 3px rgba(212,146,74,.4);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117; --bg-elev: #161b22; --surface-2: #1c2230; --border: #2a3242;
    --border-strong: #3a4356; --text: #e7edf5; --text-muted: #aeb8c6; --text-faint: #7a8797;
    --brand: #d4924a; --brand-strong: #e6a968; --brand-soft: rgba(212,146,74,.13);
    --brand-border: rgba(212,146,74,.32); --on-brand: #1c1710;
    --shadow: 0 2px 10px rgba(0,0,0,.35); --focus: 0 0 0 3px rgba(212,146,74,.4);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 860px; margin: 0 auto; padding: 22px 18px 40px; }
.hidden { display: none !important; }
.spacer { flex: 1; }

/* Kopf */
header.app {
  display: flex; align-items: center; gap: 14px; margin-bottom: 18px;
  padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand), var(--brand-strong));
  color: var(--on-brand); font-weight: 800; letter-spacing: .5px; font-size: 16px;
}
header.app h1 { margin: 0; font-size: 19px; font-weight: 750; letter-spacing: -.2px; }
header.app .sub { color: var(--text-muted); font-size: 12.5px; }

.dbchip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--bg-elev);
  font-size: 12.5px; color: var(--text-muted);
}
.dbchip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }

/* Knöpfe */
.btn {
  appearance: none; border: 1px solid var(--border-strong); background: var(--bg-elev);
  color: var(--text); font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 9px 16px; border-radius: var(--radius-sm); cursor: pointer;
  transition: background var(--dur), border-color var(--dur), transform var(--dur);
}
.btn:hover { border-color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--on-brand); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: var(--surface-2); border-color: var(--border-strong); }
.btn.lg { font-size: 15.5px; padding: 12px 24px; }

/* Schritte 1–2–3 (wie im Portal) */
.schritte { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.schritte span {
  font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 100px;
  border: 1px solid var(--border-strong); color: var(--text-muted); background: var(--bg-elev);
}
.schritte span.an { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--on-brand); }

/* Start (Hero) */
.hero {
  background: linear-gradient(135deg, var(--bg-elev) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px 24px 22px; margin-bottom: 18px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase; color: var(--brand-strong);
  background: var(--brand-soft); border: 1px solid var(--brand-border);
  padding: 4px 11px; border-radius: 100px; margin-bottom: 12px;
}
.hero-titel { font-size: 22px; font-weight: 800; letter-spacing: -.3px; margin: 0 0 8px; }
.hero p { color: var(--text-muted); max-width: 660px; margin: 0 0 12px; }
.facts { margin: 4px 0 12px; padding-left: 20px; color: var(--text-muted); }
.facts li { margin-bottom: 6px; }
.facts strong { color: var(--text); }
.hero p.hinweis, .hinweis {
  font-size: 12.5px; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 13px; margin: 12px 0 0; max-width: none;
}
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }

/* Karten */
.card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 18px;
}
.card-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 18px 20px 0;
}
.card-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.card-head .hint { color: var(--text-muted); font-size: 12px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; }
.card-body { padding: 14px 20px 20px; }
.muted { color: var(--text-muted); margin: 0 0 10px; }
.status { font-size: 12.5px; color: var(--text-muted); margin: 10px 0 0; min-height: 1em; }

/* Frage */
.qstand { margin: 0 0 8px; color: var(--text-muted); }
.qtext { font-size: 17px; font-weight: 650; line-height: 1.45; margin-bottom: 16px; }
.options { display: grid; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev); color: var(--text); font: inherit; cursor: pointer;
  transition: border-color var(--dur), background var(--dur);
}
.opt:hover { border-color: var(--brand); }
.opt:focus-visible { outline: none; box-shadow: var(--focus); }
.opt .marker {
  width: 26px; height: 26px; flex: none; border-radius: 7px; border: 1.5px solid var(--border-strong);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--text-muted);
}
.opt.leise { color: var(--text-muted); border-style: dashed; }
/* gewählt = nur „das habe ich gewählt“ (neutral), unabhängig davon, ob es stimmt */
.opt[aria-pressed="true"] { border-color: var(--brand); border-style: solid; background: var(--brand-soft); color: var(--text); }
.opt[aria-pressed="true"] .marker { border-color: var(--brand-strong); background: var(--brand-strong); color: var(--on-brand); }

/* Musterlösungen: Fragetext innerhalb des Bausteins */
.sv-frage { margin: 0; font-weight: 600; }

/* Selbst einschätzen (wie im Portal) */
.themen { margin: 4px 0 6px; }
.thema-zeile {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  border-top: 1px solid var(--border); padding: 11px 0;
}
.thema-zeile:first-child { border-top: none; }
.thema-zeile .tn { font-weight: 600; }
.wahl { display: flex; gap: 6px; flex-wrap: wrap; }
.wahl label {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 6px 11px;
  border: 1px solid var(--border-strong); border-radius: 100px; cursor: pointer; background: var(--bg-elev);
}
.wahl label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.wahl input { margin: 0; accent-color: var(--brand-strong); }

.foot {
  margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--border);
  color: var(--text-faint); font-size: 12px; text-align: center;
}

@media (max-width: 620px) {
  header.app { flex-wrap: wrap; }
  .hero { padding: 18px 16px; }
  .card-head, .card-body { padding-left: 14px; padding-right: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* iframe-Einbettung: Kopf und Fuß ausblenden */
body.embed header.app { display: none; }
body.embed .foot { display: none; }
body.embed .wrap { padding-top: 8px; }
