/* =========================================================
   DigitalShri – Process Steps (Elementor widget "DS Process Steps")
   Same design as the homepage "Our Simple 4-Step Process" wave timeline.
   Brand colours only (greys/lavenders are tints of the brand colours).
   Colours are CSS variables so the Style tab can change them.
   ========================================================= */
.dsp-flow {
  --f-primary: #851CF2;
  --f-secondary: #1E51F1;
  --f-text: #17181C;
  --f-accent: #F38218;
  --f-muted: rgba(23, 24, 28, 0.7);
  font-family: "Montserrat", sans-serif;
  color: var(--f-text);
  background: #fff;
  padding: 64px 20px 56px;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
.dsp-flow *, .dsp-flow *::before, .dsp-flow *::after { box-sizing: border-box; }

/* soft background blobs */
.dsp-flow::before, .dsp-flow::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
  pointer-events: none;
}
.dsp-flow::before {
  width: 520px; height: 520px; left: -200px; top: 120px;
  background: radial-gradient(circle, rgba(133, 28, 242, .08), transparent 65%);
}
.dsp-flow::after {
  width: 520px; height: 520px; right: -200px; bottom: -120px;
  background: radial-gradient(circle, rgba(243, 130, 24, .09), transparent 65%);
}

.dsp-flow .f-inner { max-width: 1200px; margin: 0 auto; position: relative; z-index: 1; }

/* ---------- Header ---------- */
.dsp-flow .f-head { text-align: center; max-width: 640px; margin: 0 auto 28px; }
.dsp-flow .f-badge {
  display: inline-block;
  padding: 7px 18px;
  border: 1.5px solid var(--f-primary);
  border-radius: 50px;
  color: var(--f-primary);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .3px;
}
.dsp-flow .f-title {
  margin: 18px 0 14px;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.18;
  color: var(--f-text);
  letter-spacing: -.5px;
}
.dsp-flow .f-title span {
  background: linear-gradient(90deg, var(--f-primary), var(--f-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.dsp-flow .f-sub {
  margin: 0 auto;
  max-width: 520px;
  color: var(--f-muted);
  font-size: 16px;
  line-height: 1.7;
}

.dsp-flow.f-no-anim .f-up, .dsp-flow.f-no-anim .f-card, .dsp-flow.f-no-anim .f-node { transition: none !important; }

/* header reveal (only once the script runs, so the text never stays hidden) */
.dsp-flow.is-ready .f-up { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.dsp-flow.is-ready .f-up.is-in { opacity: 1; transform: none; }
.dsp-flow .f-up:nth-child(2) { transition-delay: .1s; }
.dsp-flow .f-up:nth-child(3) { transition-delay: .2s; }

/* ---------- Wave stage (desktop) ---------- */
.dsp-flow .f-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1200 / 430;
  margin-top: 60px;
}
.dsp-flow .f-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.dsp-flow .f-s1 { stop-color: var(--f-g1, var(--f-primary)); }
.dsp-flow .f-s2 { stop-color: var(--f-g2, var(--f-secondary)); }
.dsp-flow .f-s3 { stop-color: var(--f-g3, var(--f-accent)); }
.dsp-flow .f-track { fill: none; stroke: var(--f-track, rgba(133, 28, 242, .1)); stroke-width: 3; stroke-dasharray: 2 10; stroke-linecap: round; }
.dsp-flow .f-line  { fill: none; stroke-width: 4; stroke-linecap: round; } /* stroke = gradient (set on the element) */
.dsp-flow .f-runner { opacity: 0; transition: opacity .6s ease; }
.dsp-flow.is-drawn .f-runner { opacity: 1; }
.dsp-flow .f-runner-glow { fill: var(--f-primary); }
.dsp-flow .f-runner-dot { fill: #fff; stroke: var(--f-primary); }

/* step node */
.dsp-flow .f-step { position: absolute; }
.dsp-flow .f-node {
  position: absolute;
  width: 68px;
  height: 68px;
  margin: -34px 0 0 -34px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(23, 24, 28, .10), 0 2px 6px rgba(23, 24, 28, .06);
  display: grid;
  place-items: center;
  transition: transform .6s cubic-bezier(.34, 1.7, .64, 1);
  z-index: 2;
}
.dsp-flow.is-ready .f-node { transform: scale(0) rotate(-20deg); }
.dsp-flow .f-node svg { width: 30px; height: 30px; }
.dsp-flow .f-node i { font-size: 26px; }
.dsp-flow .f-node::before {           /* pulse ring */
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 20px;
  border: 2px solid var(--c);
  opacity: 0;
}
.dsp-flow .f-node::after {            /* small number dot */
  content: attr(data-num);
  position: absolute;
  top: -9px; right: -9px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--c);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
}
.dsp-flow.is-ready .f-step.is-on .f-node { transform: scale(1) rotate(0); }
.dsp-flow .f-step.is-on .f-node::before { animation: dspPulse 2.4s ease-out .4s infinite; }
@keyframes dspPulse {
  0%   { opacity: .7; transform: scale(1); }
  100% { opacity: 0;  transform: scale(1.6); }
}
.dsp-flow.is-ready .f-step.is-on:hover .f-node { transform: scale(1.08) rotate(-4deg); }

/* step text */
.dsp-flow .f-card {
  position: absolute;
  width: 300px;
  margin-left: -150px;
  transition: opacity .6s ease .2s, transform .6s ease .2s;
}
.dsp-flow.is-ready .f-card { opacity: 0; }
.dsp-flow .f-step.up   .f-card { bottom: 48px; }   /* text above node */
.dsp-flow .f-step.down .f-card { top: 48px; }      /* text below node */
.dsp-flow.is-ready .f-step.up   .f-card { transform: translateY(-18px); }
.dsp-flow.is-ready .f-step.down .f-card { transform: translateY(18px); }
.dsp-flow.is-ready .f-step.is-on .f-card { opacity: 1; transform: none; }
/* 5–6 steps: narrower cards so they don't overlap */
.dsp-flow[data-count="5"] .f-card,
.dsp-flow[data-count="6"] .f-card { width: 210px; margin-left: -105px; }
/* last card shifted left so it never overflows the right edge on smaller desktops */
@media (min-width: 992px) {
  .dsp-flow .f-step:last-child .f-card { margin-left: -220px; }
  .dsp-flow[data-count="5"] .f-step:last-child .f-card,
  .dsp-flow[data-count="6"] .f-step:last-child .f-card { margin-left: -160px; }
}

.dsp-flow .f-num {
  position: absolute;
  right: -4px;
  top: -64px;
  font-size: 96px;
  font-weight: 800;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(133, 28, 242, .18);
  background: linear-gradient(180deg, rgba(133, 28, 242, .10), rgba(30, 81, 241, 0));
  -webkit-background-clip: text;
  background-clip: text;
  z-index: -1;
  pointer-events: none;
  user-select: none;
}
.dsp-flow .f-step-title {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 700;
  color: var(--f-text);
  line-height: 1.3;
}
.dsp-flow .f-step-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--f-muted);
}

/* step colours */
.dsp-flow .f-step[data-c="violet"] { --c: var(--f-primary); }
.dsp-flow .f-step[data-c="blue"]   { --c: var(--f-secondary); }
.dsp-flow .f-step[data-c="orange"] { --c: var(--f-accent); }
.dsp-flow .f-node svg, .dsp-flow .f-node i { color: var(--c); }
.dsp-flow .f-node .e-font-icon-svg { width: 28px; height: 28px; fill: var(--c); }

/* mobile snake line hidden on desktop */
.dsp-flow .f-msvg { display: none; }

/* ---------- Tablet / Mobile: zig-zag snake wave ---------- */
@media (max-width: 991px) {
  .dsp-flow { padding: 80px 16px; }
  .dsp-flow .f-stage { aspect-ratio: auto; max-width: 560px; margin: 56px auto 0; }
  .dsp-flow .f-svg { display: none; }
  .dsp-flow .f-steps { position: relative; padding: 10px 0; }

  .dsp-flow .f-msvg {
    display: block;
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: visible;
    z-index: 0;
    pointer-events: none;
  }
  .dsp-flow .f-mtrack { fill: none; stroke: var(--f-track, rgba(133, 28, 242, .12)); stroke-width: 3; stroke-dasharray: 2 9; stroke-linecap: round; }
  .dsp-flow .f-mline  { fill: none; stroke-width: 4; stroke-linecap: round; }

  .dsp-flow .f-step {
    position: relative !important;
    left: auto !important; top: auto !important;
    display: grid;
    grid-template-columns: 64px 1fr;
    align-items: center;
    gap: 16px;
    margin-bottom: 64px;
    z-index: 1;
  }
  .dsp-flow .f-step:last-child { margin-bottom: 0; }
  /* even steps: node on the right, card on the left */
  .dsp-flow .f-step.up { grid-template-columns: 1fr 64px; }
  .dsp-flow .f-step.up .f-node { order: 2; }

  .dsp-flow .f-node { position: relative; margin: 0; width: 64px; height: 64px; }

  .dsp-flow .f-card,
  .dsp-flow[data-count="5"] .f-card,
  .dsp-flow[data-count="6"] .f-card {
    position: relative;
    width: auto; margin: 0;
    top: auto !important; bottom: auto !important;
    padding: 20px 20px 18px;
    background: var(--f-card-bg, #fff);
    border-radius: 18px;
    border: 1px solid var(--f-card-border, rgba(133, 28, 242, .08));
    box-shadow: 0 16px 36px rgba(23, 24, 28, .08);
    overflow: hidden;
    isolation: isolate;
  }
  .dsp-flow .f-card::before {                 /* coloured edge */
    content: "";
    position: absolute;
    top: 18px; bottom: 18px;
    width: 4px;
    border-radius: 4px;
    background: var(--c);
  }
  .dsp-flow .f-step.down .f-card::before { left: 0; }
  .dsp-flow .f-step.up   .f-card::before { right: 0; }
  .dsp-flow .f-step.up   .f-card { text-align: right; }

  .dsp-flow.is-ready .f-step.down .f-card { transform: translateX(40px); }
  .dsp-flow.is-ready .f-step.up   .f-card { transform: translateX(-40px); }
  .dsp-flow.is-ready .f-step.is-on .f-card { transform: none; }

  .dsp-flow .f-num { font-size: 76px; top: -10px; }
  .dsp-flow .f-step.down .f-num { right: 10px; left: auto; }
  .dsp-flow .f-step.up   .f-num { left: 10px; right: auto; }
}
@media (max-width: 480px) {
  .dsp-flow .f-step, .dsp-flow .f-step.down { grid-template-columns: 54px 1fr; gap: 12px; }
  .dsp-flow .f-step.up { grid-template-columns: 1fr 54px; }
  .dsp-flow .f-node { width: 54px; height: 54px; border-radius: 15px; }
  .dsp-flow .f-node svg { width: 24px; height: 24px; }
  .dsp-flow .f-card { padding: 18px 16px 16px; }
  .dsp-flow .f-step-title { font-size: 17px; }
  .dsp-flow .f-step-text { font-size: 13.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .dsp-flow .f-up, .dsp-flow .f-card, .dsp-flow .f-node { transition: none !important; }
  .dsp-flow .f-node::before { animation: none !important; }
}
