/* ============================================================================
   DESIGN SYSTEM – Hinweise

   Verbindliche Werte stehen in den :root-Variablen und den Selektoren.
   Dieser Kommentar enthält bewusst keine Komponentenwerte.

   Gestaltung: eckige Ecken als Standard (kein border-radius).
   Ausnahmen: Pill-Buttons, runde Badges und Radio-Kreise sowie
   einzelne bewusste Abweichungen, die direkt im jeweiligen
   Selektor stehen.

   CI-Farben: --navy #000058, --blue-open #00D5DC,
   --blue-digital #0025D1, --offwhite #F7F7F9.
   Farb- und Kontrastentscheidungen sollen gegen die Salesfive-CI geprüft werden.
   ============================================================================ */

:root {
  --blue-digital: #0025D1;
  --blue-open: #00D5DC;
  --black: #000000;
  --white: #FFFFFF;
  --ink: #323232;
  --muted: #898989;
  --line: #DDDDE5;
  --offwhite: #F7F7F9;
  --radius-sm: 0px;
  --radius-lg: 0px;
  --radius-pill: 9999px;
  --option-badge-bg: #E8F0FF;
  --dot-dim-opacity: 0.65;

  /* Dunkles Theme (Intro, Fragen, E-Mail-Formular) */
  --navy: #000058;
  --error: #FF8A8A;
  --placeholder: #767676;
  --text-muted: rgba(255, 255, 255, 0.85);
  --text-subtle: rgba(255, 255, 255, 0.75);
  --line-on-dark: rgba(255, 255, 255, 0.15);
  --track-empty: rgba(255, 255, 255, 0.2);
  --bar-height: 4px; /* Fortschrittsbalken (Fragen) und Dimensionsbalken (Ergebnis) */
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

/* Im CMS bestimmt die Website die iFrame-Höhe (Embed-Protokoll), eine eigene
   Scrollbar wird nicht gebraucht. */
html.sized-by-website {
  overflow: hidden;
  scrollbar-gutter: auto;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--offwhite);
  color: var(--ink);
  line-height: 1.5;
}

.page {
  position: relative;
  max-width: none;
  width: 100vw;
  margin: 0;
  padding: 48px 24px 80px;
  background-color: var(--navy);
  overflow: hidden;
  margin-left: calc(-50vw + 50%);
}


.card {
  max-width: 1000px;
  margin: 0 auto;
  background: transparent;
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}

/* Global Dot Cloud – Background pattern layer */
#page-dot-cloud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  display: block;
}

.intro-screen,
#screen-question,
#screen-result,
#screen-email {
  position: relative;
  z-index: 1;
  overflow: hidden;
}

/* Dot-Cloud Dimming Layer (auf der Stage, damit er beim Wechsel Intro/Fragen nicht flackert) */
.stage::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 88, var(--dot-dim-opacity)); /* = --navy mit Deckkraft */
  pointer-events: none;
  z-index: -1;
  mask-image: radial-gradient(
    ellipse 120% 120% at 50% 50%,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 1) 60%,
    rgba(0, 0, 0, 0) 100%
  );
}

#screen-question {
  overflow: visible;
  position: relative;
}

#screen-intro {
  overflow: visible;
}

#screen-result {
  overflow: visible;
}

/* Fokusringe (Outline + Offset) ragen über die Feldkante hinaus und würden sonst
   abgeschnitten; .card übernimmt das Beschneiden am Rand. */
#screen-email {
  overflow: visible;
}

/* Question Screen – Allow SVG to extend beyond card bounds */
.card.intro-card {
  overflow: visible;
}

/* Stage-Screens (Intro, Fragen) und Ergebnis: breitere Card, damit die Cloud größer wird */
.card.intro-card.is-stage {
  max-width: 1200px;
}

/* Question Header – Category Badge + Question Text (full width) */
.question-header {
  margin-bottom: 32px;
  padding: 0;
}

.question-header .question-text {
  margin: 0 0 40px;
}

/* Stage – gemeinsame Zwei-Spalten-Bühne (60/40) für Intro + Fragen.
   Das Canvas steht dauerhaft in .stage-right; Zeile 1 (Fortschritt) hat auf
   Intro und Fragen dieselbe Höhe, daher bleibt die Canvas-Position identisch. */
.stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  grid-template-areas:
    "progress progress"
    "left right";
  gap: 0 64px;
  max-width: 1080px;
  margin: 0 auto;
  align-items: start;
}

.stage-progress {
  grid-area: progress;
}

.stage-left {
  grid-area: left;
  position: relative;
  z-index: 2;
  min-width: 0;
}

.stage-right {
  grid-area: right;
  position: relative;
  z-index: 1;
  min-width: 0;
}

.stage-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1400 / 900;
}

.stage-canvas-wrap .readiness-signature-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
}

/* Intro: Fortschritt unsichtbar, aber Platz bleibt reserviert */
.stage[data-mode="intro"] .stage-progress {
  visibility: hidden;
}

/* E-Mail / Bestätigung / Ergebnis: Stage belegt keinen Platz mehr, Canvas-Wrapper
   behält seine Größe und wird nur per visibility/opacity ausgeblendet (nie display: none) */
.stage[data-mode="parked"] {
  height: 0;
  pointer-events: none;
}

.stage[data-mode="parked"] .stage-progress {
  display: none;
}

.stage[data-mode="parked"] .stage-canvas-wrap {
  opacity: 0;
  visibility: hidden;
}

/* Mobil: Stage stapelt, Canvas oben und kompakt */
@media (max-width: 767px) {
  .stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "right"
      "progress"
      "left";
    gap: 0;
  }

  .stage-right {
    width: 100%;
    max-width: 320px;
    margin: 0 auto 24px;
  }

  .stage[data-mode="intro"] .stage-progress {
    display: none;
  }

  /* Mobile Reihenfolge rein per CSS (kein DOM-Move): die Spalten-Container lösen sich
     auf, ihre Kinder werden direkte Grid-Items der Stage und per order sortiert.
     Intro:  Dachzeile, H1, Cloud, Text/Button
     Fragen: Fortschritt, Cloud, Frage/Antworten/Navigation */
  .stage {
    grid-template-areas: none;
  }

  .stage-left,
  #screen-intro,
  #screen-question,
  .intro-content {
    display: contents;
  }

  .stage-progress,
  .stage-right {
    grid-area: auto;
  }

  .stage-progress,
  .intro-content > .eyebrow {
    order: 1;
  }

  .intro-content > h1 {
    order: 2;
  }

  .stage-right {
    order: 3;
  }

  .intro-content > p,
  .intro-content > button,
  .question-header,
  #screen-question > .options,
  #screen-question > .nav-row {
    order: 4;
  }

  #screen-intro .btn-primary {
    justify-self: start;
  }

  .question-header .question-text {
    font-size: 18px;
    line-height: 1.4;
  }
}

.intro-content {
  position: relative;
  z-index: 2;
}

@media (max-width: 600px) {
  .card {
    padding: 28px;
  }

  .page {
    padding: 32px 16px 60px;
  }
}

.eyebrow {
  color: var(--blue-open);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

h1 {
  font-weight: 400;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 0 0 24px;
  color: var(--white);
}

p.intro {
  color: var(--white);
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 32px;
}

p.intro.intro-lead {
  margin-bottom: 1.5em;
}

.progress-wrap {
  margin-bottom: 40px;
  position: relative;
  z-index: 2;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  color: var(--white);
  margin-bottom: 12px;
  font-weight: 500;
}

.progress-track {
  height: 8px;
  background: #E5E5E8;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--blue-open);
  transition: width 0.3s ease;
  width: 0%;
}

/* Question Dimension (Zeile über dem Fortschrittsbalken, ohne Icon) */
.question-dimension {
  color: var(--white);
  font-weight: 700;
  font-size: 16px;
}

.question-text {
  font-size: 22px;
  line-height: 1.4;
  margin: 0 0 40px;
  color: var(--white);
  font-weight: 500;
  position: relative;
  z-index: 2;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
  position: relative;
  z-index: 2;
}

.option {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border: 2px solid #E5E5E8;
  border-radius: 9999px;
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  text-align: left;
  font-family: Arial, sans-serif;
  position: relative;
  overflow: hidden;
}

.option:hover:not(.selected) {
  border-color: var(--blue-digital);
  background: #F4F7FF;
}

.option::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 200px;
  height: 200%;
  background: linear-gradient(
    110deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.75) 40%,
    rgba(255, 255, 255, 0.75) 60%,
    rgba(255, 255, 255, 0)
  );
  transform: skewX(-25deg);
  pointer-events: none;
  transition: left 1.5s ease;
  z-index: 1;
}

.option:hover:not(.selected)::before {
  left: 100%;
}

.option:focus-visible {
  outline: 2px solid var(--blue-digital);
  outline-offset: 2px;
}

.option.selected {
  border-color: var(--blue-digital);
  background: #E8F0FF;
}

.option-badge {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  background: var(--option-badge-bg);
  border-radius: 50%;
  border: none;
  margin: 6px 12px;
  position: relative;
  z-index: 2;
}

.option.selected .option-badge {
  background: var(--blue-digital);
  color: var(--white);
}

.option-content {
  flex: 1;
  padding: 12px 20px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.option-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--black);
}

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
}

/* Responsive: Buttons stacked on narrow viewports (Breakpoint: 620px ensures reliable wrapping even with "Ergebnis anzeigen") */
@media (max-width: 620px) {
  .nav-row {
    flex-direction: column-reverse;
    gap: 14px;
  }

  .nav-row .btn {
    width: 100%;
    justify-content: center;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font-family: Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity 0.15s ease, transform 0.05s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

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

.btn-primary {
  background: var(--blue-digital);
  color: var(--white);
}

.btn-primary:hover:not(:disabled) {
  background: var(--blue-open);
  color: var(--black);
  opacity: 1;
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
  border-width: 2px;
}

.btn-outline:hover:not(:disabled) {
  background: var(--white);
  color: var(--blue-digital);
}

.btn:focus-visible {
  outline: 2px solid var(--blue-digital);
  outline-offset: 2px;
}

/* Result screen */
.result-head {
  margin-bottom: 48px;
}

.result-head .eyebrow {
  font-size: 14px;
  margin-bottom: 12px;
}

.result-head h1 {
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
}

/* Ergebnis-Box: zwei gleich breite Zellen, ohne Rahmen und Trennlinie */
.result-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 64px;
  color: var(--white);
}

.result-box-cell {
  min-width: 0;
  background: #000058;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Erste Zeile beider Zellen: gleiche Höhe, Inhalt mittig, damit Pill und Signatur-Titel auf einer Achse liegen */
.result-box-top {
  display: flex;
  align-items: center;
  min-height: 32px;
}

/* Linke Zelle bündig mit Headline */
.result-box-cell:first-child {
  padding-left: 0;
}

.result-status-badge {
  background: var(--blue-open);
  color: var(--black);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin: 0;
}

.result-score-line {
  display: flex;
  color: var(--white);
}

.result-score-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.result-score-main {
  font-size: 120px;
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.result-score-max {
  font-size: 28px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
}

/* Stufenbalken durchgehend (ohne Lücken) */
.result-levels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px 0;
}

.result-level {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-level-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
}

.result-level.is-filled .result-level-bar {
  background: var(--blue-open);
}

.result-level-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.result-level.is-current .result-level-label {
  font-weight: 700;
  color: var(--white);
}

.result-status-block {
  --result-note-shift: 16px; /* Postfach-Hinweis rückt um diesen Wert nach unten, der Abstand unter dem Block schrumpft um denselben Wert */
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 8px;
}

.result-status-heading,
.result-col-title {
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--white);
  margin: 0;
}

.result-status-heading {
  font-size: 24px;
  line-height: 1.25;
}

.result-col-title {
  font-size: 28px;
  line-height: 1.3;
  margin-bottom: 24px;
}

.result-status-desc {
  font-size: 16px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

.result-signature-slot {
  position: relative;
  width: 100%;
  aspect-ratio: 1400 / 900;
}

.result-signature-slot .readiness-signature-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
}

/* Profil + Handlungsfelder */
.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 64px;
  align-items: start;
  margin-bottom: 64px;
  color: var(--white);
}

.result-col {
  min-width: 0;
}

/* Aufbau wie .result-whitepaper: ein Absatz, der PDF-Link steht inline hinter dem Satz */
/* Gleicher Betrag wieder abziehen, damit die Höhe von .result-box gleich bleibt (nur Bildschirm, im Druck ist der Hinweis ausgeblendet) */
@media screen {
  .result-status-block {
    margin-bottom: calc(-1 * var(--result-note-shift));
  }
}

.result-mail-note {
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  margin: calc(12px + var(--result-note-shift)) 0 0; /* + 12px Gap in .result-status-block = 24px + Shift unter der Beschreibung */
  text-align: left;
}

.result-rows {
  display: flex;
  flex-direction: column;
}

.result-row {
  display: grid;
  grid-template-columns: 130px 1fr 36px;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.result-row-name {
  font-size: 15px;
  font-weight: 700;
}

.result-row-bar-track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.result-row-seg {
  height: var(--bar-height);
  background: rgba(255, 255, 255, 0.18);
}

.result-row-seg.is-filled {
  background: var(--blue-open);
}

.result-row-score {
  font-size: 14px;
  text-align: right;
  color: rgba(255, 255, 255, 0.8);
}

.result-todos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-todo {
  background: var(--white);
  color: var(--black);
  padding: 24px;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
}

.result-todo-num {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--blue-digital);
}

.result-todo-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-todo-title {
  font-size: 16px;
}

.result-todo-text {
  font-size: 15px;
  line-height: 1.5;
}

.result-whitepaper {
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  margin: 24px 0 0;
}

.result-whitepaper-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue-open);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.result-whitepaper-link:hover .result-whitepaper-text {
  text-decoration: underline;
}

/* CTA-Box */
.result-cta {
  background: var(--blue-digital);
  color: var(--white);
  padding: 48px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.result-cta-heading {
  font-weight: 400;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--white);
  margin: 0;
}

.result-cta-text {
  font-size: 16px;
  line-height: 1.55;
  max-width: 720px;
  margin: 0 0 20px;
}

.result-cta-btn {
  background: var(--white);
  color: var(--blue-digital);
  font-size: 16px;
  padding: 16px 28px;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease, transform 0.05s ease;
}

.result-cta-btn:hover,
.result-cta-btn:focus-visible {
  background: var(--blue-open);
  color: var(--black);
}

@media (max-width: 767px) {
  .result-head h1 {
    font-size: 32px;
  }

  .result-box,
  .result-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .result-box {
    margin-bottom: 48px;
  }

  .result-grid {
    gap: 48px;
    margin-bottom: 48px;
  }

  .result-box-cell {
    padding: 24px;
  }

  .result-box-cell {
    padding-left: 0;
  }

  .result-score-main {
    font-size: 88px;
  }

  .result-cta {
    padding: 32px 24px;
  }

  .result-row {
    grid-template-columns: 96px 1fr 36px;
  }
}

/* Email step */
.email-step {
  text-align: center;
}

.email-step h2 {
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -0.03em;
  margin: 0 0 40px;
  color: var(--white);
}

@media (max-width: 620px) {
  .email-step h2 {
    margin-bottom: 32px;
  }
}

/* Email Form Card – per Design System */
.email-form-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  max-width: 400px;
  margin: 0 auto;
}

.email-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Formularfeld-Beschriftung */
.field-label {
  font-weight: 700;
}

input[type="email"],
input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: Arial, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--white);
}

input[type="email"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--blue-digital);
  box-shadow: 0 0 0 3px rgba(0, 37, 209, 0.12);
}

.error-msg {
  color: #C0132B;
  font-size: 13px;
  text-align: left;
  display: none;
}

/* Fokus: Digital-Blue-Ring wäre auf dunklem Grund unsichtbar, daher Open Blue */
#screen-email input:focus {
  border-color: var(--blue-open);
  box-shadow: 0 0 0 3px rgba(0, 213, 220, 0.5);
}

/* "Abbrechen"-Textlink unter dem Absenden-Button */
.email-cancel {
  align-self: stretch;
  padding: 0;
  border: 0;
  background: none;
  font-family: Arial, sans-serif;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
}

.email-cancel:focus-visible {
  outline: 2px solid var(--blue-open);
  outline-offset: 2px;
}

/* Loading spinner animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none !important;
}

.step-count {
  font-size: 14px;
  color: var(--white);
  font-weight: 500;
}

.step-current {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.step-total {
  font-size: 14px;
}

/* Accessibility: Skip-to-content link (optional, not visible by default) */
/* ============================================================================
   READINESS SIGNATURE CANVAS (WebGL Animation)
   ============================================================================ */

.readiness-signature-canvas {
  display: block;
  width: 90%;
  height: 480px;
  max-width: 900px;
  min-width: 480px;
  margin: 0 auto 32px;
  background: transparent;
  border-radius: 0;
}


/* Tablet: Adaptive Größe */
@media (max-width: 900px) {
  .readiness-signature-canvas {
    width: 85%;
    height: 400px;
    min-width: 400px;
  }
}

/* Mobile: Adaptive Größe */
@media (max-width: 600px) {
  .readiness-signature-canvas {
    width: 80%;
    height: 300px;
    min-width: 300px;
    margin: 0 auto 24px;
  }
}

/* ============================================================================
   EMAIL SCREEN: BUTTON BAR STYLING
   ============================================================================ */

.email-button-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: fit-content;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* Responsive: Stack buttons vertically on narrow viewports (ca. 620px breakpoint) */
@media (max-width: 620px) {
  .email-button-row {
    width: 100%;
    gap: 16px;
  }

  .email-button-row .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================================
   E-MAIL-FORMULAR: DESKTOP (>= 768px)
   Formular nutzt die volle Inhaltsbreite, linksbündig; "Abbrechen" rechts in der
   Button-Zeile. Mobil (< 768px) bleibt unverändert.
   ============================================================================ */
@media (min-width: 768px) {
  .email-step h2 {
    text-align: left;
  }

  /* Die Headline bestimmt die Breite; das Formular trägt nichts zur Breite bei
     (contain: inline-size) und füllt dann genau diese Breite */
  .email-step-inner {
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
  }

  .email-form-card {
    max-width: none;
    margin: 0;
    contain: inline-size;
  }

  .email-button-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .email-cancel {
    align-self: auto;
  }
}


/* ============================================================================
   DUNKLES THEME: Intro, Fragen, E-Mail-Formular (nach design-referenz-start-fragen-formular)
   Alles auf .stage / .intro-content / #screen-question / #screen-email gescoped,
   damit die Ergebnisseite unverändert bleibt.
   ============================================================================ */

/* --- Buttons (nur Stage + E-Mail): 16px / 400, 1px transparenter Rand wird per Padding ausgeglichen --- */
.stage .btn,
#screen-email .btn {
  font-size: 16px;
  font-weight: 400;
}

.stage .btn-primary,
#screen-email .btn-primary {
  padding: 15px 28px;
}

.stage .btn:focus-visible,
#screen-email .btn:focus-visible {
  outline-color: var(--blue-open);
}

/* --- Intro --- */
.intro-content .eyebrow {
  font-size: 14px;
  letter-spacing: 0;
  margin-bottom: 28px;
}

.intro-content h1 {
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 28px;
  text-wrap: balance;
}

.intro-content p.intro {
  font-size: 17px;
  line-height: 1.6;
  margin: 0 0 36px;
  text-wrap: pretty;
}

.intro-content p.intro.intro-lead {
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* --- Fragen: Kopfzeile --- */
.stage .question-dimension {
  color: var(--blue-open);
  font-size: 14px;
}

.stage .step-count {
  color: var(--text-subtle);
  font-weight: 400;
}

.stage .step-current {
  color: var(--white);
}

.stage .progress-wrap {
  margin-bottom: 56px;
}

.stage .progress-label {
  margin-bottom: 16px;
}

/* --- Fortschritt: durchgehender Balken, 4px, eckig (Füllung wird per JS gesetzt) --- */
.stage .progress-track {
  height: var(--bar-height);
  background: var(--track-empty);
  border-radius: 0;
}

.stage .progress-fill {
  background: var(--blue-open);
}

/* --- Fragen: Text + Antwortkarten --- */
#screen-question .question-text {
  font-weight: 400;
}

/* Antwortgruppe: dunkler Navy-Container, eckig. Optionen: Radio-Kreis + Text. */
#screen-question {
  --ans-bg: #0B0E5E;
  --ans-bg-hover: #1B216B;
  --ans-bg-selected: #172472;
  --ans-radio: #9BA3C4;
  --ans-pad: 20px;
  --ans-radio-size: 24px;
  --ans-font: 17px;
}

#screen-question .options {
  gap: 12px;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

#screen-question .option {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 62px;
  padding: 12px var(--ans-pad) 12px var(--ans-pad);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--ans-bg);
  color: var(--white);
  font-family: Arial, sans-serif;
  font-size: var(--ans-font);
  font-weight: 400;
  text-align: left;
  transition: background-color 150ms ease;
}

#screen-question .option::before {
  display: none;
}

@media (hover: hover) {
  #screen-question .option:hover:not(.selected) {
    background: var(--ans-bg-hover);
  }
}

#screen-question .option:focus-visible {
  outline: 2px solid var(--blue-open);
  outline-offset: 2px;
}

#screen-question .option.selected {
  background: var(--ans-bg-selected);
  color: var(--white);
  font-weight: 700;
}

/* Radio-Kreis (ersetzt die Zahlen-Badges; Wert bleibt in script.js) */
#screen-question .option-badge,
#screen-question .option.selected .option-badge {
  flex: 0 0 var(--ans-radio-size);
  align-self: center;
  width: var(--ans-radio-size);
  height: var(--ans-radio-size);
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ans-radio);
  box-sizing: border-box;
}

/* Ausgewählt: türkiser Ring, dunkler Zwischenraum, türkiser Punkt */
#screen-question .option.selected .option-badge {
  background: radial-gradient(circle, var(--blue-open) 0 32%, var(--ans-bg-selected) 34% 58%, var(--blue-open) 60% 100%);
}

#screen-question .option-content {
  flex: 1;
  padding: 0;
}

#screen-question .option-label {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

@media (max-width: 620px) {
  #screen-question {
    --ans-pad: 16px;
    --ans-radio-size: 20px;
  }

  #screen-question .options {
    gap: 10px;
  }

  #screen-question .option {
    align-items: flex-start;
    gap: 14px;
    min-height: 54px;
    padding: 14px var(--ans-pad);
  }

  #screen-question .option-badge,
  #screen-question .option.selected .option-badge {
    align-self: flex-start;
  }
}

#screen-question .nav-row {
  margin-top: 0;
}

/* --- E-Mail-Formular --- */
#screen-email {
  text-align: left;
}

#screen-email .email-step-inner {
  width: 100%;
  max-width: 720px;
}

#screen-email .email-form-card {
  max-width: none;
  contain: none;
}

#screen-email .email-step-heading {
  font-size: clamp(30px, 5vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 40px;
  text-wrap: balance;
}

/* Abstand zum Formular (vormals von der Subline getragen) */
@media (max-width: 600px) {
  #screen-email .email-step-heading {
    margin-bottom: 28px;
  }
}

#screen-email .email-form {
  gap: 24px;
}

.form-name-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 24px;
}

/* E-Mail-Formular auf dunklem Hintergrund: Beschriftungen/Hinweise weiß, Felder bleiben weiß */
#screen-email .field-label {
  display: block;
  text-align: left;
  color: var(--white);
  font-size: 14px;
  margin-bottom: 8px;
}

#screen-email input[type="text"],
#screen-email input[type="email"] {
  height: 52px;
  padding: 0 16px;
  font-size: 16px;
  border: 2px solid var(--white);
  border-radius: 0;
  background: var(--white);
  color: var(--black);
}

#screen-email input::placeholder {
  color: var(--placeholder);
}

#screen-email input:focus {
  border-color: var(--blue-open);
  box-shadow: none;
}

/* Eingabefelder im E-Mail-Schritt: bei Fokus nur ein Ring (Outline), Rahmen im Normalzustand */
#screen-email input:focus-visible {
  border-color: var(--white);
  outline: 2px solid var(--blue-open);
  outline-offset: 2px;
  box-shadow: none;
}

/* Buttons im E-Mail-Schritt: sichtbarer Fokusring bleibt */
#screen-email .btn:focus-visible,
#screen-email .email-cancel:focus-visible {
  outline: 2px solid var(--blue-open);
  outline-offset: 2px;
}

/* Fragenüberschrift erhält per Script den Fokus; kein interaktives Element, daher ohne Ring */
#q-text:focus {
  outline: none;
}

#screen-email .error-msg {
  color: var(--error);
  margin-top: 8px;
}

.error-msg.is-visible {
  display: block;
}

/* Hinweisvariante (z. B. Private-E-Mail): weiß statt Fehlerfarbe */
#screen-email .error-msg.error-msg--hint {
  color: var(--white);
}

/* Feld im Fehlerzustand; Spezifität übersteuert die Attribut-Selektoren oben */
#screen-email input.input-error,
#screen-email input.input-error:focus,
#screen-email input.input-error:focus-visible {
  border-color: var(--error);
}

/* Anrede: Radiogruppe ohne Boxen, nur Kreis + Text in einer Reihe */
#screen-email .salutation-group {
  --sal-radio: #9BA3C4;
  --sal-radio-hover: var(--white);
  --sal-selected-bg: #172472;
  --sal-radio-size: 24px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

#screen-email .salutation-group legend {
  float: left;
  width: 100%;
  padding: 0;
}

#screen-email .salutation-options {
  clear: both;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: flex-start;
}

#screen-email .salutation-option {
  position: relative;
}

#screen-email .salutation-option label {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0 0 calc(var(--sal-radio-size) + 12px);
  color: var(--white);
  font-family: Arial, sans-serif;
  font-size: 17px;
  cursor: pointer;
}

/* Natives Radio als Kreis-Indikator, links im Label; Klicks gehen an das Label */
#screen-email .salutation-option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: var(--sal-radio-size);
  height: var(--sal-radio-size);
  margin: 0;
  border: 2px solid var(--sal-radio);
  border-radius: 50%;
  background: var(--sal-radio);
  box-sizing: border-box;
  pointer-events: none;
}

@media (hover: hover) {
  #screen-email .salutation-option:hover input:not(:checked) {
    border-color: var(--sal-radio-hover);
  }
}

/* Ausgewählt: türkiser Ring, dunkler Zwischenraum, türkiser Punkt (wie Antwort-Karten) */
#screen-email .salutation-option input:checked {
  border: 0;
  background: radial-gradient(circle, var(--blue-open) 0 32%, var(--sal-selected-bg) 34% 58%, var(--blue-open) 60% 100%);
}

#screen-email .salutation-option input:focus-visible {
  outline: 2px solid var(--blue-open);
  outline-offset: 2px;
}

/* Fehlerzustand: nur der Kreisrahmen der nicht gewählten Optionen wird rot */
#screen-email .salutation-group.input-error .salutation-option input:not(:checked),
#screen-email .salutation-group.input-error .salutation-option:hover input:not(:checked) {
  border-color: var(--error);
}

/* Formularüberschrift erhält per Script den Fokus; kein interaktives Element, daher ohne Ring */
#screen-email .email-step-heading:focus {
  outline: none;
}

/* Submit-Fehlerbox über dem Formular */
.form-alert {
  background: #f5e6e8;
  border: 1px solid #C0132B;
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 16px;
  color: #C0132B;
  font-size: 14px;
}

/* Spinner im Absende-Button */
.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
}

/* Aktionen (ohne Trennlinie); Abstand zur Checkbox kommt aus margin-top */
#screen-email .email-button-row {
  width: 100%;
  margin-top: 8px;
  padding-top: 0;
}

#screen-email .email-cancel {
  font-size: 15px;
  color: var(--text-muted);
  text-decoration: none;
}

#screen-email .email-cancel:hover {
  color: var(--blue-open);
}

@media (min-width: 621px) and (max-width: 767px) {
  #screen-email .email-button-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }

  #screen-email .email-cancel {
    align-self: auto;
  }
}

#screen-email .privacy-note,
#screen-email .consent-option label {
  text-align: left;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-subtle);
  text-wrap: pretty;
}

#screen-email .privacy-note {
  margin: 0 0 -8px; /* Formular-gap 24px minus 8px = ca. 16px bis zur Checkbox */
}

#screen-email .privacy-note a,
#screen-email .consent-option a {
  color: var(--text-subtle);
  text-decoration: underline;
}

#screen-email .privacy-note a:hover,
#screen-email .consent-option a:hover {
  color: var(--blue-open);
}

#screen-email .privacy-note a:focus-visible,
#screen-email .consent-option a:focus-visible {
  outline: 2px solid var(--blue-open);
  outline-offset: 2px;
}

/* Einwilligungs-Checkbox: gleicher Look wie die Anrede, aber eckig; ganze Zeile klickbar */
#screen-email .consent-option {
  --sal-radio: #9BA3C4;
  --sal-radio-hover: var(--white);
  --sal-selected-bg: #172472;
  --sal-radio-size: 24px;
  position: relative;
}

#screen-email .consent-option label {
  display: block;
  padding-left: calc(var(--sal-radio-size) + 12px);
  cursor: pointer;
}

#screen-email .consent-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  left: 0;
  top: 0;
  width: var(--sal-radio-size);
  height: var(--sal-radio-size);
  margin: 0;
  border: 2px solid var(--sal-radio);
  border-radius: 0;
  background: var(--sal-radio);
  box-sizing: border-box;
  pointer-events: none;
}

@media (hover: hover) {
  #screen-email .consent-option:hover input:not(:checked) {
    border-color: var(--sal-radio-hover);
  }
}

/* Ausgewählt: türkiser Rahmen, dunkle Füllung, türkises Häkchen */
#screen-email .consent-option input:checked {
  border-color: var(--blue-open);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5.5 12.5l4.2 4.2 8.8-9.4' fill='none' stroke='%2300D5DC' stroke-width='2.6' stroke-linecap='square'/%3E%3C/svg%3E")
    center / 100% 100% no-repeat,
    var(--sal-selected-bg);
}

#screen-email .consent-option input:focus-visible {
  outline: 2px solid var(--blue-open);
  outline-offset: 2px;
}


/* --- Ergebnisseite: Status-Pill direkt unter der Score-Zahl (12px Abstand, linksbündig wie die Zahl) --- */
.result-box-cell:first-child .result-score-line {
  order: -2;
}

.result-box-cell:first-child .result-box-top {
  order: -1;
  margin-top: -12px; /* gap 24px in .result-box-cell - 12px = 12px */
}


/* --- Ergebnisseite: PDF-Textlink inline im Postfach-Hinweis, Aufbau wie .result-whitepaper-link --- */
.result-pdf-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--blue-open);
  text-decoration: none;
  white-space: nowrap;
  text-align: left;
  cursor: pointer;
}

/* Tippfläche: unsichtbar auf 44px Höhe vergrößert (Zeilenhöhe 22,5px: (44 - 22,5) / 2 = 10,75px oben und unten) */
.result-pdf-link::before {
  content: "";
  position: absolute;
  inset: -10.75px -8px;
}

.result-pdf-link:hover .result-pdf-link-text {
  text-decoration: underline;
}

.result-pdf-link:focus-visible {
  outline: 2px solid var(--blue-open);
  outline-offset: 4px;
}

/* Statisches Cloud-Bild: nur im Druck sichtbar */
.print-signature {
  display: none;
}

/* Logo: nur im PDF sichtbar */
.print-logo {
  display: none;
}

/* ============================================================================
   PRINT: Ergebnisseite als A4-PDF ("Als PDF speichern")
   Feste Regeln, unabhängig von Fensterbreite und den max-width-Regeln oben.
   ============================================================================ */
@page {
  size: A4;
  margin: 0;
}

@media print {
  *,
  *::before,
  *::after {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    transition: none !important;
    animation: none !important;
  }

  html,
  body {
    width: 210mm;
    margin: 0;
    padding: 0;
    background: var(--navy);
    scrollbar-gutter: auto;
  }

  /* Ausblenden */
  #screen-intro,
  #screen-question,
  #screen-email,
  .stage,
  #page-dot-cloud,
  #result-pdf-btn,
  #result-mail-note,
  #readiness-signature-canvas {
    display: none !important;
  }

  /* 100vw / calc(-50vw + 50%) greifen im Druck nicht */
  .page {
    width: 210mm;
    max-width: none;
    margin: 0;
    padding: 28px 32px;
    background-color: var(--navy);
    overflow: visible;
  }

  .card,
  .card.intro-card,
  .card.intro-card.is-stage {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
    box-shadow: none;
    overflow: visible;
  }

  #screen-result {
    overflow: visible;
  }

  .result-head {
    margin-bottom: 28px;
  }

  .result-head .eyebrow {
    font-size: 12px;
    margin-bottom: 6px;
  }

  .result-head h1 {
    font-size: 28px;
    line-height: 1.15;
  }

  .result-box,
  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-box {
    margin-bottom: 32px;
  }

  .result-box-cell {
    padding: 0 0 0 0;
    gap: 14px;
  }

  .result-box-cell:first-child .result-box-top {
    margin-top: -6px;
  }

  .result-score-main {
    font-size: 72px;
  }

  .result-score-max {
    font-size: 20px;
  }

  .result-status-block {
    gap: 8px;
    padding-top: 4px;
  }

  .result-status-heading {
    font-size: 18px;
  }

  .result-status-desc {
    font-size: 12px;
  }

  /* Cloud: Bild statt Canvas, gleiche Proportionen wie der Slot */
  .result-box-cell:last-child {
    padding-left: 16px;
  }

  .print-signature {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .result-grid {
    gap: 28px;
    margin-bottom: 32px;
  }

  .result-col-title {
    font-size: 18px;
    margin-bottom: 10px;
  }

  .result-row {
    grid-template-columns: 110px 1fr 30px;
    gap: 10px;
    padding: 8px 0;
  }

  .result-row-name {
    font-size: 12px;
  }

  .result-row-score {
    font-size: 11px;
  }

  .result-todos {
    gap: 12px;
  }

  .result-todo {
    padding: 14px;
    grid-template-columns: 30px 1fr;
    gap: 10px;
  }

  .result-todo-num {
    font-size: 20px;
  }

  .result-todo-title {
    font-size: 13px;
  }

  .result-todo-text {
    font-size: 11.5px;
    line-height: 1.45;
  }

  .result-whitepaper {
    font-size: 12px;
    margin-top: 14px;
  }

  .result-cta {
    padding: 22px 28px;
    gap: 8px;
  }

  .result-cta-heading {
    font-size: 22px;
  }

  .result-cta-text {
    font-size: 12px;
    margin-bottom: 8px;
  }

  .result-cta-btn {
    font-size: 13px;
    padding: 10px 20px;
  }

  /* Logo unten links: Schutzraum nach CI ca. 16px (Höhe des Icons bei 100px Breite) */
  .print-logo {
    display: block;
    position: fixed;
    left: 32px;
    bottom: 32px;
    width: 100px;
    height: auto;
  }

  .result-box,
  .result-row,
  .result-todo,
  .result-whitepaper,
  .result-cta {
    break-inside: avoid;
  }
}
