/* ==========================================================================
   NIS2-Betroffenheits-Check – Stylesheet
   Heller Apple-Stil, keine externen Ressourcen.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --surface: #f5f5f7;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0, 113, 227, 0.08);
  --line: #d2d2d7;
  --radius-card: 22px;
  --radius-option: 14px;
  --radius-pill: 980px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ---------- Layout ---------- */

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 16px 56px;
}

.intro {
  text-align: center;
  margin-bottom: 40px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

h1 {
  font-size: clamp(32px, 7vw, 48px);
}

h2 {
  font-size: clamp(24px, 5vw, 32px);
  line-height: 1.15;
}

h3 {
  font-size: 19px;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

h2:focus {
  outline: none;
}

.lead {
  margin: 16px auto 0;
  max-width: 560px;
  font-size: clamp(17px, 2.6vw, 21px);
  color: var(--text-2);
}

/* ---------- Fortschritt ---------- */

.progress {
  margin-bottom: 16px;
  transition: opacity 0.3s var(--ease);
}

.progress.is-hidden {
  display: none;
}

.progress-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
}

.progress-track {
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--line);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.45s var(--ease);
}

/* ---------- Karte / Bühne ---------- */

.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 40px 32px;
}

/* Übergang zwischen den Schritten */
.stage-enter {
  animation: stageIn 0.4s var(--ease) both;
}

.stage-leave {
  animation: stageOut 0.18s var(--ease) both;
}

@keyframes stageIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

@keyframes stageOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(-8px); }
}

@media (prefers-reduced-motion: reduce) {
  .stage-enter,
  .stage-leave {
    animation: none;
  }
  .progress-bar {
    transition: none;
  }
}

.question-hint {
  margin: 12px 0 0;
  color: var(--text-2);
}

/* ---------- Antwortoptionen ---------- */

.options {
  margin: 28px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.group-label {
  margin: 24px 0 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-3);
}

.group-label:first-child {
  margin-top: 0;
}

.option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 10px;
  padding: 16px 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-option);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s var(--ease);
}

.option:hover {
  border-color: var(--text-3);
}

/* Native Radio-Buttons visuell ersetzen, aber zugänglich lassen */
.option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.option-dot {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  transition: border-color 0.2s var(--ease), border-width 0.2s var(--ease);
}

.option-body {
  min-width: 0;
}

.option-title {
  display: block;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.option-desc {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.option.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  background: var(--bg);
}

.option.is-selected .option-dot {
  border-color: var(--accent);
  border-width: 6px;
}

.option input:focus-visible ~ .option-dot {
  outline: 3px solid rgba(0, 113, 227, 0.35);
  outline-offset: 2px;
}

/* ---------- Buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
}

.actions-result {
  justify-content: center;
  flex-direction: column;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 11px 24px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--accent);
  font: inherit;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), opacity 0.2s var(--ease), border-color 0.2s var(--ease);
}

.btn:focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.35);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
}

.btn-secondary:hover {
  background: var(--accent-soft);
}

/* "Zurück" als ruhiger Textlink */
.btn-link {
  border-color: transparent;
  background: transparent;
  color: var(--accent);
  padding-left: 4px;
  padding-right: 4px;
}

.btn-link:hover {
  text-decoration: underline;
}

.btn-link[hidden] {
  display: none;
}

.actions .btn-primary {
  margin-left: auto;
}

.actions-result .btn {
  margin: 0;
  width: 100%;
  max-width: 380px;
}

/* ---------- Ergebnis ---------- */

.result-badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
}

.result-title {
  font-size: clamp(26px, 5.4vw, 36px);
}

/* betroffen: kräftig, Akzentblau */
.result--affected .result-badge {
  background: var(--accent);
  color: #ffffff;
}

.result--affected .result-title {
  color: var(--accent);
}

/* Einzelfall: neutral */
.result--review .result-badge {
  background: var(--text);
  color: #ffffff;
}

.result--review .result-title {
  color: var(--text);
}

/* nicht betroffen: dezent */
.result--clear .result-badge {
  background: var(--bg);
  color: var(--text-2);
  border: 1px solid var(--line);
}

.result--clear .result-title {
  color: var(--text-2);
}

.result-reason {
  margin: 16px 0 0;
  color: var(--text);
}

.result-summary {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.result-summary li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.result-summary .k {
  color: var(--text-2);
}

.result-summary .v {
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

.steps-title {
  margin-top: 36px;
}

.steps {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  counter-increment: step;
  margin-top: 10px;
  padding: 16px 18px 16px 58px;
  background: var(--bg);
  border-radius: var(--radius-option);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 18px;
  top: 16px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  line-height: 26px;
  text-align: center;
}

.steps strong {
  display: block;
  font-weight: 600;
}

.steps span {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  color: var(--text-2);
}

.disclaimer {
  margin-top: 32px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--text-3);
  border-radius: var(--radius-option);
  background: var(--bg);
  font-size: 15px;
  color: var(--text);
}

.disclaimer strong {
  font-weight: 600;
}

/* ---------- Vertrauenshinweis ---------- */

.trust {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  margin: 24px auto 0;
  max-width: 520px;
  font-size: 13px;
  color: var(--text-3);
  text-align: left;
}

.trust-icon {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  fill: var(--text-3);
}

/* ---------- Kleine Bildschirme ---------- */

@media (max-width: 600px) {
  .page {
    padding-top: 40px;
  }

  .intro {
    margin-bottom: 28px;
  }

  .card {
    padding: 28px 20px;
  }

  .option {
    padding: 14px 14px;
    gap: 12px;
  }

  .steps li {
    padding: 14px 14px 14px 52px;
  }

  .steps li::before {
    left: 14px;
    top: 14px;
  }

  .result-summary .v {
    text-align: left;
  }
}

@media (max-width: 400px) {
  /* Fragebogen: "Weiter" oben, "Zurück" darunter */
  .actions:not(.actions-result) {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .actions .btn-primary {
    margin-left: 0;
  }
}
