/* =========================================================
   2-Minuten Versicherungs-Check · Tom Schwab / ERGO Zwickau
   Reines HTML/CSS/JS · keine externen Fonts/CDNs · mobile first
   ========================================================= */

:root {
  /* Markenfarben */
  --ergo-red: #E30613;
  --ergo-red-dark: #B70510;
  --navy: #001F2A;
  --grey-light: #F4F5F7;
  --white: #FFFFFF;
  --gold: #B5AA5A;

  /* Status */
  --status-green: #168A4A;
  --status-yellow: #D99A00;
  --status-red: #E30613;
  --status-neutral: #9AA3AF;

  /* Abgeleitet */
  --ink: #001F2A;
  --ink-soft: #45565E;
  --line: #E2E5EA;
  --line-strong: #CBD2DA;
  --shadow: 0 1px 2px rgba(0, 31, 42, .06), 0 8px 24px rgba(0, 31, 42, .08);
  --shadow-lg: 0 12px 40px rgba(0, 31, 42, .14);
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 720px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* -------------------- Reset -------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--grey-light);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--ergo-red); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }

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

/* -------------------- Topbar -------------------- */
.topbar {
  background: var(--ergo-red);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand__mark {
  font-weight: 800;
  letter-spacing: .04em;
  background: var(--white);
  color: var(--ergo-red);
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 15px;
}
.brand__name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar__phone { color: var(--white); font-weight: 700; font-size: 14px; white-space: nowrap; }
.topbar__phone:hover { text-decoration: underline; }

/* -------------------- Hero -------------------- */
.hero {
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(227, 6, 19, .10), transparent 55%),
    var(--white);
  border-bottom: 1px solid var(--line);
}
.hero__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 18px 48px;
}
.hero__eyebrow {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ergo-red);
}
.hero__title {
  margin: 0 0 14px;
  font-size: clamp(30px, 8.5vw, 46px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--navy);
}
.hero__sub {
  margin: 0 0 16px;
  font-size: clamp(17px, 4.5vw, 20px);
  font-weight: 600;
  color: var(--ink);
}
.hero__intro {
  margin: 0 0 22px;
  color: var(--ink-soft);
  max-width: 56ch;
}

.trust {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.trust__item {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  background: var(--grey-light);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 13px;
  position: relative;
  padding-left: 28px;
}
.trust__item::before {
  content: "";
  position: absolute;
  left: 12px; top: 50%;
  width: 8px; height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--status-green);
}

.hero__card {
  margin-top: 30px;
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--gold);
}
.hero__cardName { margin: 0 0 4px; font-weight: 800; font-size: 18px; }
.hero__cardLine { margin: 2px 0; font-size: 14px; color: #C6D2D7; }
.hero__card a { color: var(--white); }

/* -------------------- Buttons -------------------- */
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 16px;
  padding: 14px 22px;
  transition: transform .08s ease, box-shadow .15s ease, background-color .15s ease, opacity .15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--ergo-red);
  color: var(--white);
  box-shadow: 0 6px 16px rgba(227, 6, 19, .28);
}
.btn--primary:hover { background: var(--ergo-red-dark); }
.btn--ghost {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--line-strong);
}
.btn--ghost:hover { border-color: var(--navy); }
.btn--lg { padding: 17px 30px; font-size: 18px; width: 100%; }
.btn__meta { font-size: 13px; font-weight: 600; opacity: .85; }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }
.btn[hidden] { display: none; }

/* -------------------- Flow / Stepper -------------------- */
.flow__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 18px 40px;
}

/* Fortschritt */
.progress { margin-bottom: 22px; }
.progress__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.progress__label { font-size: 14px; font-weight: 700; color: var(--navy); }
.progress__pct { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.progress__track {
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--ergo-red), var(--gold));
  border-radius: 999px;
  transition: width .35s cubic-bezier(.4, 0, .2, 1);
}

/* Step-Karte */
.step {
  border: none;
  margin: 0;
  padding: 24px 20px 26px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: stepIn .3s ease;
}
.step[hidden] { display: none; }
@keyframes stepIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .step { animation: none; }
  .progress__bar { transition: none; }
}

.step__kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ergo-red);
}
.step__title {
  margin: 0 0 8px;
  font-size: clamp(21px, 5.5vw, 26px);
  line-height: 1.15;
  font-weight: 800;
  color: var(--navy);
}
.step__lead { margin: 0 0 20px; color: var(--ink-soft); }

/* -------------------- Felder -------------------- */
.grid { display: grid; gap: 14px; }
.grid--2 { grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid--2 { grid-template-columns: 1fr 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field--block { margin-top: 18px; }
.field__label { font-size: 14px; font-weight: 700; color: var(--navy); }
.field__label--block { display: block; margin: 22px 0 10px; }
.req { color: var(--ergo-red); }

.input {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  font-size: 16px;
  color: var(--ink);
  background: var(--white);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: var(--status-neutral); }
.input:focus {
  outline: none;
  border-color: var(--ergo-red);
  box-shadow: 0 0 0 3px rgba(227, 6, 19, .14);
}
.input--area { resize: vertical; min-height: 84px; line-height: 1.5; }
.input.is-error { border-color: var(--ergo-red); box-shadow: 0 0 0 3px rgba(227, 6, 19, .12); }

/* Hinweise / Fehlermeldungen */
.hint {
  margin: 10px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ergo-red);
  display: none;
}
.hint.is-visible { display: block; }
.notice {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--grey-light);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
}
.notice--soft { border-left: 4px solid var(--gold); }

/* -------------------- Choice-Buttons (Single-Select) -------------------- */
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.choices--stack { flex-direction: column; }
.choice {
  appearance: none;
  cursor: pointer;
  background: var(--white);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  text-align: left;
  transition: border-color .12s ease, background-color .12s ease, color .12s ease, transform .08s ease;
}
.choices--stack .choice { width: 100%; }
.choice:hover { border-color: var(--navy); }
.choice:active { transform: scale(.98); }
.choice.is-selected {
  background: var(--ergo-red);
  border-color: var(--ergo-red);
  color: var(--white);
}

/* -------------------- Auswahl-Cards (Multi-Select) -------------------- */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 520px) { .cards { grid-template-columns: 1fr 1fr; } }
.card-opt {
  position: relative;
  cursor: pointer;
  background: var(--white);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 15px 16px 15px 46px;
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  text-align: left;
  transition: border-color .12s ease, background-color .12s ease, transform .08s ease;
}
.card-opt:hover { border-color: var(--navy); }
.card-opt:active { transform: scale(.99); }
.card-opt::before {
  content: "";
  position: absolute;
  left: 15px; top: 50%;
  transform: translateY(-50%);
  width: 20px; height: 20px;
  border: 2px solid var(--line-strong);
  border-radius: 6px;
  background: var(--white);
  transition: background-color .12s ease, border-color .12s ease;
}
.card-opt.is-selected {
  border-color: var(--ergo-red);
  background: rgba(227, 6, 19, .05);
  color: var(--navy);
}
.card-opt.is-selected::before {
  background: var(--ergo-red);
  border-color: var(--ergo-red);
}
.card-opt.is-selected::after {
  content: "";
  position: absolute;
  left: 22px; top: 50%;
  margin-top: -5px;
  width: 6px; height: 11px;
  border: solid var(--white);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.card-opt.is-disabled { opacity: .5; cursor: not-allowed; }

/* -------------------- Schnellcheck (Sparten) -------------------- */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--ink-soft);
}
.legend__item { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot--green { background: var(--status-green); }
.dot--red { background: var(--status-red); }
.dot--yellow { background: var(--status-yellow); }
.dot--check { background: var(--white); border: 2px solid var(--status-red); }

.checklist { display: flex; flex-direction: column; gap: 10px; }
.spart {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.spart__name { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 9px; }
.spart__opts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}
@media (min-width: 560px) { .spart__opts { grid-template-columns: repeat(4, 1fr); } }

.opt {
  appearance: none;
  cursor: pointer;
  border: 1.5px solid var(--line-strong);
  background: var(--white);
  border-radius: 8px;
  padding: 9px 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  text-align: center;
  transition: all .12s ease;
}
.opt:hover { border-color: var(--navy); }
/* Status-Farbgebung im aktiven Zustand */
.opt.is-active[data-val="vorhanden"] { background: var(--status-green); border-color: var(--status-green); color: var(--white); }
.opt.is-active[data-val="nicht_vorhanden"] { background: var(--status-red); border-color: var(--status-red); color: var(--white); }
.opt.is-active[data-val="unklar"] { background: var(--status-yellow); border-color: var(--status-yellow); color: var(--white); }
.opt.is-active[data-val="bitte_pruefen"] { background: var(--white); border: 2px dashed var(--status-red); color: var(--status-red); }

/* -------------------- Preis-Leistungs-Diagramm -------------------- */
.ppmeter {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 24px 20px 26px;
  color: var(--white);
  box-shadow: var(--shadow);
}
.ppmeter__ends {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: #AFC0C6;
  margin-bottom: 6px;
}
.ppmeter__value { text-align: center; margin: 6px 0 22px; }
.ppmeter__num {
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  color: var(--gold);
  letter-spacing: -.02em;
}
.ppmeter__den { font-size: 22px; font-weight: 700; color: #8FA3AA; margin-left: 6px; }

.ppmeter__stage {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ppmeter__tag { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #AFC0C6; flex: none; }

.ppmeter__track {
  position: relative;
  flex: 1;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2E6F8E 0%, var(--gold) 50%, var(--ergo-red) 100%);
  cursor: pointer;
  touch-action: none;
}
.ppmeter__track:focus { outline: none; }
.ppmeter__track:focus-visible { box-shadow: 0 0 0 3px rgba(181, 170, 90, .5); }
.ppmeter__fill { display: none; } /* Verlauf reicht visuell */

.ppmeter__ticks {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
  align-items: center;
  pointer-events: none;
}
.ppmeter__ticks span {
  width: 2px; height: 6px;
  background: rgba(255,255,255,.35);
  border-radius: 2px;
}

.ppmeter__thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px; height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--ergo-red);
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
  cursor: grab;
  transition: left .12s ease;
  padding: 0;
}
.ppmeter__thumb:active { cursor: grabbing; }
.ppmeter.is-dragging .ppmeter__thumb { transition: none; }

.ppmeter__readout {
  margin-top: 22px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.ppmeter__type { margin: 0 0 5px; font-weight: 800; font-size: 16px; color: var(--white); }
.ppmeter__desc { margin: 0; font-size: 14px; color: #C6D2D7; }

/* -------------------- Checkboxen (Einwilligung) -------------------- */
.privacy {
  background: var(--grey-light);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 20px;
}
.privacy p { margin: 0 0 10px; }
.privacy p:last-child { margin-bottom: 0; }
.privacy__note { font-size: 13px; font-style: italic; color: var(--status-neutral); }

.check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  cursor: pointer;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.check:first-of-type { border-top: none; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
  width: 24px; height: 24px;
  border: 2px solid var(--line-strong);
  border-radius: 6px;
  background: var(--white);
  flex: none;
  position: relative;
  margin-top: 1px;
  transition: background-color .12s ease, border-color .12s ease;
}
.check input:checked + .check__box {
  background: var(--ergo-red);
  border-color: var(--ergo-red);
}
.check input:checked + .check__box::after {
  content: "";
  position: absolute;
  left: 8px; top: 4px;
  width: 6px; height: 11px;
  border: solid var(--white);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.check input:focus-visible + .check__box {
  box-shadow: 0 0 0 3px rgba(227, 6, 19, .25);
}
.check__text { font-size: 14px; color: var(--ink); line-height: 1.45; }

/* -------------------- Zusammenfassung -------------------- */
.summary { display: flex; flex-direction: column; gap: 2px; }
.sum-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 520px) {
  .sum-row { grid-template-columns: 150px 1fr; gap: 14px; align-items: baseline; }
}
.sum-row:last-child { border-bottom: none; }
.sum-row__label { font-size: 13px; font-weight: 800; color: var(--status-neutral); text-transform: uppercase; letter-spacing: .04em; }
.sum-row__value { font-size: 15px; color: var(--ink); }
.sum-row__value strong { color: var(--navy); }
.sum-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sum-tag {
  font-size: 13px; font-weight: 600;
  background: var(--grey-light);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
  color: var(--navy);
}
.sum-tag--green { border-color: var(--status-green); color: var(--status-green); }
.sum-tag--red { border-color: var(--status-red); color: var(--status-red); }
.sum-tag--yellow { border-color: var(--status-yellow); color: #a87800; }

/* Mini-Skala in der Zusammenfassung */
.sum-pp { display: flex; align-items: center; gap: 10px; }
.sum-pp__bar {
  position: relative;
  flex: 1;
  max-width: 220px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2E6F8E, var(--gold), var(--ergo-red));
}
.sum-pp__dot {
  position: absolute; top: 50%;
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--ergo-red);
}
.sum-pp__num { font-weight: 800; color: var(--navy); white-space: nowrap; }

/* -------------------- Navigation -------------------- */
.nav {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}
.nav .btn { flex: 1; }
#nextBtn, #submitBtn { flex: 2; }

/* -------------------- Success -------------------- */
.done__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 60px 18px 70px;
  text-align: center;
}
.done__check {
  width: 84px; height: 84px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: rgba(22, 138, 74, .12);
  color: var(--status-green);
  display: grid;
  place-items: center;
  animation: pop .4s ease;
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .done__check { animation: none; } }
.done__title {
  margin: 0 0 12px;
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 800;
  color: var(--navy);
}
.done__text { margin: 0 auto 30px; color: var(--ink-soft); max-width: 46ch; }
.done__card {
  text-align: left;
  display: inline-block;
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  padding: 20px 24px;
  border-left: 5px solid var(--gold);
}
.done__card a { color: var(--white); }

/* -------------------- Footer -------------------- */
.footer {
  background: var(--navy);
  color: #9FB1B8;
  margin-top: auto;
}
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 18px;
  text-align: center;
}
.footer__links {
  display: flex;
  gap: 22px;
  justify-content: center;
  margin-bottom: 12px;
}
.footer__links a { color: var(--white); font-size: 14px; font-weight: 600; }
.footer__copy { margin: 0; font-size: 13px; }

/* Sticky-Footer-Layout */
body { display: flex; flex-direction: column; min-height: 100vh; }
#app { flex: 1 0 auto; }
