/* Weiterbildungs-Check – Designrichtung D (Chat-Quiz) */
/* Schrift: DM Sans lokal einbinden (nie von Google-Servern – DSGVO), sobald die Datei vorliegt:
@font-face { font-family: "DM Sans"; src: url("fonts/DMSans-Variable.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
   Bis dahin greift die Systemschrift. */

:root {
  --bg: #EEF4EF;
  --surface: #FFFFFF;
  --ink: #18201B;
  --muted: #5A6459;
  --line: #E3E6DF;
  --accent: #16794C;
  --accent-ink: #11603C;
  --accent-soft: #E6F2EB;
  --error: #B42318;
  --radius: 18px;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
}
a { color: var(--accent-ink); }
a:hover { color: #0B4129; }
:focus-visible { outline: 3px solid #1D4ED8; outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.bubble.bot:focus { outline: none; }

/* Kopfzeile */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar__inner { max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.avatar { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .5px; display: flex; align-items: center; justify-content: center; }
.topbar__title { flex: 1; min-width: 0; }
.brand { margin: 0; font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { margin: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepcount { font-size: 13px; font-weight: 700; color: var(--accent-ink); white-space: nowrap; }
.iconbtn { width: 44px; height: 44px; margin-left: -8px; border: 0; background: none; color: var(--ink); border-radius: 22px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.iconbtn:hover { background: var(--bg); }
@media (max-width: 420px) { .iconbtn:not([hidden]) ~ .avatar { display: none; } }
.progress { height: 3px; background: var(--line); }
.progress__bar { height: 3px; width: 0; background: var(--accent); transition: width .3s ease; }

/* Chat */
.chat { max-width: 560px; margin: 0 auto; padding: 20px 16px 8px; display: flex; flex-direction: column; gap: 10px; min-height: 50vh; }
.bubble { max-width: 88%; padding: 12px 14px; font-size: 16px; line-height: 1.45; margin: 0; }
.bubble.bot { align-self: flex-start; background: var(--surface); border-radius: var(--radius) var(--radius) var(--radius) 4px; }
.bubble.user { align-self: flex-end; background: var(--accent); color: #fff; border-radius: var(--radius) var(--radius) 4px var(--radius); }
.chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.chip { min-height: 44px; padding: 8px 16px; font: 500 15px var(--font); color: var(--accent-ink); background: var(--surface); border: 1.5px solid var(--accent); border-radius: 22px; cursor: pointer; text-align: left; }
.chip:hover { background: var(--accent-soft); }
.chip:active { transform: scale(.97); }

/* Bot-Zeilen mit kleinem Avatar, Tipp-Animation */
.botrow { align-self: flex-start; display: flex; align-items: flex-end; gap: 8px; max-width: 92%; }
.botrow .bubble.bot { max-width: none; box-shadow: 0 1px 2px rgba(24,32,27,.06); }
.mini { width: 30px; height: 30px; flex: none; border-radius: 15px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 16px; line-height: 1; }
.mini--ghost { visibility: hidden; }
.pending { display: none !important; }
.typing { display: flex; gap: 5px; align-items: center; padding: 16px 16px; }
.typing span { width: 8px; height: 8px; border-radius: 4px; background: #9AA597; animation: blink 1.1s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .18s; }
.typing span:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .typing span { animation: none; } }

.anim { animation: pop .28s ease both; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .anim { animation: none; } .progress__bar { transition: none; } }

/* Formular */
.card { background: var(--surface); border-radius: var(--radius); padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 360px) { .row2 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 14px; font-weight: 700; }
.field .opt { font-weight: 400; color: var(--muted); }
.field input, .field select { width: 100%; min-height: 48px; padding: 10px 12px; font: 400 16px var(--font); color: var(--ink); background: #fff; border: 1.5px solid #B9C0B5; border-radius: 10px; }
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.field input[aria-invalid="true"] { border-color: var(--error); }
.err { margin: 0; font-size: 13px; color: var(--error); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: #3A4439; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn { min-height: 52px; padding: 0 20px; font: 700 16px var(--font); border-radius: 26px; cursor: pointer; border: 1.5px solid var(--accent); }
.btn--primary { background: var(--accent); color: #fff; width: 100%; }
.btn--primary:hover { background: var(--accent-ink); }
.btn--primary[disabled] { opacity: .6; cursor: progress; }
.btn--secondary { background: #fff; color: var(--accent-ink); flex: 1; }
.btn--secondary:hover { background: var(--accent-soft); }
.note { margin: 0; font-size: 13px; color: var(--muted); }

/* Vertrauen + Fußzeile */
.trust { max-width: 528px; margin: 24px auto 0; padding: 18px; background: var(--surface); border-radius: 16px; width: calc(100% - 32px); }
.trust__title { margin: 0 0 10px; font-weight: 700; }
.trust ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.trust li { display: flex; gap: 8px; align-items: center; font-size: 14px; color: #3A4439; }
.trust svg { color: var(--accent-ink); flex: none; }
.footer { max-width: 560px; margin: 0 auto; padding: 24px 16px 140px; font-size: 12px; line-height: 1.55; color: var(--muted); }
.footer p { margin: 0 0 10px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 16px; }
.linkbtn { padding: 0; border: 0; background: none; font: inherit; color: var(--accent-ink); text-decoration: underline; cursor: pointer; }

/* Cookie-Hinweis: unten, blockiert den Check nicht */
.consent { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(0,0,0,.08); padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); font-size: 14px; }
.consent > * { max-width: 560px; margin-left: auto; margin-right: auto; }
.consent p { margin: 0 auto 10px; }
.consent__title { font-weight: 700; }
.consent__actions { display: flex; gap: 10px; }

/* Rechtsseiten */
.legal { max-width: 720px; margin: 0 auto; padding: 24px 16px 64px; }
.legal h1 { font-size: 26px; line-height: 1.2; }
.legal h2 { font-size: 19px; margin-top: 28px; }
.legal .todo { background: #FFF4D6; border: 1px solid #E5C76B; padding: 10px 12px; border-radius: 8px; }
