:root {
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --primary: #4e9083;
  --primary-hover: #3e7369;
  --accent: #f59e0b;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow-md: 0 4px 8px rgba(15,23,42,.08);
  --shadow-lg: 0 20px 40px -12px rgba(15,23,42,.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg-soft);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1400px; margin: 0 auto; padding: 0 24px; }

/* Header */
.wizard-header {
  position: sticky; top: 0; z-index: 40;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.wizard-header .wrap {
  display: flex; align-items: center; gap: 16px;
  height: 60px;
}
.logo {
  font-weight: 800; font-size: 18px;
  color: var(--ink); text-decoration: none;
  display: flex; align-items: center; gap: 8px;
  margin-right: auto;
}
.logo-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}
.logo-img { height: 28px; width: auto; display: block; }
.save-indicator {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--success); font-size: 13px; font-weight: 500;
}
.save-indicator .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
}

/* Progress bar */
.progress-bar {
  height: 3px; background: var(--line);
  position: sticky; top: 60px; z-index: 39;
}
.progress-bar-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width .2s ease;
}

/* Main layout */
.wizard-main {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 300px;
  gap: 32px;
  max-width: 1400px; margin: 0 auto;
  padding: 32px 24px 80px;
  align-items: flex-start;
}
@media (max-width: 1100px) {
  .wizard-main { grid-template-columns: 220px minmax(0, 1fr); }
  .rail { display: none; }
}
@media (max-width: 800px) {
  .wizard-main { grid-template-columns: 1fr; padding: 20px 16px 60px; }
  .stepper { display: none; }
}

/* Stepper */
.stepper {
  position: sticky; top: 100px;
}
.stepper ol {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.stepper-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.stepper-item:hover { background: rgba(78,144,131,.05); color: var(--ink); }
.stepper-item.active {
  background: rgba(78,144,131,.10);
  color: var(--primary);
  font-weight: 600;
}
.stepper-item.completed .stepper-num {
  background: var(--success); color: #fff; border-color: var(--success);
}
.stepper-num {
  flex-shrink: 0;
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff; border: 1.5px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.stepper-item.active .stepper-num {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.stepper-label { flex: 1; }
.stepper-check {
  display: none;
  align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--success); color: #fff;
  flex-shrink: 0;
}
.stepper-item[data-complete="1"] .stepper-check { display: inline-flex; }

/* Form */
.wizard-form {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: 40px;
  box-shadow: var(--shadow-sm);
}
@media (max-width: 800px) { .wizard-form { padding: 24px 20px; border-radius: var(--radius); } }

.honesty-notice {
  background: rgba(245,158,11,.08);
  border-left: 3px solid var(--accent);
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 13px; color: var(--ink-soft);
  margin-bottom: 32px;
}

.step { display: none; }
.step.active { display: block; }

.step-head { margin-bottom: 28px; }
.step-head h2 {
  font-size: 26px; letter-spacing: -.02em; margin: 0 0 8px;
  font-weight: 700;
}
.step-desc { color: var(--ink-soft); margin: 0; font-size: 15px; }

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

/* Question */
.q {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.q:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(78,144,131,.10); }
.q[hidden] { display: none; }

.q-locked {
  background: rgba(78,144,131,.03);
  border-style: dashed;
}
.q-locked:focus-within { box-shadow: none; }
.q-locked-value {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}
.q-locked-value p { margin: 0; }
.q-locked-value p + p { margin-top: 8px; }
.q-locked-value ul { margin: 4px 0 0 0; padding-left: 20px; }
.q-locked-value ul li { padding: 2px 0; }

/* Optional-Fragen */
.q-optional {
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-style: dashed;
}
.q-optional:focus-within { box-shadow: none; border-color: var(--line); }
.q-optional details { padding: 0; }
.q-optional summary {
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--ink-soft);
  border-radius: var(--radius);
  transition: background .15s ease;
}
.q-optional summary::-webkit-details-marker { display: none; }
.q-optional summary::after {
  content: "+";
  margin-left: auto;
  font-size: 20px; color: var(--muted); font-weight: 400;
  transition: transform .2s ease;
}
.q-optional details[open] > summary::after { transform: rotate(45deg); }
.q-optional summary:hover { background: var(--bg-soft); }
.q-optional-prefix {
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .04em;
  font-size: 12px; text-transform: uppercase;
}
.q-optional-label { color: var(--ink); font-weight: 500; }
.q-optional-body {
  padding: 4px 18px 18px;
  border-top: 1px dashed var(--line);
}
.q-header-inline {
  display: flex; justify-content: flex-end;
  padding-top: 12px; margin-bottom: 0;
}

.q-header {
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
  margin-bottom: 4px;
}
.q-label {
  font-weight: 600; font-size: 15px; color: var(--ink);
  cursor: default; flex: 1;
}
.q-req { color: var(--danger); }
.q-badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; margin-left: 6px; vertical-align: middle;
}
.q-badge-vendor { background: rgba(78,144,131,.10); color: var(--primary); }
.q-help-toggle {
  border: none; background: none; color: var(--muted);
  font-size: 13px; cursor: pointer; padding: 0; text-decoration: underline;
  white-space: nowrap;
}
.q-help-toggle:hover { color: var(--primary); }
.q-help {
  color: var(--ink-soft); font-size: 13px;
  background: var(--bg-soft); padding: 12px 14px;
  border-radius: 8px; margin: 8px 0 12px;
  line-height: 1.55;
}

.q-input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 15px;
  color: var(--ink); background: #fff;
  transition: border-color .15s ease;
  margin-top: 8px;
}
.q-input:focus { outline: none; border-color: var(--primary); }
.q-input[readonly] { background: var(--bg-soft); color: var(--muted); cursor: not-allowed; }
textarea.q-input { resize: vertical; min-height: 90px; line-height: 1.5; }

.q-options {
  display: flex; flex-direction: column; gap: 8px; margin-top: 8px;
}
.q-opt {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.q-opt:hover { border-color: var(--primary); background: rgba(78,144,131,.03); }
.q-opt input { flex-shrink: 0; margin: 0; accent-color: var(--primary); }
.q-opt-label { flex: 1; font-size: 14px; }
.q-opt input:checked ~ .q-opt-label { font-weight: 600; }
.q-opt:has(input:checked) { border-color: var(--primary); background: rgba(78,144,131,.06); }
.q-opt:has(input:disabled) { opacity: .7; cursor: not-allowed; }

/* Impact badges */
.impact {
  flex-shrink: 0;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.impact-strong-positive { background: rgba(5,150,105,.12); color: var(--success); }
.impact-positive        { background: rgba(5,150,105,.08); color: var(--success); }
.impact-neutral         { background: rgba(100,116,139,.10); color: var(--muted); }
.impact-warning         { background: rgba(217,119,6,.12); color: var(--warning); }
.impact-blocker         { background: rgba(220,38,38,.12); color: var(--danger); }

/* Step nav */
.step-nav {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-top: 40px;
  padding-top: 24px; border-top: 1px solid var(--line);
}
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600; font-size: 14px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .1s ease, box-shadow .15s ease, background .15s ease;
  font-family: inherit;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost {
  background: transparent; color: var(--ink); border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--ink); background: var(--bg-soft); }
.step-back:disabled { visibility: hidden; }

/* Rail */
.rail { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 16px; }
.rail-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
}
.rail-heading {
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  font-weight: 700; color: var(--muted); margin-bottom: 12px;
}
.rail-bar {
  height: 8px; background: var(--line); border-radius: 4px; overflow: hidden;
  margin-bottom: 6px;
}
.rail-bar > div {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width .3s ease;
}
.rail-percent { font-size: 13px; color: var(--muted); font-weight: 600; }

.impact-summary {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.impact-summary li {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
}
.impact-summary li > :first-child { flex: 1; }

.badge {
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; text-align: center;
  min-width: 24px; display: inline-block;
}
.b-strong-positive { background: rgba(5,150,105,.12); color: var(--success); }
.b-positive        { background: rgba(5,150,105,.08); color: var(--success); }
.b-neutral         { background: rgba(100,116,139,.10); color: var(--muted); }
.b-warning         { background: rgba(217,119,6,.12); color: var(--warning); }
.b-blocker         { background: rgba(220,38,38,.12); color: var(--danger); }

.rail-tendency {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px; font-weight: 600;
}

#rail-warnings ul { list-style: none; padding: 0; margin: 0; }
#rail-warnings li {
  padding: 8px 0; font-size: 12px; color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}
#rail-warnings li:last-child { border-bottom: none; }
#rail-warnings li.sev-warn::before { content: "⚠ "; color: var(--warning); }
#rail-warnings li.sev-blocker::before { content: "■ "; color: var(--danger); }

/* Review */
#review-content .review-summary {
  margin-bottom: 28px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(78,144,131,.04), rgba(245,158,11,.04));
  border: 1px solid var(--line);
  border-radius: 10px;
}
#review-content .review-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 700px) {
  #review-content .review-summary-grid { grid-template-columns: 1fr 1fr; }
}
#review-content .rs-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
}
#review-content .rs-item b {
  font-size: 26px; font-weight: 800; line-height: 1;
}
#review-content .rs-item span {
  font-size: 12px; color: var(--muted);
}
#review-content .rs-strong b { color: var(--success); }
#review-content .rs-pos b    { color: var(--success); opacity: .85; }
#review-content .rs-warn b   { color: var(--warning); }
#review-content .rs-block b  { color: var(--danger); }

#review-content .review-section {
  margin-bottom: 20px;
  padding: 20px;
  background: var(--bg-soft);
  border-radius: 8px;
}
#review-content .review-section h3 {
  font-size: 15px; margin: 0 0 14px; color: var(--primary);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
#review-content dl {
  margin: 0; display: grid; grid-template-columns: minmax(200px, max-content) 1fr; gap: 10px 20px;
}
#review-content dt {
  color: var(--muted); font-size: 13px; font-weight: 500;
  align-self: start;
}
#review-content dd {
  margin: 0; font-size: 14px; color: var(--ink);
  line-height: 1.5; word-break: break-word;
}
#review-content dd em { color: var(--muted); font-style: normal; }
@media (max-width: 700px) {
  #review-content dl { grid-template-columns: 1fr; gap: 4px 0; }
  #review-content dt { margin-top: 12px; }
}

/* Modal */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(15,23,42,.6);
  backdrop-filter: blur(2px);
}
.modal-card {
  position: relative;
  background: #fff; border-radius: 16px; padding: 40px;
  max-width: 520px; width: 100%;
  box-shadow: 0 30px 60px -12px rgba(15,23,42,.35);
  max-height: 90vh; overflow-y: auto;
}
.modal-close {
  position: absolute; top: 12px; right: 12px;
  border: none; background: transparent;
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 24px; color: var(--muted); cursor: pointer;
  line-height: 1;
}
.modal-close:hover { background: var(--bg-soft); color: var(--ink); }
.modal-card h2 {
  font-size: 22px; letter-spacing: -.02em; margin: 0 0 8px;
  font-weight: 700;
}
.modal-lead { color: var(--ink-soft); margin: 0 0 24px; font-size: 15px; }
.modal-field { display: block; margin-bottom: 16px; }
.modal-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--ink); margin-bottom: 6px;
}
.modal-field input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 15px; color: var(--ink);
  transition: border-color .15s ease;
}
.modal-field input:focus { outline: none; border-color: var(--primary); }
.modal-check {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 8px 0 20px; font-size: 13px; color: var(--ink-soft);
  cursor: pointer; line-height: 1.5;
}
.modal-check input { margin-top: 3px; flex-shrink: 0; accent-color: var(--primary); }
.modal-legal {
  font-size: 12px; color: var(--muted);
  background: var(--bg-soft); padding: 12px 14px;
  border-radius: 8px; line-height: 1.5;
  margin: 0 0 20px;
}
.modal-error {
  background: rgba(220,38,38,.08); color: var(--danger);
  border: 1px solid rgba(220,38,38,.2);
  padding: 10px 14px; border-radius: 8px;
  font-size: 13px; margin-bottom: 16px;
}
.modal-actions {
  display: flex; gap: 12px; justify-content: flex-end;
}
.modal-actions .btn-primary:disabled {
  background: var(--muted); cursor: wait;
}

/* Mail-sent screen (fullscreen overlay) */
.mail-sent-screen {
  position: fixed; inset: 0; z-index: 90;
  background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.mail-sent-screen[hidden] { display: none; }
.mail-sent-card {
  max-width: 480px; text-align: center;
  padding: 48px 32px;
  background: #fff; border-radius: 16px;
  box-shadow: 0 20px 40px -12px rgba(15,23,42,.18);
}
.mail-sent-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(5,150,105,.10); color: var(--success);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.mail-sent-card h2 {
  font-size: 24px; letter-spacing: -.02em;
  margin: 0 0 12px;
}
.mail-sent-card p { color: var(--ink-soft); margin: 0 0 12px; line-height: 1.55; }
.mail-sent-card strong { color: var(--ink); word-break: break-all; }
.mail-sent-hint { font-size: 13px; color: var(--muted); margin-top: 16px !important; }
.mail-sent-hint a { color: var(--primary); }
