/*
 * Designrichtung „Petrol & Lehm" (Canvas: Was gerade läuft - Design-Canvas/).
 * Petrol ist die einzige Farbe mit Richtung, Lehm gehört allein dem Krisenweg.
 * Alle Farben stehen hier im :root-Block — nirgends sonst.
 */

/* Schriften lokal: kein CDN, keine IP-Übertragung an Dritte (Art.-9-Nähe). */
@font-face {
  font-family: "DM Sans";
  src: url("fonts/DMSans-Variable.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("fonts/DMSans-Italic-Variable.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --font-ui: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Farben hell */
  --bg: #efebe5;
  --surface: #fbf9f6;
  --surface-accent: #e7edec;
  --text: #24302f;
  --text-secondary: #4b5654;
  --text-muted: #5b6564;
  --label: #2f4e52;
  --accent: #3f6b70;
  --on-accent: #f7f5f1;
  --accent-muted: #9fb6b5;
  --selected-text: #26383a;
  --border: #d3cdc4;
  --divider: #c9d6d5;
  --bar-empty: #dce4e3;
  --crisis-way: #e6e1d8;
  --clay: #8a6f58;

  /* Maß und Radius */
  --radius-surface: 20px;
  --radius-inner: 18px;
  --radius-tap: 16px;
  --radius-chip: 999px;
  --edge: 20px;
  --maxw: 30rem;

  /* Bewegung: nur Deckkraft und 4 px Versatz */
  --motion: 240ms ease-out;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121918;
    --surface: #1b2423;
    --surface-accent: #253433;
    --text: #e3e7e5;
    --text-secondary: #b4bdbb;
    --text-muted: #9aa5a3;
    --label: #a9c6c7;
    --accent: #7fa8aa;
    --on-accent: #10201f;
    --accent-muted: #4e7a7c;
    --selected-text: #dce7e6;
    --border: #2c3736;
    --divider: #354645;
    --bar-empty: #2c3736;
    --crisis-way: #222423;
    --clay: #c2a184;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.65 var(--font-ui);
}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
  z-index: 10;
  background: var(--surface);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-tap);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- Layout --- */

.app-main {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px var(--edge) 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-footer {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 calc(var(--edge) + 6px) 18px;
}
.app-footer p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* --- Krisenweg: auf jedem Screen unten, an derselben Stelle, in Lehm --- */

.crisis-way {
  position: sticky;
  bottom: 0;
  padding: 8px var(--edge) 18px;
  background: linear-gradient(to top, var(--bg) 75%, transparent);
}
.crisis-way-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 16px;
  border: none;
  border-radius: 14px;
  background: var(--crisis-way);
  color: var(--text-secondary);
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.crisis-way-arrow {
  color: var(--clay);
  font-size: 16px;
}
/* Auf der Krisenseite selbst gibt es nichts, wohin der Weg noch führen könnte. */
body[data-screen="crisis"] .crisis-way,
body[data-screen="acknowledge"] .crisis-way {
  display: none;
}

/* --- Typografie --- */

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

h1 {
  font-size: 25px;
  line-height: 1.25;
  font-weight: 500;
}

.display {
  font-size: 30px;
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.question-text {
  font-size: 24px;
  line-height: 1.45;
  font-weight: 500;
  padding: 0 6px;
}

p {
  color: var(--text-secondary);
}

.secondary {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}

.note {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  padding: 0 6px;
}

.label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--label);
}
.label-section {
  margin-top: 14px;
}

/* --- Flächen --- */

.surface {
  background: var(--surface);
  border-radius: var(--radius-surface);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.surface-hero {
  padding: 32px 26px;
  gap: 22px;
}

.hint {
  background: var(--surface-accent);
  border-radius: var(--radius-inner);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hint-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hint-item h3 {
  font-size: 16px;
  font-weight: 500;
  color: var(--selected-text);
}
.hint-item p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--selected-text);
}
.hint-divider {
  height: 1px;
  background: var(--divider);
}

.chips {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  font-size: 13px;
  padding: 7px 12px;
  border-radius: var(--radius-chip);
  background: var(--surface-accent);
  color: var(--label);
}

.mark {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-accent);
  border: 1px solid var(--accent-muted);
}

/* --- Tippbare Flächen --- */

.btn {
  font: inherit;
  font-size: 17px;
  line-height: 1.5;
  display: block;
  width: 100%;
  min-height: 56px;
  text-align: left;
  padding: 18px 20px;
  border-radius: var(--radius-tap);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.btn:hover {
  border-color: var(--accent-muted);
}
.btn[aria-pressed="true"] {
  background: var(--surface-accent);
  border-color: var(--accent);
  color: var(--selected-text);
}

.btn-primary {
  text-align: center;
  font-size: 18px;
  font-weight: 500;
  padding: 21px 20px;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 90%, var(--text));
  border-color: color-mix(in srgb, var(--accent) 90%, var(--text));
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-secondary {
  text-align: center;
  font-size: 16px;
  border-color: transparent;
  color: var(--text-secondary);
}
.btn-secondary:hover {
  border-color: var(--accent-muted);
}

.btn-row {
  display: flex;
  gap: 12px;
}
.btn-row .btn {
  flex: 1;
}
.btn-back {
  flex: 0 0 auto;
  width: auto;
  padding: 16px 20px;
}

.answers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

fieldset {
  border: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
legend {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

/* --- Fragebogen: Fortschritt als sechs stille Striche, keine Animation --- */

.progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}
.progress-track {
  display: flex;
  gap: 6px;
}
.progress-seg {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--bar-empty);
}
.progress-seg[data-done="true"] {
  background: var(--accent-muted);
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

/* --- Krisenseite --- */

.contact {
  background: var(--surface);
  border-radius: var(--radius-inner);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.contact-name {
  font-size: 14px;
  color: var(--text-muted);
}
.contact-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}
.contact-number {
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--label);
  text-decoration: none;
}
.contact-number:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.contact-detail {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
}
.contact-detail a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- Profil: fünf Stufen, feste Reihenfolge, Werte als Wort --- */

.motor-list {
  list-style: none;
  padding: 18px;
  background: var(--surface);
  border-radius: var(--radius-inner);
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.motor-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.motor-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.motor-name {
  font-size: 15px;
}
.motor-row[data-top="true"] .motor-name {
  font-weight: 500;
}
.motor-level {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--label);
  white-space: nowrap;
}
.segments {
  display: flex;
  gap: 4px;
}
.seg {
  width: 12px;
  height: 22px;
  border-radius: 3px;
  background: var(--bar-empty);
}
.seg[data-on="true"] {
  background: var(--accent-muted);
}
.motor-row[data-top="true"] .seg[data-on="true"] {
  background: var(--accent);
}

.pathway {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pathway h3 {
  font-size: 16px;
  font-weight: 500;
}
.pathway p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}
.pathway + .pathway {
  margin-top: 10px;
}

/* --- Bewegung --- */

@media (prefers-reduced-motion: no-preference) {
  .app-main > * {
    animation: rise var(--motion);
  }
  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(4px);
    }
  }
}

/* --- Übung: eigener Schritt und Zeitpunkt --- */

.text-input {
  font: inherit;
  font-size: 17px;
  width: 100%;
  padding: 17px 20px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-tap);
  background: var(--surface);
  color: var(--text);
}
.text-input::placeholder {
  color: var(--text-muted);
}

.chip-button {
  font: inherit;
  font-size: 15px;
  padding: 10px 14px;
  border: 1px solid transparent;
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
}
.chip-button[aria-pressed="true"] {
  background: var(--surface-accent);
  color: var(--label);
}

/* Ein Link, der aussieht wie eine tippbare Fläche — für Wege aus der Anwendung heraus. */
.btn-link-block {
  text-align: center;
  text-decoration: none;
}

/* Rechtstexte im Fuß der Anwendung. */
.app-legal {
  display: flex;
  gap: 14px;
  margin-top: 8px;
}
.app-legal a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.app-legal a:hover {
  color: var(--text);
}
