/* =========================================================================
   Freytag 360 — ki-check.css
   Nur für ki-check.html („Welche KI passt zu Ihrem Betrieb?“). Baut auf den
   Tokens aus styles.css auf (--brand, --ink, --tint, --line, --surface …).
   CSP style-src 'self': keine Inline-Styles; der Fortschrittsbalken liest
   die CSS-Variable --kc-anteil, die ki-check.js per CSSOM setzt.
   ========================================================================= */

/* [hidden] muss gewinnen — .btn setzt display:inline-flex, sonst stünde der
   ausgeblendete Zurück-Knopf auf Frage 1 trotzdem da. */
.kc-app[hidden], .kc-app [hidden] { display: none !important; }

/* ---- Kopf ------------------------------------------------------------- */
.kc-kopf h1 { max-width: 20ch; }
.kc-privat {
  display: inline-flex; align-items: flex-start; gap: .6rem;
  margin: 0; padding: .7rem 1rem;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: var(--fs-sm); line-height: 1.5; color: var(--ink);
}
.kc-privat svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--brand); margin-top: .05rem; }
.kc-privat strong { font-weight: 600; }

/* ---- Test-Karte ------------------------------------------------------- */
.kc-bereich .wrap { max-width: 52rem; }
.kc-ohne-js { margin-top: 0; }
.kc-app {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, .9rem + 2vw, 2.5rem);
}

/* Fortschritt */
.kc-fortschritt { margin-bottom: clamp(1.25rem, 1rem + 1vw, 1.75rem); }
.kc-status {
  margin: 0 0 .55rem;
  font-family: var(--ff-display); font-weight: 500; font-size: var(--fs-s);
  letter-spacing: .06em; color: var(--muted);
}
.kc-bar { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.kc-bar-fill {
  display: block; height: 100%; width: 100%;
  background: var(--brand); border-radius: 999px;
  transform: scaleX(var(--kc-anteil, 0)); transform-origin: left center;
  transition: transform .3s ease;
}

/* Frage */
.kc-step { border: 0; margin: 0; padding: 0; min-width: 0; }
.kc-step:focus { outline: none; }
.kc-legend {
  display: block; width: 100%; padding: 0; margin: 0 0 1.1rem;
  font-family: var(--ff-display); font-weight: 700; font-size: var(--fs-h3);
  line-height: var(--lh-heading); letter-spacing: -0.01em; color: var(--ink);
  text-wrap: balance;
}
.kc-nr {
  display: block; margin-bottom: .45rem;
  font-weight: 500; font-size: var(--fs-xs); letter-spacing: .16em; text-transform: uppercase;
  color: var(--brand);
}
.kc-hinweis { margin: -.35rem 0 1rem; font-size: var(--fs-sm); color: var(--muted); }

/* Antworten als große Karten */
.kc-optionen { display: grid; grid-template-columns: minmax(0, 1fr); gap: .65rem; }
@media (min-width: 640px) { .kc-optionen--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.kc-opt {
  display: flex; align-items: center; gap: .85rem;
  min-height: 56px; padding: .8rem 1.05rem;
  background: var(--surface);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--t-color), background var(--t-color), box-shadow var(--t-color);
}
.kc-opt:hover { border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); }
.kc-opt input {
  flex: 0 0 auto; width: 1.25rem; height: 1.25rem; margin: 0;
  accent-color: var(--brand); cursor: pointer;
}
.kc-opt-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.kc-opt-t { font-weight: 500; line-height: 1.35; overflow-wrap: break-word; hyphens: auto; }
.kc-opt-d { font-size: var(--fs-sm); line-height: 1.45; color: var(--muted); }

.kc-opt:has(input:checked) {
  border-color: var(--brand);
  background: var(--tint);
  box-shadow: inset 0 0 0 1px var(--brand);
}
/* Fokusring um die ganze Karte statt nur um den kleinen Knopf */
@supports selector(:has(*)) {
  .kc-opt input:focus-visible { outline: none; }
  .kc-opt:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 2px; }
}

.kc-app .kc-fehler {
  max-width: none;
  margin: 1rem 0 0; padding: .6rem .9rem;
  background: var(--tint); border-left: 4px solid var(--brand); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--brand-d); font-weight: 600; font-size: var(--fs-base-s);
}

/* Navigation */
.kc-nav {
  display: flex; flex-wrap: wrap; gap: .7rem; align-items: center;
  margin-top: clamp(1.5rem, 1.2rem + 1vw, 2rem); padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.kc-weiter { margin-left: auto; min-width: 9rem; justify-content: center; }
@media (max-width: 480px) {
  .kc-nav .btn { flex: 1 1 0; justify-content: center; min-width: 0; }
  .kc-weiter { margin-left: 0; }
}

/* ---- Ergebnis --------------------------------------------------------- */
.kc-ergebnis:focus { outline: none; }
.kc-druck-kopf { display: none; }
.kc-erg-kopf {
  background:
    radial-gradient(120% 120% at 100% 0%, #2a1113 0%, transparent 60%),
    var(--graphite);
  color: var(--on-dark);
  border-radius: var(--radius-sm);
  padding: clamp(1.25rem, 1rem + 1.5vw, 2rem);
}
.kc-erg-kicker {
  margin: 0 0 .6rem;
  font-family: var(--ff-display); font-weight: 500; font-size: var(--fs-xs);
  letter-spacing: .16em; text-transform: uppercase; color: var(--brand-l);
}
.kc-erg-kopf h2 { margin: 0 0 .5rem; color: #fff; font-size: clamp(1.5rem, 1.2rem + 1.6vw, 2.2rem); }
.kc-erg-label { display: block; font-size: var(--fs-md); font-weight: 500; color: var(--on-dark-muted); margin-bottom: .3rem; letter-spacing: 0; }
.kc-erg-kurz { margin: 0; color: var(--on-dark); font-size: var(--fs-md); max-width: 40rem; }

.kc-erg-body { margin-top: .5rem; }
.kc-erg-teil { padding: 1.35rem 0; border-bottom: 1px solid var(--line); }
.kc-erg-teil h3 { font-size: 1.15rem; margin: 0 0 .7rem; }
.kc-erg-teil p:last-child { margin-bottom: 0; }
.kc-erg-text p { max-width: var(--measure); }

/* Liste mit Häkchen (Begründung, Regeln) */
.kc-liste { list-style: none; margin: 0; padding: 0; }
.kc-liste li { position: relative; padding-left: 1.7rem; margin-bottom: .6rem; }
.kc-liste li:last-child { margin-bottom: 0; }
.kc-liste li::before {
  content: ""; position: absolute; left: .2rem; top: .42em;
  width: .45rem; height: .8rem;
  border-right: 2.5px solid var(--brand); border-bottom: 2.5px solid var(--brand);
  transform: rotate(45deg);
}

/* Karten: passend zum Alltag */
.kc-karten {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: .8rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}
.kc-karte {
  display: flex; flex-direction: column;
  background: var(--bg); border: 1px solid var(--line); border-left: 4px solid var(--brand);
  border-radius: var(--radius-sm); padding: 1.05rem 1.2rem .6rem;
}
.kc-karte-t { font-family: var(--ff-display); font-size: 1.05rem; margin: 0 0 .45rem; }
.kc-karte p { font-size: var(--fs-base-s); margin: 0 0 .4rem; }
.kc-karte-links { display: flex; flex-wrap: wrap; gap: 0 1.2rem; margin-top: auto !important; }
.kc-karte-links a {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 44px;
  font-family: var(--ff-display); font-weight: 500; text-decoration: none;
}
.kc-karte-links a::after {
  content: ""; width: 7px; height: 7px; flex: 0 0 auto;
  border-right: 2px solid currentColor; border-top: 2px solid currentColor;
  transform: rotate(45deg); transition: transform .15s ease;
}
.kc-karte-links a:hover::after { transform: translateX(3px) rotate(45deg); }

/* Förderung */
.kc-foerder { border-bottom: 0; padding-bottom: 0; }
.kc-foerder p {
  margin: 0; padding: .85rem 1.1rem;
  background: var(--tint); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
  border-radius: var(--radius-sm);
}
.kc-foerder + .kc-erg-teil { margin-top: 1.35rem; border-top: 1px solid var(--line); }

/* Nächste Schritte */
.kc-schritte { list-style: none; margin: 0; padding: 0; counter-reset: kc; }
.kc-schritte li { position: relative; counter-increment: kc; padding-left: 2.6rem; margin-bottom: .75rem; min-height: 1.8rem; }
.kc-schritte li:last-child { margin-bottom: 0; }
.kc-schritte li::before {
  content: counter(kc); position: absolute; left: 0; top: 0;
  width: 1.8rem; height: 1.8rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  font-family: var(--ff-display); font-weight: 700; font-size: var(--fs-sm);
}

/* Ihre Angaben */
.kc-dl { margin: 0; }
.kc-dl-zeile {
  display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: .25rem 1rem;
  padding: .6rem 0; border-bottom: 1px solid var(--line);
}
.kc-dl-zeile:first-child { border-top: 1px solid var(--line); }
.kc-dl dt { color: var(--muted); font-size: var(--fs-sm); }
.kc-dl dd { margin: 0; font-weight: 500; overflow-wrap: break-word; }
@media (max-width: 560px) { .kc-dl-zeile { grid-template-columns: minmax(0, 1fr); } }
.kc-angaben { border-bottom: 0; }

/* Aktionen */
.kc-aktionen { display: flex; flex-wrap: wrap; gap: .7rem; padding-top: 1.35rem; border-top: 1px solid var(--line); }
@media (max-width: 560px) {
  .kc-aktionen .btn { flex: 1 1 100%; justify-content: center; text-align: center; line-height: 1.25; }
}
.kc-speicher-hinweis { margin: 1rem 0 0; font-size: var(--fs-caption); color: var(--muted); max-width: var(--measure); }

/* ---- Regeln (auch ohne JavaScript) ----------------------------------- */
.kc-regel-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }
@media (min-width: 820px) { .kc-regel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kc-regel {
  background: var(--bg); border: 1px solid var(--line); border-top: 4px solid var(--brand);
  border-radius: var(--radius); padding: clamp(1.2rem, 1rem + 1vw, 1.75rem);
}
.kc-regel--lokal { border-top-color: var(--ink); }
.kc-regel-kicker {
  margin: 0 0 .45rem;
  font-family: var(--ff-display); font-weight: 500; font-size: var(--fs-xs);
  letter-spacing: .16em; text-transform: uppercase; color: var(--brand);
}
.kc-regel h3 { margin: 0 0 .8rem; }
.kc-regel-wenn { margin-bottom: .6rem; }
.kc-regel .kc-liste { margin-bottom: 1rem; }
.kc-regel p:last-child { margin-bottom: 0; }

.kc-regeln-zwischen { margin: clamp(2rem, 1.5rem + 1.5vw, 2.75rem) 0 .8rem; }
.kc-regel-liste { list-style: none; margin: 0; padding: 0; max-width: 52rem; }
.kc-regel-liste li { padding: .75rem 0; border-bottom: 1px solid var(--line); }
.kc-regel-liste li:first-child { border-top: 1px solid var(--line); }
.kc-regeln-cta { margin-top: 1.75rem; }

/* ---- Bewegung reduzieren ---------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .kc-bar-fill, .kc-opt, .kc-karte-links a::after { transition: none; }
}

/* ---- Druck: nur das Ergebnis ------------------------------------------
   Greift erst, wenn ein Ergebnis da ist (html.kc-fertig); vorher druckt die
   Seite normal mit den Regeln. */
@media print {
  html.kc-fertig .kc-kopf,
  html.kc-fertig .kc-regeln,
  html.kc-fertig .site-footer { display: none !important; }
  .kc-aktionen, .kc-speicher-hinweis, .kc-nav, .kc-fortschritt { display: none !important; }
  .kc-bereich { padding: 0 !important; }
  .kc-bereich .wrap { max-width: none; width: 100%; }
  .kc-app { border: 0 !important; box-shadow: none !important; padding: 0 !important; }
  .kc-druck-kopf { display: block; margin: 0 0 1rem; font-size: 9pt; color: #444 !important; }
  .kc-erg-kopf { background: #fff !important; border: 1px solid #999; }
  .kc-erg-kopf h2, .kc-erg-kopf p, .kc-erg-label { color: #000 !important; }
  .kc-erg-teil, .kc-karte, .kc-dl-zeile { break-inside: avoid; }
  .kc-karte { background: #fff !important; border-color: #bbb !important; border-left-color: #666 !important; }
  .kc-foerder p { background: #fff !important; border-color: #bbb !important; }
  .kc-schritte li::before { background: #fff !important; color: #000 !important; border: 1px solid #000; }
  .kc-liste li::before { border-color: #000 !important; }
  .kc-ergebnis a[href^="/"]::after { content: " (www.freytag360.de" attr(href) ")"; font-size: .85em; color: #444; border: 0 !important; width: auto; height: auto; transform: none !important; transition: none !important; }
  .kc-karte-links a { display: inline; min-height: 0; }
}
