:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #1c2733;
  --muted: #5d6b7a;
  --accent: #0e5fa8;
  --accent-dark: #0a4a85;
  --ok: #1e8e4e;
  --warn: #c8552c;
  --line: #dfe5ec;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(20, 40, 70, .07);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Kopfzeile ---------- */
#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 1.4rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  color: var(--accent-dark);
}
.brand-icon { font-size: 1.4rem; }
#nav { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.username { color: var(--muted); margin: 0 .4rem; font-size: .92rem; }
.navbtn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--accent-dark);
  padding: .45rem .9rem;
  border-radius: 999px;
  font-size: .92rem;
  cursor: pointer;
}
.navbtn:hover { background: #eef4fb; }
.navbtn.ghost { color: var(--muted); }

main { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 1.6rem 1.2rem 3rem; }
footer { text-align: center; color: var(--muted); padding: 1rem; }

/* ---------- Karten & Allgemeines ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.3rem 1.5rem;
  margin-bottom: 1rem;
}
h1 { font-size: 1.6rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.25rem; margin: 1.4rem 0 .6rem; }
.muted { color: var(--muted); }
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: .65rem 1.3rem;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--accent-dark); }
.btn.secondary { background: #e8eef5; color: var(--accent-dark); }
.btn.secondary:hover { background: #dbe6f2; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Login ---------- */
.auth-wrap { max-width: 420px; margin: 3rem auto; }
.auth-wrap h1 { text-align: center; }
.auth-tabs { display: flex; gap: .4rem; margin-bottom: 1rem; }
.auth-tabs button {
  flex: 1;
  padding: .55rem;
  border: 1px solid var(--line);
  background: #eef2f7;
  border-radius: 10px;
  cursor: pointer;
  font-size: .95rem;
}
.auth-tabs button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
label { display: block; font-size: .88rem; color: var(--muted); margin: .8rem 0 .25rem; }
input[type=text], input[type=email], input[type=password] {
  width: 100%;
  padding: .65rem .8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 1rem;
}
.error { color: var(--warn); margin-top: .8rem; font-size: .93rem; }
.form-actions { margin-top: 1.2rem; }

/* ---------- Dashboard ---------- */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.module-card { cursor: pointer; transition: transform .12s ease; display: flex; flex-direction: column; gap: .5rem; }
.module-card:hover { transform: translateY(-2px); }
.module-num { font-size: .78rem; font-weight: 700; color: var(--accent); letter-spacing: .06em; }
.module-title { font-weight: 650; font-size: 1.04rem; line-height: 1.3; }
.module-motto { font-size: .86rem; color: var(--muted); font-style: italic; }
.progressbar { height: 8px; background: #e6ebf1; border-radius: 999px; overflow: hidden; margin-top: auto; }
.progressbar > div { height: 100%; background: var(--ok); border-radius: 999px; transition: width .3s; }
.module-meta { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); }
.badge { display: inline-block; font-size: .75rem; padding: .15rem .55rem; border-radius: 999px; background: #e8f5ec; color: var(--ok); font-weight: 600; }
.badge.open { background: #fdf1e8; color: var(--warn); }
.cert-banner { display: flex; align-items: center; gap: .9rem; background: linear-gradient(100deg, #0e5fa8, #1379cf); color: #fff; }
.cert-banner .btn { background: #fff; color: var(--accent-dark); }

/* ---------- Modulseite ---------- */
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: .8rem; }
.crumbs a { color: var(--accent); cursor: pointer; text-decoration: none; }
.item {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: .6rem;
  background: var(--card);
  overflow: hidden;
}
.item-head {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .85rem 1rem;
  cursor: pointer;
}
.item-head:hover { background: #f7fafd; }
.item-kind { font-size: .72rem; font-weight: 700; letter-spacing: .05em; color: var(--accent); text-transform: uppercase; min-width: 84px; }
.item-title { flex: 1; font-weight: 600; }
.item-check { font-size: 1.1rem; color: var(--ok); }
.item-body { padding: 0 1.2rem 1.2rem; border-top: 1px dashed var(--line); }
.item-actions { margin-top: 1rem; }
.asset-list a { color: var(--accent); }

/* ---------- Inhalt (Markdown) ---------- */
.md { line-height: 1.62; font-size: 1.0rem; }
.md h1, .md h2, .md h3 { line-height: 1.3; }
.md h1 { font-size: 1.3rem; }
.md h2 { font-size: 1.15rem; }
.md h3 { font-size: 1.04rem; }
.md ul, .md ol { padding-left: 1.4rem; }
.md li { margin: .25rem 0; }
.md blockquote {
  margin: .8rem 0;
  padding: .5rem 1rem;
  border-left: 4px solid var(--accent);
  background: #f2f7fc;
  border-radius: 0 8px 8px 0;
}
.md table { border-collapse: collapse; width: 100%; margin: .8rem 0; }
.md th, .md td { border: 1px solid var(--line); padding: .45rem .6rem; text-align: left; font-size: .94rem; }
.md th { background: #f0f4f9; }

/* ---------- Quiz ---------- */
.q-block { margin-bottom: 1.4rem; }
.q-question { font-weight: 650; margin-bottom: .5rem; }
.q-option {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  padding: .55rem .8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: .4rem;
  cursor: pointer;
}
.q-option:hover { background: #f6f9fc; }
.q-option input { margin-top: .25rem; }
.q-option.correct { border-color: var(--ok); background: #ecf7f0; }
.q-option.wrong { border-color: var(--warn); background: #fdf2ec; }
.q-explain { font-size: .9rem; color: var(--muted); margin-top: .3rem; padding-left: .2rem; }
.score-big { font-size: 2.4rem; font-weight: 800; }
.score-pass { color: var(--ok); }
.score-fail { color: var(--warn); }

/* ---------- Zertifikat ---------- */
.certificate {
  border: 6px double var(--accent);
  border-radius: 8px;
  padding: 2.5rem 2rem;
  text-align: center;
  background: #fff;
}
.certificate h1 { font-size: 1.9rem; letter-spacing: .04em; }
.certificate .name { font-size: 1.6rem; font-weight: 700; margin: .8rem 0; }
.cert-modules { text-align: left; max-width: 560px; margin: 1.4rem auto; font-size: .95rem; }
.cert-modules li { margin: .25rem 0; }
.req-table { width: 100%; border-collapse: collapse; }
.req-table td, .req-table th { padding: .5rem .6rem; border-bottom: 1px solid var(--line); text-align: left; font-size: .94rem; }

/* ---------- Lernpfade ---------- */
.track { margin-bottom: 2rem; }
.track-head h2 { margin-bottom: .15rem; }
.track-head p { margin-top: .15rem; }
.selftest-card { border: 2px solid var(--accent); }

/* ---------- Selbstcheck in Lektionen ---------- */
.selfcheck {
  margin-top: 1.4rem;
  padding: 1rem 1.2rem;
  background: #f2f7fc;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.selfcheck h3 { margin: .2rem 0 .4rem; }
.sc-block { margin: 1rem 0; }
.sc-q { font-weight: 600; margin-bottom: .4rem; }
.sc-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .6rem .8rem;
  font: inherit;
  margin-bottom: .5rem;
  resize: vertical;
}
.sc-toggle { padding: .4rem .9rem; font-size: .88rem; }
.sc-answer {
  margin-top: .6rem;
  padding: .7rem .9rem;
  background: #ecf7f0;
  border-left: 4px solid var(--ok);
  border-radius: 0 8px 8px 0;
  font-size: .95rem;
  line-height: 1.55;
}

/* ---------- Verhandlungstest ---------- */
.st-title { font-weight: 650; margin-bottom: .4rem; }
.st-text { color: var(--ink); line-height: 1.55; }
.st-scale {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
  margin-top: .6rem;
}
.st-anchor { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.st-opt { position: relative; cursor: pointer; }
.st-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.st-opt span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: .88rem;
  background: var(--card);
}
.st-opt input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.st-opt:hover span { border-color: var(--accent); }

/* ---------- Profil-Auswertung ---------- */
.profile-row { margin: 1.1rem 0; }
.profile-label { font-weight: 650; margin-bottom: .35rem; }
.profile-bar { display: flex; align-items: center; gap: .6rem; }
.profile-side { font-size: .8rem; color: var(--muted); min-width: 130px; }
.profile-side:last-child { text-align: right; }
.profile-track {
  flex: 1;
  height: 12px;
  background: #e6ebf1;
  border-radius: 999px;
  overflow: hidden;
}
.profile-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #6aa9dd); }
.profile-eval {
  margin-top: .45rem;
  font-size: .93rem;
  line-height: 1.55;
  padding: .6rem .8rem;
  background: #f2f7fc;
  border-radius: 10px;
}

/* ---------- Verhandlungs-DNA-Ergebnis ---------- */
.dna-card {
  margin-top: 1.4rem;
  border: 2px solid var(--accent);
  border-radius: 14px;
  padding: 1.1rem 1.3rem;
  background: #fbfcfe;
  line-height: 1.6;
}
.dna-head { font-size: 1.25rem; font-weight: 800; }
.dna-tagline { font-style: italic; color: var(--muted); margin-top: .2rem; }
.dna-cta { font-weight: 650; margin-bottom: 0; }

/* ---------- Landingpage ---------- */
.hero {
  text-align: center;
  padding: 2.6rem 1rem 2rem;
}
.hero h1 { font-size: 2.1rem; margin-bottom: .6rem; }
.hero-sub { max-width: 620px; margin: 0 auto 1.4rem; color: var(--muted); font-size: 1.06rem; line-height: 1.6; }
.hero-cta { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; }
.price-card h3 { margin: .2rem 0 .4rem; }
.price { font-size: 1.5rem; font-weight: 800; color: var(--accent-dark); margin-top: .6rem; }
.price.small { font-size: .95rem; font-weight: 600; }
.price-inline { color: var(--accent-dark); }
.price-strike { font-size: 1rem; font-weight: 500; color: var(--muted); text-decoration: line-through; margin-left: .35rem; }
.saving { font-size: .88rem; font-weight: 700; color: var(--ok); margin-top: .2rem; }
.bundle-card { border: 2px solid var(--accent); position: relative; }
.bundle-flag { font-size: .78rem; font-weight: 700; color: var(--accent-dark); letter-spacing: .04em; }
.bundle-upsell { cursor: pointer; background: #f2f7fc; border: 1px dashed var(--accent); }
.bundle-upsell:hover { background: #e8f1fa; }
.bundle-link { color: var(--accent); font-weight: 600; white-space: nowrap; }

/* ---------- Gesperrte Module / Shop ---------- */
.module-card.locked { opacity: .75; background: #f6f8fa; }
.module-card.locked:hover { opacity: 1; }
.unlock-btn { font-size: .85rem; padding: .4rem .9rem; vertical-align: middle; }
.redeem-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.redeem-row input[type=text] { flex: 1; min-width: 180px; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; }
.redeem-row select, .redeem-row input[type=number] { padding: .55rem .6rem; border: 1px solid var(--line); border-radius: 10px; font-size: .95rem; }
code { background: #eef2f7; padding: .1rem .4rem; border-radius: 6px; }

/* ---------- KI-Sparring Chat ---------- */
.sp-log {
  max-height: 55vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding: .4rem 0;
}
.sp-bubble {
  max-width: 82%;
  padding: .7rem 1rem;
  border-radius: 14px;
  line-height: 1.55;
  font-size: .98rem;
}
.sp-bubble.ai { background: #eef2f7; border-bottom-left-radius: 4px; align-self: flex-start; }
.sp-bubble.me { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.sp-bubble.error { background: #fdf1e8; color: var(--warn); }
.sp-diff input { margin-right: .3rem; }
.sp-row { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; padding: .9rem 1.2rem; }
.sp-row-title { flex: 1; font-weight: 600; min-width: 220px; }
.sp-row-diff { padding: .45rem .5rem; border: 1px solid var(--line); border-radius: 8px; font-size: .9rem; }

@media print {
  #topbar, footer, .no-print { display: none !important; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
}
