/* ==========================================================
   how-we-work.css — خطوات العمل (أرقام ذكية)
   ========================================================== */
:root {
  --ebmnt1-how-background-color: var(--ebmnt1-color-white);
  --ebmnt1-how-card-background-color: var(--ebmnt1-color-secondary);
  --ebmnt1-how-card-border-color: var(--ebmnt1-color-border-on-dark);
  --ebmnt1-how-card-active-border-color: var(--ebmnt1-color-primary);
  --ebmnt1-how-card-active-ring-color: var(--ebmnt1-color-primary-soft);
  --ebmnt1-how-card-glow-color: rgba(91, 87, 231, 0.28);
  --ebmnt1-how-card-title-color: var(--ebmnt1-color-white);
  --ebmnt1-how-card-text-color: var(--ebmnt1-color-text-on-dark);
  --ebmnt1-how-numeral-stroke-color: rgba(164, 147, 255, 0.55);
  --ebmnt1-how-numeral-fill-gradient: linear-gradient(180deg, var(--ebmnt1-color-primary-light), var(--ebmnt1-color-primary) 55%, var(--ebmnt1-color-accent-sky));
  --ebmnt1-how-numeral-glow-color: rgba(91, 87, 231, 0.55);
  --ebmnt1-how-connector-color: var(--ebmnt1-color-border-violet);
  --ebmnt1-how-connector-progress-color: var(--ebmnt1-color-primary);
  --ebmnt1-how-node-background-color: var(--ebmnt1-color-white);
  --ebmnt1-how-node-border-color: var(--ebmnt1-color-primary);
  --ebmnt1-how-icon-badge-background-color: var(--ebmnt1-color-white-soft);
  --ebmnt1-how-icon-badge-border-color: var(--ebmnt1-color-border-on-dark);
  --ebmnt1-how-icon-badge-icon-color: var(--ebmnt1-color-primary-light);

  --ebmnt1-how-steps-gap: 3rem;
  --ebmnt1-how-numeral-size: clamp(4.5rem, 3rem + 6vw, 7.5rem);
  --ebmnt1-how-numeral-stroke-width: 2px;
  --ebmnt1-how-tilt-x: 0deg;
  --ebmnt1-how-tilt-y: 0deg;
}

.ebmnt1-how {
  background-color: var(--ebmnt1-how-background-color);
}

.ebmnt1-how__inner {
  gap: 3rem;
}

.ebmnt1-how__steps {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--ebmnt1-how-steps-gap);
}

.ebmnt1-step-card {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.75rem 1.5rem 1.75rem;
  border: 1px solid var(--ebmnt1-how-card-border-color);
  border-radius: var(--ebmnt1-radius-panel);
  background-color: var(--ebmnt1-how-card-background-color);
  text-align: start;
  transform-style: preserve-3d;
  transition: border-color var(--ebmnt1-transition-duration) var(--ebmnt1-transition-easing),
    box-shadow var(--ebmnt1-transition-duration) var(--ebmnt1-transition-easing),
    opacity var(--ebmnt1-transition-duration) var(--ebmnt1-transition-easing);
}

.ebmnt1-step-card.ebmnt1-is-active {
  border-color: var(--ebmnt1-how-card-active-border-color);
  box-shadow: 0 0 0 4px var(--ebmnt1-how-card-active-ring-color), 0 24px 48px var(--ebmnt1-how-card-glow-color);
}

/* ---------- Numeral ---------- */
.ebmnt1-step-card__top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ebmnt1-step-card__numeral {
  position: relative;
  font-size: var(--ebmnt1-how-numeral-size);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  color: transparent;
  -webkit-text-stroke: var(--ebmnt1-how-numeral-stroke-width) var(--ebmnt1-how-numeral-stroke-color);
  transform: perspective(600px) rotateX(var(--ebmnt1-how-tilt-x)) rotateY(var(--ebmnt1-how-tilt-y));
  transition: transform 0.2s ease-out, filter var(--ebmnt1-transition-duration) var(--ebmnt1-transition-easing);
  direction: ltr;
}

.ebmnt1-step-card__numeral::before {
  content: attr(data-number);
  position: absolute;
  inset: 0;
  background-image: var(--ebmnt1-how-numeral-fill-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 0;
  clip-path: inset(100% 0 0 0);
  transition: clip-path 0.9s var(--ebmnt1-transition-easing);
}

.ebmnt1-step-card.ebmnt1-is-done .ebmnt1-step-card__numeral::before,
.ebmnt1-step-card.ebmnt1-is-active .ebmnt1-step-card__numeral::before {
  clip-path: inset(0 0 0 0);
}

.ebmnt1-step-card.ebmnt1-is-active .ebmnt1-step-card__numeral {
  filter: drop-shadow(0 0 16px var(--ebmnt1-how-numeral-glow-color));
}

.ebmnt1-step-card__icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--ebmnt1-how-icon-badge-border-color);
  border-radius: 12px;
  background-color: var(--ebmnt1-how-icon-badge-background-color);
  color: var(--ebmnt1-how-icon-badge-icon-color);
  font-size: 1.2rem;
}

.ebmnt1-step-card__title {
  font-size: var(--ebmnt1-font-size-card-title);
  color: var(--ebmnt1-how-card-title-color);
}

.ebmnt1-step-card__text {
  font-size: var(--ebmnt1-font-size-body);
  color: var(--ebmnt1-how-card-text-color);
}

/* ---------- Connector between cards ---------- */
.ebmnt1-step-card:not(:last-child)::before {
  content: "";
  position: absolute;
  inset-inline-start: 2.25rem;
  top: 100%;
  width: 2px;
  height: var(--ebmnt1-how-steps-gap);
  background-image: linear-gradient(to bottom, var(--ebmnt1-how-connector-progress-color), var(--ebmnt1-how-connector-progress-color));
  background-repeat: no-repeat;
  background-size: 100% 0;
  background-color: var(--ebmnt1-how-connector-color);
  transition: background-size 0.9s var(--ebmnt1-transition-easing);
}

.ebmnt1-step-card.ebmnt1-is-done:not(:last-child)::before {
  background-size: 100% 100%;
}

.ebmnt1-step-card:not(:last-child)::after {
  content: "";
  position: absolute;
  inset-inline-start: calc(2.25rem - 5px);
  top: calc(100% + var(--ebmnt1-how-steps-gap) / 2 - 6px);
  width: 12px;
  height: 12px;
  border: 2px solid var(--ebmnt1-how-node-border-color);
  border-radius: 50%;
  background-color: var(--ebmnt1-how-node-background-color);
}

@media (min-width: 768px) {
  .ebmnt1-how__steps {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .ebmnt1-step-card {
    flex: 1 1 calc(50% - var(--ebmnt1-how-steps-gap));
  }

  .ebmnt1-step-card:not(:last-child)::before,
  .ebmnt1-step-card:not(:last-child)::after {
    display: none;
  }
}

@media (min-width: 1024px) {
  :root {
    --ebmnt1-how-steps-gap: 2.5rem;
  }

  .ebmnt1-how__steps {
    flex-wrap: nowrap;
  }

  .ebmnt1-step-card {
    flex: 1 1 0;
    padding: 2.25rem 1.75rem 2rem;
  }

  .ebmnt1-step-card:not(:last-child)::before,
  .ebmnt1-step-card:not(:last-child)::after {
    display: block;
  }

  /* خط أفقي بين الكروت عند مستوى الرقم */
  .ebmnt1-step-card:not(:last-child)::before {
    inset-inline-start: auto;
    inset-inline-end: calc(var(--ebmnt1-how-steps-gap) * -1);
    top: 4.25rem;
    width: var(--ebmnt1-how-steps-gap);
    height: 2px;
    background-image: linear-gradient(to left, var(--ebmnt1-how-connector-progress-color), var(--ebmnt1-how-connector-progress-color));
    background-size: 0 100%;
    background-position: right center;
  }

  .ebmnt1-step-card.ebmnt1-is-done:not(:last-child)::before {
    background-size: 100% 100%;
  }

  .ebmnt1-step-card:not(:last-child)::after {
    inset-inline-start: auto;
    inset-inline-end: calc(var(--ebmnt1-how-steps-gap) * -1 + (var(--ebmnt1-how-steps-gap) / 2) - 6px);
    top: calc(4.25rem - 5px);
  }
}
