/* ============================================================
   KI-Audit — Design-System
   Nova-Compute-Marke: Off-White, Navy, Blau · Fraunces + Instrument Sans
   ============================================================ */

@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-var.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --surface-2: #F1F1EE;
  --ink: #1A1A2E;
  --body: #374151;
  --muted: #6B7280;
  --line: #E3E3DE;
  --line-strong: #CFCFC8;

  --blue: #1E40AF;
  --blue-hover: #1A379A;
  --blue-wash: #EEF2FF;
  --navy: #1A1A2E;
  --navy-ink: #F1F1EE;
  --navy-muted: #9CA3AF;
  --navy-line: #2E2E4A;

  --good: #15803D;
  --good-wash: #ECFDF3;
  --warn: #B45309;
  --warn-wash: #FEF6E7;
  --bad: #B42318;
  --bad-wash: #FEF3F2;

  --serif: "Fraunces", Georgia, serif;
  --sans: "Instrument Sans", -apple-system, "Segoe UI", system-ui, sans-serif;

  --radius: 16px;
  --radius-s: 10px;
  --shadow-1: 0 1px 2px rgba(26, 26, 46, .04), 0 8px 24px -12px rgba(26, 26, 46, .12);
  --shadow-2: 0 2px 4px rgba(26, 26, 46, .05), 0 20px 48px -16px rgba(26, 26, 46, .2);
  --wrap: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--blue); text-underline-offset: 2px; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 {
  font-family: var(--serif);
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.12;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); font-weight: 600; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0.75em 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.section { padding: 92px 0; }

.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
  display: block;
}
.lead { font-size: 1.14rem; color: var(--muted); max-width: 62ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 600; font-size: 1rem;
  padding: 14px 26px; border: none; border-radius: 999px;
  text-decoration: none; transition: background .18s ease, transform .12s ease, box-shadow .18s ease;
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--blue); color: #fff; box-shadow: 0 10px 24px -12px rgba(30, 64, 175, .8); }
.btn--primary:hover { background: var(--blue-hover); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #26264a; }
.btn--ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--small { padding: 9px 18px; font-size: .92rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-note { display: block; font-size: .82rem; color: var(--muted); margin-top: 12px; }

/* ---------- Karten ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow-1);
}
.card + .card { margin-top: 16px; }
.card h3:first-child { margin-top: 0; }

.grid { display: grid; gap: 18px; }
.grid > .card + .card { margin-top: 0; } /* im Grid regelt gap den Abstand */
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

/* ---------- Kopfzeile ---------- */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky; top: 0; z-index: 40;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 66px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-weight: 600; font-size: 1.1rem;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em;
}
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); flex: none; }
.brand small {
  display: block; font-family: var(--sans); font-weight: 500;
  font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.langswitch { display: flex; gap: 2px; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.langswitch a {
  padding: 5px 13px; border-radius: 999px; font-size: .82rem; font-weight: 600;
  color: var(--muted); text-decoration: none;
}
.langswitch a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(26,26,46,.12); }

/* ---------- Formularfelder ---------- */
.field { margin-bottom: 20px; }
.field > label, .qlabel {
  display: block; font-weight: 600; color: var(--ink); margin-bottom: 6px; font-size: 1.02rem;
}
.hint { font-size: .9rem; color: var(--muted); margin: 0 0 12px; }
input[type="text"], input[type="email"], input[type="number"], select, textarea {
  width: 100%; padding: 13px 15px;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink);
  font-family: var(--sans); font-size: 1rem; line-height: 1.5;
}
textarea { resize: vertical; min-height: 110px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30, 64, 175, .14);
}
.err { display: none; color: var(--bad); font-size: .85rem; margin-top: 6px; }
.field.invalid .err { display: block; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--bad); }

/* Auswahlkacheln */
.choices { display: grid; gap: 10px; }
.choices--2 { grid-template-columns: repeat(2, 1fr); }
.choice {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius-s); padding: 15px 18px;
  text-align: left; font-size: 1rem; color: var(--ink); font-weight: 500;
  transition: border-color .15s ease, background .15s ease;
  min-height: 56px; width: 100%;
}
.choice:hover { border-color: var(--blue); }
.choice.on { border-color: var(--blue); background: var(--blue-wash); font-weight: 600; }
.choice .box {
  width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line-strong);
  flex: none; display: grid; place-items: center;
}
.choice.on .box { border-color: var(--blue); background: var(--blue); }
.choice.on .box::after { content: ""; width: 8px; height: 8px; border-radius: 2px; background: #fff; }

/* Matrix (Systeme) */
.matrix { display: grid; gap: 10px; }
.matrix-row {
  display: grid; grid-template-columns: minmax(140px, 1fr) minmax(0, 1.4fr) auto;
  gap: 10px; align-items: center;
}
.matrix-row .mlabel { font-size: .95rem; color: var(--ink); font-weight: 500; }
.rating { display: flex; gap: 4px; }
.rating button {
  width: 34px; height: 34px; border-radius: 8px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--muted); font-size: 1rem; line-height: 1;
}
.rating button.on { border-color: var(--blue); background: var(--blue-wash); color: var(--blue); }

/* Aufgabenliste */
.tasklist { display: grid; gap: 10px; }
.task-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 110px auto; gap: 10px; align-items: center; }
.task-row .rm {
  width: 38px; height: 38px; border-radius: 8px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--muted); font-size: 1.1rem; line-height: 1;
}
.task-row .rm:hover { border-color: var(--bad); color: var(--bad); }

/* ---------- Fortschritt ---------- */
.progress { display: flex; align-items: center; gap: 14px; }
.progress .bar { flex: 1; height: 7px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress .fill { height: 100%; width: 0; background: var(--blue); border-radius: 99px; transition: width .35s ease; }
.progress .txt { font-size: .82rem; color: var(--muted); white-space: nowrap; }

.savehint {
  font-size: .82rem; color: var(--muted);
  display: inline-flex; align-items: center; gap: 7px;
}
.savehint .pip { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.savehint.saving .pip { background: var(--warn); }

/* ---------- Marken / Badges ---------- */
.badge {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: .78rem; font-weight: 600;
}
.badge--good { background: var(--good-wash); color: var(--good); }
.badge--warn { background: var(--warn-wash); color: var(--warn); }
.badge--bad { background: var(--bad-wash); color: var(--bad); }
.badge--blue { background: var(--blue-wash); color: var(--blue); }
.badge--muted { background: var(--surface-2); color: var(--muted); }

/* ---------- Tabellen ---------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th {
  text-align: left; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; padding: 12px 16px;
  border-bottom: 1px solid var(--line); background: var(--surface-2);
}
td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }

/* ---------- Kopierfeld ---------- */
.copyrow { display: flex; gap: 8px; align-items: center; }
.copyrow input { font-family: ui-monospace, "Cascadia Mono", monospace; font-size: .88rem; }

/* ---------- Dunkler Block ---------- */
.dark { background: var(--navy); color: var(--navy-ink); }
.dark h1, .dark h2, .dark h3 { color: var(--navy-ink); }
.dark .lead, .dark p { color: var(--navy-muted); }
.dark .card { background: #22223e; border-color: var(--navy-line); color: var(--navy-ink); }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 34px 0; font-size: .86rem; color: var(--muted); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 14px 26px; justify-content: space-between; }
.foot a { color: var(--muted); }

/* ---------- Zustände ---------- */
.center { text-align: center; }
.stack { display: grid; gap: 14px; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--blue);
  animation: spin .9s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .55s ease, transform .55s ease; }

/* ---------- Responsiv ---------- */
@media (max-width: 900px) {
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .matrix-row { grid-template-columns: 1fr; gap: 6px; }
  .task-row { grid-template-columns: 1fr 1fr 90px auto; }
}
@media (max-width: 620px) {
  body { font-size: 1rem; }
  .choices--2 { grid-template-columns: 1fr; }
  .task-row { grid-template-columns: 1fr; }
  .task-row .rm { width: 100%; }
  .btn { width: 100%; }
  .topbar .wrap { height: 58px; }
}

/* ---------- Druck (PDF-Export) ---------- */
@media print {
  .topbar, .btn, .langswitch, .noprint { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .card { box-shadow: none; break-inside: avoid; }
  .section { padding: 18px 0; }
  a { text-decoration: none; color: inherit; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
