:root {
  --green: #13BC3F;
  --green-dark: #0fa335;
  --blue: #0078FF;
  --blue-dark: #0062d1;
  --blue-deep: #0a5da8;
  --ink: #1a1a2e;
  --ink-light: #4a4a6a;
  --line: #d8d8e8;
  --bg: #f7f7fb;
  --white: #ffffff;
  --accent-light: #d6f5df;
  --error: #c0392b;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(26, 26, 46, 0.04);
  --shadow-md: 0 2px 8px rgba(26, 26, 46, 0.06);

  --font-brand: "Rubik", "Segoe UI", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------- Brand bar ---------------- */

.brandbar {
  background: linear-gradient(90deg, #13BC3F 0%, #0078FF 100%);
  color: var(--white);
}

.brandbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brandbar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brandbar-tile {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  flex: 0 0 40px;
  box-shadow: var(--shadow-sm);
}

.brandbar-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.wordmark {
  font-family: var(--font-brand);
  font-size: 20px;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}
.wordmark--white { color: var(--white); }
.wordmark--ink   { color: #000; font-size: 13px; }
.wordmark-a { font-weight: 400; }
.wordmark-b { font-weight: 700; }

.brandbar-tag {
  font-size: 10px;
  letter-spacing: 2.5px;
  color: var(--white);
  opacity: 0.9;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------------- Page layout ---------------- */

.page {
  max-width: 780px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.form > * + * {
  margin-top: 28px;
}

/* ---------------- Intro ---------------- */

.intro {
  padding: 0 4px;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-brand);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.eyebrow--green { color: var(--green-dark); }
.eyebrow--blue  { color: var(--blue); }
.eyebrow--deep  { color: var(--blue-deep); }

.intro-title {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.2;
  margin: 10px 0 12px;
  color: var(--ink);
}

.intro-lead {
  color: var(--ink-light);
  margin: 0;
  max-width: 64ch;
}

/* ---------------- Cards ---------------- */

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 28px 24px;
  box-shadow: var(--shadow-sm);
  border-left: 5px solid var(--line);
  position: relative;
}

.card--meta { border-left-color: var(--ink-light); }
.card--kat1 { border-left-color: var(--blue); }
.card--kat2 { border-left-color: var(--green); }
.card--kat3 { border-left-color: var(--blue-deep); }
.card--abschluss { border-left-color: var(--green); }

.card.card--invalid {
  outline: 2px solid var(--error);
  outline-offset: 2px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.card-numeral {
  position: absolute;
  top: 18px;
  right: 24px;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 38px;
  line-height: 1;
  opacity: 0.35;
  pointer-events: none;
}

.card-title {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 20px;
  margin: 4px 0 0;
  color: var(--ink);
}

.card-error {
  display: none;
  margin-top: 8px;
  padding: 8px 12px;
  background: #fdecea;
  color: var(--error);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.card.card--invalid .card-error { display: block; }

/* ---------------- Meta fields ---------------- */

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-label {
  font-family: var(--font-brand);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--ink-light);
}

.field-input {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--line);
  padding: 8px 2px;
  outline: none;
  transition: border-color 120ms ease;
  width: 100%;
}
.field-input:focus {
  border-bottom-color: var(--green);
}
.field-input:invalid:not(:focus):not(:placeholder-shown) {
  border-bottom-color: var(--error);
}

/* ---------------- Questions ---------------- */

.question {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.question:first-of-type {
  border-top: none;
  padding-top: 4px;
}

.q-legend {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 4px;
  padding: 0;
}

.q-hint {
  display: block;
  font-style: italic;
  font-size: 12px;
  color: var(--ink-light);
  margin-bottom: 12px;
}

/* ---------------- Rating widget ---------------- */

.rating {
  border: 0;
  padding: 0;
  margin: 0;
}

.rating-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  max-width: 360px;
}

.rating-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.rating-item input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-light);
  background: var(--white);
  margin: 0;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}
.rating-item input[type="radio"]:hover {
  border-color: var(--green);
}
.rating-item input[type="radio"]:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.rating-item input[type="radio"]:checked {
  background: var(--green);
  border-color: var(--green);
  box-shadow: inset 0 0 0 2px var(--white);
}

.rating-num {
  font-size: 11px;
  color: var(--ink-light);
  font-variant-numeric: tabular-nums;
}

.rating-scale {
  display: flex;
  justify-content: space-between;
  max-width: 360px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink-light);
}

/* ---------------- Textarea ---------------- */

.textarea {
  display: block;
  width: 100%;
  min-height: 3.2em;
  padding: 10px 12px;
  margin-top: 12px;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  resize: vertical;
  transition: border-color 120ms ease, background-color 120ms ease;
}
.textarea:focus {
  border-color: var(--green);
  background: var(--white);
  outline: none;
}
.textarea--large {
  min-height: 6.5em;
}

/* ---------------- Wiedereinladung (3 radios) ---------------- */

.reinvite {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.reinvite label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.reinvite label:hover {
  border-color: var(--green);
}
.reinvite input[type="radio"] {
  accent-color: var(--green);
}
.reinvite label:has(input[type="radio"]:checked) {
  background: var(--accent-light);
  border-color: var(--green);
}

/* ---------------- Submit ---------------- */

.submit-row {
  display: flex;
  justify-content: center;
  padding: 8px 0 0;
}

.btn {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 14px 32px;
  font-family: var(--font-brand);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: background-color 120ms ease, transform 80ms ease, opacity 120ms ease;
  min-width: 260px;
}
.btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.btn--primary {
  background: var(--blue);
  color: var(--white);
}
.btn--primary:hover {
  background: var(--blue-dark);
}
.btn--primary:active {
  transform: translateY(1px);
}
.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.submit-error {
  margin: 0 auto;
  max-width: 560px;
  padding: 10px 14px;
  background: #fdecea;
  color: var(--error);
  border: 1px solid #f5b7b1;
  border-radius: var(--radius-sm);
  font-size: 14px;
  text-align: center;
}

/* ---------------- Thank-you ---------------- */

.card--thanks {
  text-align: center;
  border-left-color: var(--green);
  padding: 40px 28px;
}

.thanks-icon {
  font-size: 40px;
  color: var(--green);
  line-height: 1;
  margin-bottom: 12px;
}

.thanks-title {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 26px;
  margin: 0 0 10px;
  color: var(--ink);
}

.thanks-body {
  color: var(--ink-light);
  max-width: 56ch;
  margin: 0 auto;
}

/* ---------------- Footer ---------------- */

.site-footer {
  margin-top: 40px;
}

.footer-strip {
  height: 4px;
  background: linear-gradient(90deg, #13BC3F 0%, #0078FF 100%);
}

.footer-inner {
  padding: 24px 20px 32px;
  text-align: center;
}

.footer-note {
  margin: 0 auto 12px;
  font-size: 12px;
  color: var(--ink-light);
  max-width: 62ch;
  line-height: 1.5;
}

.footer-wordmark {
  margin-top: 6px;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 640px) {
  .intro-title { font-size: 24px; }
  .meta-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .card { padding: 22px 18px 18px; }
  .card-numeral { top: 14px; right: 16px; font-size: 32px; }
  .btn { width: 100%; min-width: 0; }
  .brandbar-tag { display: none; }
}

@media (max-width: 380px) {
  .page { padding: 20px 14px 32px; }
  .rating-row { gap: 2px; }
}

/* ---------------- Wizard ---------------- */

.wizard {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Step indicator */

.step-indicator {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  position: relative;
}

.step-indicator::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  height: 2px;
  background: var(--line);
  z-index: 0;
}

.step-indicator li {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1 1 0;
  min-width: 0;
}

.step-indicator .dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--line);
  color: var(--ink-light);
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
  line-height: 1;
}

.step-indicator .label {
  font-family: var(--font-brand);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--ink-light);
  text-transform: uppercase;
  text-align: center;
  transition: color 180ms ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.step-indicator li.is-done .dot {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}
.step-indicator li.is-done .label {
  color: var(--green-dark);
}

.step-indicator li.is-current .dot {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}
.step-indicator li.is-current .label {
  color: var(--blue);
}

/* Only the active step participates in layout; inactive ones are taken out of flow
   via position:absolute so the wizard auto-sizes to the current step height. */

.steps {
  position: relative;
  overflow: clip;
}

.steps > .step {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: none;
  visibility: hidden;
}

.step.active {
  position: relative;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  visibility: visible;
}

.step.leaving-left {
  opacity: 0;
  transform: translateX(-24px);
}

.step.leaving-right {
  opacity: 0;
  transform: translateX(24px);
}

/* Staggered question entry once the step becomes active */

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

.step.active .question,
.step.active .card--meta .field,
.step.active .intro {
  animation: qEnter 320ms ease both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

/* Wizard navigation */

.wizard-nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px 16px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(140%) blur(6px);
  -webkit-backdrop-filter: saturate(140%) blur(6px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  position: sticky;
  bottom: 12px;
  z-index: 5;
}

.wizard-step-label {
  font-family: var(--font-brand);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--ink-light);
  text-transform: uppercase;
  text-align: center;
  min-width: 0;
}

.btn--nav {
  min-width: 180px;
  padding: 12px 22px;
  font-size: 12px;
}

.btn--ghost.btn--small {
  min-width: 0;
}

/* Keep the submit row behaviour for non-wizard usages */

.submit-row { display: none; }

/* Mobile: stack the wizard nav */

@media (max-width: 640px) {
  .wizard-nav {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "label label"
      "prev  next";
    padding: 10px 12px;
  }
  .wizard-step-label { grid-area: label; }
  #prev-btn          { grid-area: prev; }
  #next-btn,
  #submit-btn        { grid-area: next; }
  .btn--nav {
    min-width: 0;
    width: 100%;
    padding: 12px 16px;
  }
  .step-indicator .label { display: none; }
}

/* Respect reduced motion */

@media (prefers-reduced-motion: reduce) {
  .steps > .step,
  .step.active,
  .step.leaving-left,
  .step.leaving-right {
    transition: none;
    transform: none;
  }
  .step.active .question,
  .step.active .card--meta .field,
  .step.active .intro {
    animation: none;
  }
  .step-indicator .dot,
  .step-indicator .label {
    transition: none;
  }
}

