﻿/* =============================================================
   Step — секция «Как мы работаем»
   ============================================================= */

.steps-section {
  padding: 80px 0 100px;
  background: var(--color-why-card-bg);
}

.steps-section__title {
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary-dark);
  margin: 0 0 48px;
}

/* Соединительная линия с точками */

/* Каждая карточка рисует свою точку по центру сверху */
.step-card::before {
  content: '';
  position: absolute;
  top: -21px;          /* центр точки (14px) в 28px-зоне над карточкой: (28-14)/2 = 7px от верха зоны, т.е. -21px от верха карточки */
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-secondary);
  z-index: 1;
}

/* Карточки шагов */

.steps-section__grid {
  display: flex;
  gap: 30px;
  position: relative;
  padding-top: 28px;   /* место над карточками для точек */
}

/* Линия проходит между центрами крайних точек */
.steps-section__grid::before {
  content: '';
  position: absolute;
  top: 14px;                      /* центр 28px-зоны = 14px от верха грида */
  left: calc(330px / 2);          /* центр первой карточки */
  width: calc(3 * (330px + 30px)); /* 3 шага × (ширина карточки + gap) = 1080px */
  border-top: 1px dashed var(--color-secondary);
  z-index: 0;
}

.step-card {
  flex: 0 0 330px;
  width: 330px;
  position: relative;
  min-height: 234px;
  background: var(--color-bg);
  border-radius: var(--border-radius-card);
  padding: 25px 30px;
  box-shadow: 0 2px 16px 0 rgba(20, 60, 108, 0.07);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.step-card__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--border-radius-btn);
  background: var(--color-secondary);
  color: var(--color-text-inverse);
  font-size: var(--font-size-label);
  font-weight: var(--font-weight-bold);
  margin-bottom: 16px;
  flex-shrink: 0;
}

.step-card__title {
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  margin: 0 0 12px;
  text-align: center;
  line-height: var(--line-height-base);
}

.step-card__desc {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  color: var(--color-primary);
  margin: 0;
  text-align: center;
  line-height: var(--line-height-base);
}

/* === Mobile === */
@media (max-width: 767px) {
  .steps-section__grid::before,
  .step-card::before {
    display: none;
  }

  .steps-section__grid {
    flex-direction: column;
    gap: 10px;
    padding-top: 0;
  }

  .step-card {
    flex: none;
    width: 100%;
    min-height: auto;
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    padding: 15px;
    gap: 15px;
  }

  .step-card__badge {
    flex-shrink: 0;
    width: 37px;
    height: 37px;
    font-size: 0.875rem; /* 14px */
    margin-bottom: 0;
  }

  .step-card__body {
    flex: 1;
    min-width: 0;
  }

  .step-card__title {
    font-size: 0.875rem; /* 14px */
    text-align: left;
  }

  .step-card__desc {
    font-size: 0.75rem; /* 12px */
    text-align: left;
  }
}
