:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #0f4c81;
  --primary-hover: #0a355c;
  --brand-orange: #FFB12E;
  --brand-orange-hover: #e59a1c;
  --brand-orange-soft: #fff7e8;
  --accent-bg: #eef5fc;
  --border: #e2e8f0;
  --error: #b91c1c;
  --radius: 12px;

  /* Verbindliche be-relevant Reifegradfarben */
  --level-exploring: #1A5474;
  --level-experimenting: #32808C;
  --level-established: #898C43;
  --level-transformative: #CE7913;
  --active-level-color: var(--primary);
  --active-level-soft: var(--accent-bg);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.app-header {
  text-align: center;
  margin-bottom: 2rem;
}

.badge {
  display: inline-block;
  background: var(--brand-orange-soft);
  color: var(--text);
  border: 1px solid var(--brand-orange);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

h1 { font-size: 1.85rem; margin: 0 0 0.5rem; line-height: 1.25; }
h2 { font-size: 1.3rem; margin-top: 0; }
.subtitle { color: var(--muted); margin: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  margin-bottom: 1.25rem;
}

.hidden { display: none !important; }

.hint {
  font-size: 0.88rem;
  color: var(--muted);
  background: #f8fafc;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border-left: 3px solid var(--brand-orange);
}

.progress-wrapper { margin-bottom: 1.5rem; }
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--brand-orange);
  width: 0%;
  transition: width 0.25s ease;
}

.question-instruction { color: var(--muted); font-size: 0.9rem; margin-top: -0.5rem; }

.answers-list { display: flex; flex-direction: column; gap: 0.75rem; margin: 1.25rem 0; }

.answer-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.answer-option:hover { border-color: var(--brand-orange); background: #fffdf8; }
.answer-option.selected { border-color: var(--brand-orange); background: var(--brand-orange-soft); }
.answer-option input { margin-top: 0.25rem; accent-color: var(--primary); }

.freetext-wrapper { margin-top: 1rem; }
.freetext-wrapper label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.35rem; }
.freetext-wrapper input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
}

.error-msg { color: var(--error); font-size: 0.9rem; font-weight: 500; }

.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 1.75rem;
  gap: 1rem;
}

.btn {
  padding: 0.75rem 1.4rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  display: inline-block;
}

.btn-primary { background: var(--brand-orange); color: var(--text); }
.btn-primary:hover:not(:disabled) { background: var(--brand-orange-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-secondary:hover { background: #cbd5e1; }

/* Reifegrad-Farbzuordnung */
.level-exploring {
  --active-level-color: var(--level-exploring);
  --active-level-soft: rgba(26, 84, 116, 0.10);
}

.level-experimenting {
  --active-level-color: var(--level-experimenting);
  --active-level-soft: rgba(50, 128, 140, 0.10);
}

.level-established {
  --active-level-color: var(--level-established);
  --active-level-soft: rgba(137, 140, 67, 0.12);
}

.level-transformative {
  --active-level-color: var(--level-transformative);
  --active-level-soft: rgba(206, 121, 19, 0.12);
}

.card[class*="level-"] {
  border-left: 5px solid var(--active-level-color);
}

.card[class*="level-"] .hint {
  border-left-color: var(--active-level-color);
}

.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--active-level-color);
  background: var(--active-level-soft);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.score-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--active-level-color);
  display: inline-block;
}

.level-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--active-level-color);
  margin: 0.25rem 0;
}

/* 4-Balken-Profil-Visualisierung */
.dim-bars {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin: 1.25rem 0 1.5rem;
}

.dim-bar-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.dim-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.92rem;
}

.dim-bar-name {
  font-weight: 600;
  color: var(--text);
}

.dim-bar-meta {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--active-level-color, var(--muted));
  white-space: nowrap;
}

.dim-bar-track {
  height: 10px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.dim-bar-fill {
  height: 100%;
  background: var(--active-level-color, var(--muted));
  border-radius: 999px;
  transition: width 0.35s ease;
}

.sub-card { background: #f8fafc; padding: 1rem; border-radius: 8px; margin-top: 0.75rem; border: 1px solid var(--border); }
.tag { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--primary); }
.cta-card { background: var(--brand-orange-soft); border-color: var(--brand-orange); }
.result-footer { text-align: center; margin-top: 1.5rem; }
