/* =====================================================================
   LIBAL "Die Lösung" – 4 Schritte, animiert (Startseite, Sektion #loesung)
   Alles unter .lx-steps gekapselt; Steuerung in assets/js/solution-steps.js
   Keyframes mit Präfix "lxs-", damit nichts mit custom.css kollidiert.
   ===================================================================== */
.lx-steps {
  --lx-primary: #016984;
  --lx-primary-2: #269bb5;
  --lx-accent: #ff9800;
  --lx-accent-2: #ffb344;
  --lx-ok: #1f9e8a;
  --lx-err: #e0565b;
  --lx-warn: #e7a23a;
  --lx-text: #111827;
  --lx-body: #4b5866;
  --lx-muted: #8a96a3;
  --lx-line: #cfdce4;
  --lx-border: #e4eaf0;
  --lx-f-head: 'Catamaran', 'Arial', sans-serif;
  --lx-f-body: 'Roboto', 'Arial', sans-serif;
  --lx-f-num: 'Catamaran', 'Arial', sans-serif;

  position: relative;
  overflow: hidden;
  padding: 88px 24px 110px;
  font-family: var(--lx-f-body);
  color: var(--lx-text);
  background:
    radial-gradient(900px 520px at -5% -10%, rgba(1,105,132,.10), transparent 60%),
    radial-gradient(800px 520px at 100% 105%, rgba(255,152,0,.09), transparent 60%),
    #fbfcfd;
}
.lx-steps *, .lx-steps *::before, .lx-steps *::after { box-sizing: border-box; }
.lx-steps__inner { max-width: 1216px; margin: 0 auto; }

/* ---------- Header ---------- */
.lx-steps__head { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: end; margin-bottom: 96px; }
.lx-steps .lx-eyebrow { display: flex; align-items: center; gap: 16px; font-size: 12px; font-weight: 700; letter-spacing: .28em; text-transform: uppercase; color: var(--lx-primary); margin-bottom: 26px; }
.lx-steps .lx-eyebrow::before, .lx-steps .lx-eyebrow::after { content: ""; width: 40px; height: 1px; background: var(--lx-primary); opacity: .6; }
.lx-steps__title { font-family: var(--lx-f-head); font-weight: 700; font-size: clamp(38px, 4.6vw, 62px); line-height: 1.05; letter-spacing: -.01em; margin: 0; color: var(--lx-text); }
.lx-steps__title em { font-family: var(--lx-f-body); font-style: italic; font-weight: 300; font-size: .62em; color: var(--lx-muted); letter-spacing: 0; }
.lx-steps__title strong { color: var(--lx-primary); font-weight: 700; }
.lx-steps__lead { margin: 0; padding-left: 24px; border-left: 2px solid var(--lx-primary); font-size: 17px; line-height: 1.7; color: var(--lx-body); max-width: 420px; }

/* ---------- Zeitstrahl + Karten ---------- */
.lx-steps__row { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.lx-step { display: flex; flex-direction: column; }

.lx-step__num {
  position: relative; display: inline-block; align-self: flex-start;
  font-family: var(--lx-f-num); font-weight: 300; font-size: 84px; line-height: .9; letter-spacing: -.03em;
  color: transparent; -webkit-text-stroke: 1.5px #c6d7e0;
  margin: 0 0 10px; transition: -webkit-text-stroke-color .5s;
  user-select: none;
}
.lx-step__num::after {
  content: attr(data-n); position: absolute; inset: 0;
  -webkit-text-stroke: 0;
  background: linear-gradient(135deg, var(--lx-accent-2), var(--lx-accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0; transform: translateY(6px); transition: opacity .5s, transform .5s;
}
.lx-step.is-done .lx-step__num { -webkit-text-stroke-color: #8fb4c5; }
.lx-step.is-active .lx-step__num::after { opacity: 1; transform: none; }

.lx-step__dot {
  position: relative; z-index: 2;
  width: 14px; height: 14px; border-radius: 50%;
  margin: 0 0 22px 41px; /* Mitte über dem Karten-Icon */
  background: #fff; border: 2px solid var(--lx-line);
  transition: background .4s, border-color .4s, box-shadow .4s;
}
.lx-step.is-done .lx-step__dot { background: var(--lx-primary); border-color: var(--lx-primary); }
.lx-step.is-active .lx-step__dot { background: var(--lx-accent); border-color: var(--lx-accent); box-shadow: 0 0 0 6px rgba(255,152,0,.18); }
.lx-step.is-active .lx-step__dot::after {
  content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--lx-accent);
  animation: lxs-ring 1.6s ease-out infinite;
}
@keyframes lxs-ring { from { transform: scale(1); opacity: .7; } to { transform: scale(2.6); opacity: 0; } }

.lx-steps__line, .lx-steps__fill { position: absolute; height: 2px; z-index: 1; pointer-events: none; }
.lx-steps__line { background: repeating-linear-gradient(90deg, var(--lx-line) 0 6px, transparent 6px 12px); }
.lx-steps__fill {
  width: 0; background: linear-gradient(90deg, var(--lx-primary), var(--lx-accent));
  box-shadow: 0 0 14px 2px rgba(255,152,0,.30), 0 0 30px 6px rgba(1,105,132,.10);
  border-radius: 2px;
}

/* ---------- Karte ---------- */
.lx-card {
  position: relative; flex: 1;
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--lx-border); border-radius: 14px;
  padding: 28px; min-height: 440px;
  cursor: pointer; outline: none;
  transition: border-color .45s, box-shadow .45s, transform .45s, background .45s;
}
.lx-card:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(1,105,132,.35); }
.lx-step.is-active .lx-card {
  border-color: rgba(255,152,0,.45);
  background: linear-gradient(180deg, #fffaf3 0%, #fff 42%);
  box-shadow: 0 22px 44px -22px rgba(255,152,0,.45);
  transform: translateY(-4px);
}
.lx-card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.lx-card__icon {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: #eef4f7; border: 1px solid #dbe6ec; color: var(--lx-primary);
  transition: background .4s, border-color .4s, color .4s;
}
.lx-card__icon svg { width: 18px; height: 18px; }
.lx-step.is-active .lx-card__icon { background: #fff2e2; border-color: #f7d3a6; color: var(--lx-accent); }
.lx-card__tag { font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--lx-primary); transition: color .4s; }
.lx-step.is-active .lx-card__tag { color: var(--lx-accent); }
.lx-card__badge {
  margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .08em;
  padding: 4px 8px; border-radius: 999px; color: #fff;
  background: linear-gradient(135deg, var(--lx-primary), var(--lx-primary-2));
}
.lx-card__title { font-family: var(--lx-f-body); font-size: 19px; font-weight: 500; line-height: 1.3; margin: 0 0 12px; min-height: 2.6em; color: var(--lx-text); }
.lx-card__text { font-size: 14px; line-height: 1.65; color: var(--lx-body); margin: 0 0 22px; }

/* ---------- Mini-Visualisierungen (Grundzustand = Endzustand) ---------- */
.lx-viz {
  margin-top: auto; position: relative; height: 164px; overflow: hidden;
  border-radius: 10px; background: #f5f8fa; border: 1px solid #e8eef2;
  padding: 14px; font-size: 12px; color: var(--lx-body);
  filter: saturate(.55); opacity: .8; transition: filter .5s, opacity .5s;
}
.lx-step.is-active .lx-viz { filter: none; opacity: 1; }

/* 01 Upload */
.lx-steps .up-zone {
  height: 84px; border: 1.5px dashed #c8d6df; border-radius: 8px; background: #fff;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.lx-steps .up-file {
  position: relative; width: 34px; height: 42px; border-radius: 4px;
  background: var(--fc); color: #fff; font-size: 8.5px; font-weight: 700; letter-spacing: .04em;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 5px;
  clip-path: polygon(0 0, 68% 0, 100% 24%, 100% 100%, 0 100%);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.08);
}
.lx-steps .up-file::after { content: ""; position: absolute; top: 0; right: 0; width: 32%; height: 24%; background: rgba(255,255,255,.45); clip-path: polygon(0 0, 0 100%, 100% 100%); }
.lx-steps .up-meta { display: flex; justify-content: space-between; align-items: baseline; margin: 12px 0 7px; color: var(--lx-muted); font-size: 11.5px; }
.lx-steps .up-meta b { color: var(--lx-text); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.lx-steps .up-bar, .lx-steps .gp-bar { height: 5px; border-radius: 3px; background: #e2e9ee; overflow: hidden; }
.lx-steps .up-bar i, .lx-steps .gp-bar i { display: block; height: 100%; border-radius: 3px; transform-origin: left; }
.lx-steps .up-bar i { width: 100%; background: linear-gradient(90deg, var(--lx-primary), var(--lx-primary-2)); }

.lx-steps .is-playing .up-file { animation: lxs-drop .65s cubic-bezier(.3,1.5,.5,1) both; animation-delay: calc(var(--i) * .32s + .2s); }
.lx-steps .is-playing .up-zone { animation: lxs-zone 2.2s ease both; }
.lx-steps .is-playing .up-bar i { animation: lxs-grow-x 2.2s .3s cubic-bezier(.3,.7,.3,1) both; }
@keyframes lxs-drop { from { transform: translateY(-70px) rotate(-10deg); opacity: 0; } 60% { opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes lxs-zone { 0%, 100% { border-color: #c8d6df; background: #fff; } 15%, 70% { border-color: var(--lx-accent); background: #fffaf3; } }
@keyframes lxs-grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* 02 Verstehen */
.lx-steps .tr { display: flex; flex-direction: column; gap: 5px; }
.lx-steps .tr-row {
  display: flex; align-items: center; gap: 7px; height: 22px;
  margin-left: calc(var(--l) * 14px); padding: 0 7px;
  background: #fff; border: 1px solid #e3eaef; border-radius: 6px;
  font-size: 11.5px; white-space: nowrap;
}
.lx-steps .tr-row .ic { width: 9px; height: 9px; border-radius: 2px; background: var(--c); flex: none; }
.lx-steps .tr-row .ok { margin-left: auto; width: 14px; height: 14px; color: var(--lx-ok); flex: none; }
.lx-steps .is-playing .tr-row { animation: lxs-tr-in .8s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * .14s + .15s); }
.lx-steps .is-playing .tr-row .ok { animation: lxs-pop .35s cubic-bezier(.3,1.6,.5,1) both; animation-delay: calc(var(--i) * .22s + 1.3s); }
@keyframes lxs-tr-in {
  0% { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; }
  25% { opacity: 1; transform: translate(var(--x), var(--y)) rotate(var(--r)); }
  100% { transform: none; opacity: 1; }
}
@keyframes lxs-pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* 03 Fragen */
.lx-steps .ch { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.lx-steps .ch-q {
  align-self: flex-end; max-width: 88%;
  background: var(--lx-primary); color: #fff; border-radius: 10px 10px 2px 10px;
  padding: 7px 10px; font-size: 11.5px; line-height: 1.4;
}
.lx-steps .ch-ans { position: relative; }
.lx-steps .ch-a {
  max-width: 92%; background: #fff; border: 1px solid #e3eaef; border-radius: 10px 10px 10px 2px;
  padding: 7px 10px; font-size: 11.5px; line-height: 1.4; color: var(--lx-text);
  min-height: calc(2 * 1.4em + 14px);
}
.lx-steps .ch-src {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 6px;
  padding: 3px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 500;
  background: #fff2e2; color: #b4641a; border: 1px solid #f7d3a6;
}
.lx-steps .ch-src svg { width: 11px; height: 11px; }
.lx-steps .ch-typing {
  position: absolute; left: 0; top: 0; display: flex; gap: 4px; padding: 9px 11px;
  background: #fff; border: 1px solid #e3eaef; border-radius: 10px 10px 10px 2px; opacity: 0;
}
.lx-steps .ch-typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--lx-muted); }
.lx-steps .is-playing .ch-q { animation: lxs-pop-up .4s cubic-bezier(.3,1.4,.5,1) .2s both; }
.lx-steps .is-playing .ch-typing { animation: lxs-typing-vis 1.1s .75s both; }
.lx-steps .is-playing .ch-typing i { animation: lxs-dot .9s infinite; }
.lx-steps .is-playing .ch-typing i:nth-child(2) { animation-delay: .15s; }
.lx-steps .is-playing .ch-typing i:nth-child(3) { animation-delay: .3s; }
.lx-steps .is-playing .ch-a { animation: lxs-pop-up .35s ease 1.85s both; }
.lx-steps .is-playing .ch-src { animation: lxs-pop .4s cubic-bezier(.3,1.6,.5,1) 3.2s both, lxs-glow 1.4s ease 3.5s; }
@keyframes lxs-pop-up { from { transform: translateY(8px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes lxs-typing-vis { 0% { opacity: 0; } 12%, 88% { opacity: 1; } 100% { opacity: 0; } }
@keyframes lxs-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-3px); opacity: 1; } }
@keyframes lxs-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,152,0,0); } 40% { box-shadow: 0 0 0 5px rgba(255,152,0,.22); } }

/* 04 Lücken sehen */
.lx-steps .gp-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; color: var(--lx-muted); font-size: 11.5px; }
.lx-steps .gp-head b { color: var(--lx-text); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lx-steps .gp-bar { height: 6px; margin-bottom: 12px; }
.lx-steps .gp-bar i { width: 87%; background: linear-gradient(90deg, var(--lx-ok), #36b89f); }
.lx-steps .gp-list { display: flex; flex-direction: column; gap: 5px; }
.lx-steps .gp-item {
  display: flex; align-items: center; gap: 8px; height: 26px; padding: 0 8px;
  background: #fff; border: 1px solid #e3eaef; border-radius: 6px; font-size: 11.5px; white-space: nowrap; overflow: hidden;
}
.lx-steps .gp-item .st { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.lx-steps .gp-item .where { margin-left: auto; color: var(--lx-muted); font-size: 10.5px; }
.lx-steps .gp-item--err { border-color: rgba(224,86,91,.35); background: #fff7f7; }
.lx-steps .is-playing .gp-bar i { animation: lxs-grow-x 1.5s .2s cubic-bezier(.3,.7,.3,1) both; }
.lx-steps .is-playing .gp-item { animation: lxs-pop-up .4s ease both; animation-delay: calc(var(--i) * .3s + 1.6s); }
.lx-steps .is-playing .gp-item--err { animation: lxs-pop-up .4s ease both, lxs-shake .5s ease both; animation-delay: calc(var(--i) * .3s + 1.6s), calc(var(--i) * .3s + 2.1s); }
@keyframes lxs-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-3px); } 40% { transform: translateX(3px); } 60% { transform: translateX(-2px); } 80% { transform: translateX(2px); } }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .lx-steps__head { grid-template-columns: 1fr; gap: 28px; margin-bottom: 64px; }
  .lx-steps__row { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
  .lx-steps__line, .lx-steps__fill, .lx-step__dot { display: none; }
  .lx-step__num { font-size: 64px; }
}
@media (max-width: 600px) {
  .lx-steps { padding: 64px 16px 72px; }
  .lx-steps__row { grid-template-columns: 1fr; }
  .lx-card { min-height: 0; }
  .lx-card__title { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .lx-steps * { animation: none !important; transition: none !important; }
}
