/*
 * Od umowy do kluczy - szesc kart procesu (3x2) i sticky kalkulator raty.
 *
 * Geometria, rytm siatki i progi responsywne sa przepisane z prototypu
 * Harmony Antoninek (sekcja #droga). Zmienione wzgledem prototypu sa wylacznie
 * kolory (tokeny serwisu), promienie i rodzina fontu - reszta bez zmian.
 */
.ax-path {
  --ax-path-e: cubic-bezier(0.16, 1, 0.3, 1);
  padding: var(--ax-sec-pad-l) 0 var(--ax-sec-end);
  background: var(--ax-paper);
  color: var(--ax-navy);
}

.ax-path__inner {
  max-width: var(--ax-maxw);
  margin: 0 auto;
  padding: 0 var(--ax-gutter);
}

/* Proces niesie osiem kolumn, kalkulator cztery - podzial z prototypu. */
.ax-path__layout {
  display: grid;
  grid-template-columns: 8fr 4fr;
  gap: clamp(24px, 4vw, 80px);
  align-items: start;
}

.ax-path__main {
  min-width: 0;
}

/* ---------- wejscie sekcji ---------- */

/*
 * Wspolny wzorzec [data-anim] z prototypu: element parkuje 28 px nizej i
 * wjezdza raz, kiedy wejdzie w kadr. Opoznienie startu ustawia renderer
 * przez --ax-path-delay.
 */
.ax-path [data-anim] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 1.1s var(--ax-path-e) var(--ax-path-delay, 0s),
    transform 1.1s var(--ax-path-e) var(--ax-path-delay, 0s);
}

.ax-path [data-anim].is-in {
  opacity: 1;
  transform: none;
}

/* ---------- naglowek ---------- */
.ax-path__eyebrow {
  display: block;
  margin-bottom: 16px;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(53, 59, 102, 0.5);
}

.ax-path__heading {
  margin: 0;
  font-weight: 600;
  font-size: clamp(40px, 5.2vw, 88px);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.ax-path__heading .ax-heading-italic {
  color: var(--ax-navy);
  opacity: 0.7;
}

.ax-path__intro {
  margin: 22px 0 0;
  max-width: 44ch;
  font-size: 16px;
  line-height: 1.65;
  color: rgba(53, 59, 102, 0.7);
  text-wrap: pretty;
}

.ax-path__intro strong {
  font-weight: 500;
}

/* ---------- karty procesu ---------- */
.ax-path__steps {
  list-style: none;
  margin: clamp(28px, 3.4vw, 52px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(10px, 1.2vw, 18px);
}

/*
 * Kolumna zamiast siatki: stopka z czasem trwania ma zostac przy dolnej
 * krawedzi rowniez wtedy, gdy sasiad w wierszu jest wyzszy od tresci karty.
 * Przy dlugosciach z prototypu tresc wypelnia min-height, wiec render jest
 * taki sam jak w zrodle.
 */
.ax-path__step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: clamp(18px, 1.8vw, 26px);
  border-radius: var(--ax-radius);
  border: 1px solid rgba(53, 59, 102, 0.16);
  background: rgba(255, 255, 255, 0.35);
  min-height: clamp(180px, 15vw, 230px);
  opacity: 0;
  transform: translateY(14px);
  /* Opoznienie tylko na wejsciu - hover nie moze ruszac z kaskadowa zwloka. */
  transition:
    opacity 0.7s var(--ax-path-e) calc(var(--i, 0) * 0.08s),
    transform 0.8s var(--ax-path-e) calc(var(--i, 0) * 0.08s),
    background 0.4s ease,
    border-color 0.4s ease,
    color 0.4s ease;
}

.ax-path__steps.is-in .ax-path__step {
  opacity: 1;
  transform: none;
}

.ax-path__icon {
  display: block;
  margin: -6px 0 6px -6px;
}

.ax-path__icon svg {
  display: block;
  width: clamp(44px, 4vw, 56px);
  height: auto;
  fill: none;
  stroke: var(--ax-navy);
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.4s ease;
}

.ax-path__num {
  position: absolute;
  top: 18px;
  right: 20px;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  font-style: normal;
  color: rgba(53, 59, 102, 0.45);
  transition: color 0.4s ease;
}

.ax-path__title {
  margin: 0;
  font-size: clamp(16px, 1.25vw, 19px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.ax-path__body {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(53, 59, 102, 0.65);
  transition: color 0.4s ease;
  text-wrap: pretty;
}

.ax-path__duration {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(53, 59, 102, 0.14);
  font-size: 9.5px;
  font-weight: 500;
  font-style: normal;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(53, 59, 102, 0.5);
  transition: color 0.4s ease, border-color 0.4s ease;
}

@media (hover: hover) and (pointer: fine) {
  .ax-path__step:hover {
    background: var(--ax-navy);
    border-color: var(--ax-navy);
    color: var(--ax-paper);
  }

  .ax-path__step:hover .ax-path__icon svg {
    stroke: var(--ax-steel-light);
  }

  .ax-path__step:hover .ax-path__body {
    color: rgba(244, 241, 235, 0.7);
  }

  .ax-path__step:hover .ax-path__num,
  .ax-path__step:hover .ax-path__duration {
    color: rgba(244, 241, 235, 0.55);
  }

  .ax-path__step:hover .ax-path__duration {
    border-color: rgba(244, 241, 235, 0.2);
  }
}

/* ---------- kalkulator raty ---------- */
.ax-path__aside {
  position: sticky;
  top: 110px;
  min-width: 0;
}

.ax-path__calc {
  display: grid;
  gap: 22px;
  padding: clamp(22px, 2.6vw, 36px);
  border-radius: var(--ax-radius);
  background: var(--ax-navy);
  color: var(--ax-paper);
}

.ax-path__calc-label {
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(244, 241, 235, 0.5);
}

.ax-path__field {
  display: grid;
  gap: 10px;
}

.ax-path__field-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
  color: rgba(244, 241, 235, 0.7);
}

.ax-path__field-value {
  color: var(--ax-paper);
  font-weight: 500;
  white-space: nowrap;
}

.ax-path__range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  margin: 0;
  background: rgba(244, 241, 235, 0.3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.ax-path__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ax-paper);
  border: 4px solid var(--ax-navy);
  box-shadow: 0 0 0 1px rgba(244, 241, 235, 0.6);
  cursor: pointer;
}

.ax-path__range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ax-paper);
  border: 4px solid var(--ax-navy);
  box-shadow: 0 0 0 1px rgba(244, 241, 235, 0.6);
  cursor: pointer;
}

.ax-path__range:focus-visible {
  outline: 2px solid var(--ax-steel-light);
  outline-offset: 8px;
}

.ax-path__out {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(244, 241, 235, 0.2);
  padding-top: 20px;
}

/* Bez tabular-nums: projekt trzyma kwote w proporcjonalnych cyfrach. */
.ax-path__rata {
  display: block;
  font-size: clamp(36px, 3.6vw, 56px);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 1;
}

.ax-path__note {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(244, 241, 235, 0.6);
}

.ax-path__cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 26px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--ax-paper);
  color: var(--ax-ink);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.4s ease, color 0.4s ease, transform 0.5s var(--ax-path-e);
}

@media (hover: hover) and (pointer: fine) {
  .ax-path__cta:hover {
    background: var(--ax-steel-light);
    color: var(--ax-ink);
    transform: translateY(-2px);
  }
}

/* ---------- responsywnosc (progi z prototypu) ---------- */
@media (max-width: 1100px) {
  .ax-path__steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  /* Kalkulator schodzi pod proces, wiec przyklejanie traci sens. */
  .ax-path__layout {
    grid-template-columns: 1fr;
  }

  .ax-path__aside {
    position: static;
  }
}

@media (max-width: 560px) {
  .ax-path__steps {
    grid-template-columns: 1fr;
  }

  .ax-path__step {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ax-path [data-anim],
  .ax-path__step {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
