/* Process section — scroll-linked organic path (scroll-storyteller draw-path pattern) */

.how-it-works.process-enhanced {
  --process-progress: 0;
  position: relative;
  overflow: visible;
  background: transparent;
}

.how-it-works.process-enhanced::before {
  display: none;
}

.how-it-works.process-enhanced::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 120px;
  width: min(680px, 90vw);
  height: calc(100% - 160px);
  transform: translateX(-50%);
  border-radius: 48px;
  border: 1px solid rgba(99, 102, 241, 0.06);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.65) 0%,
    rgba(255, 255, 255, 0.15) 100%
  );
  pointer-events: none;
  z-index: 0;
}

.how-it-works.process-enhanced .landing-container {
  position: relative;
  z-index: 1;
}

.how-it-works.process-enhanced .section-header {
  margin-bottom: 8px;
}

.process-timeline-wrap {
  position: relative;
  max-width: 1080px;
  min-height: 960px;
  margin: 48px auto 0;
  padding: 16px 12px 48px;
}

.process-path-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}

.process-enhanced .steps {
  position: relative;
  z-index: 1;
  display: block;
  max-width: none;
  min-height: inherit;
  margin: 0;
  padding: 0;
}

.process-enhanced .steps > div,
.process-enhanced .process-step-slot {
  position: absolute;
  margin: 0;
  padding: 0;
}

.process-enhanced .step-connector {
  display: none !important;
}

/* —— Step cards —— */

.process-enhanced .step {
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 26px 28px 28px;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

.process-enhanced .step.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.process-enhanced .step.is-active {
  border-color: var(--primary-light, #818cf8);
  box-shadow:
    var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1)),
    0 0 0 1px rgba(99, 102, 241, 0.14),
    0 12px 40px rgba(99, 102, 241, 0.12);
  z-index: 2;
  transform: translateY(-4px);
}

.process-enhanced .step.is-visible.is-active {
  transform: translateY(-4px);
}

.process-enhanced .step.is-complete {
  border-color: rgba(99, 102, 241, 0.28);
}

/* —— Badge / номер шага —— */

.process-step-badge {
  position: relative;
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.process-step-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--gray-200, #e5e7eb);
  background: var(--white, #fff);
  transition:
    border-color 0.35s ease,
    background 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.35s ease;
}

.process-enhanced .step.is-active .process-step-ring {
  border-color: var(--primary, #6366f1);
  box-shadow:
    0 0 0 5px rgba(99, 102, 241, 0.12),
    0 0 24px rgba(99, 102, 241, 0.25);
  animation: processRingPulse 2.2s ease-in-out infinite;
}

.process-enhanced .step.is-complete .process-step-ring {
  border-color: var(--primary-light, #818cf8);
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.14) 0%,
    rgba(139, 92, 246, 0.1) 100%
  );
}

.process-step-check {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary, #6366f1);
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  z-index: 2;
}

.process-enhanced .step.is-complete .process-step-check {
  opacity: 1;
  transform: scale(1);
}

.process-enhanced .step.is-complete .step-number {
  opacity: 0;
}

.process-enhanced .step-number {
  position: relative;
  z-index: 1;
  min-width: auto;
  font-size: 1.85rem;
  line-height: 1;
  transition: opacity 0.25s ease;
}

.process-enhanced .step-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  transition: color 0.3s ease;
}

.process-enhanced .step-content p {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--gray-500, #6b7280);
}

.process-enhanced .step.is-active .step-content h3 {
  color: var(--primary-dark, #4f46e5);
}

/* —— SVG path (draw-path) —— */

.process-path-track {
  fill: none;
  stroke: var(--gray-200, #e5e7eb);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}

.process-path-glow {
  fill: none;
  stroke: url(#planovoProcessGrad);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.35;
}

.process-path-line {
  fill: none;
  stroke: url(#planovoProcessGrad);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.process-path-node {
  fill: var(--white, #fff);
  stroke: var(--gray-300, #d1d5db);
  stroke-width: 2;
  opacity: 0.9;
  transition:
    fill 0.3s ease,
    stroke 0.3s ease,
    r 0.3s ease;
}

.process-path-node.is-complete {
  fill: rgba(99, 102, 241, 0.2);
  stroke: var(--primary-light, #818cf8);
}

.process-path-node.is-active {
  fill: var(--primary, #6366f1);
  stroke: var(--white, #fff);
  stroke-width: 2.5;
}

.process-path-dot-halo {
  fill: rgba(99, 102, 241, 0.22);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.process-path-dot {
  fill: var(--white, #fff);
  stroke: url(#planovoProcessGrad);
  stroke-width: 3;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.process-enhanced.is-in-view .process-path-dot,
.process-enhanced.is-in-view .process-path-dot-halo {
  opacity: 1;
}

@keyframes processRingPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 5px rgba(99, 102, 241, 0.12),
      0 0 20px rgba(99, 102, 241, 0.2);
  }
  50% {
    box-shadow:
      0 0 0 8px rgba(99, 102, 241, 0.08),
      0 0 32px rgba(99, 102, 241, 0.35);
  }
}

/* —— Responsive —— */

@media (max-width: 1024px) {
  .process-timeline-wrap {
    max-width: 100%;
    min-height: 900px;
  }

  .how-it-works.process-enhanced::after {
    width: 96%;
    border-radius: 32px;
  }
}

@media (max-width: 768px) {
  .process-timeline-wrap {
    min-height: 0 !important;
    margin-top: 24px;
    padding: 8px 4px 32px;
  }

  .process-timeline-wrap.process-timeline-stack,
  .process-enhanced .process-timeline-wrap {
    min-height: 0 !important;
  }

  .process-enhanced .process-step-slot {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    margin-bottom: 20px;
  }

  .process-enhanced .process-step-slot:last-child {
    margin-bottom: 0;
  }

  .process-path-svg {
    opacity: 1;
  }

  .process-enhanced .step {
    padding: 20px 20px 22px;
  }

  .process-step-badge {
    width: 56px;
    height: 56px;
  }

  .process-enhanced .step-number {
    font-size: 1.55rem;
  }

  .process-path-line {
    stroke-width: 3;
  }

  .how-it-works.process-enhanced::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .process-enhanced .step,
  .process-step-ring,
  .process-path-node {
    transition: none;
    animation: none !important;
  }

  .process-enhanced .step {
    opacity: 1;
    transform: none;
  }

  .process-path-line,
  .process-path-glow {
    stroke-dashoffset: 0 !important;
  }

  .process-path-dot,
  .process-path-dot-halo {
    opacity: 0;
  }
}
