.how-it-works {
  padding: 20px 20px;
  color: #fff;
}

.how-it-works__title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 50px;
  color: #fff;
}

.how-it-works__layout {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  width: 100%;
}

.how-it-works__preview {
  justify-self: end;
}

.how-it-works__preview img {
  max-width: 160px;
  height: auto;
  border-radius: 10px;
  transition: transform 0.3s ease;
  box-shadow: 0 0 12px #00000044;
}

.how-it-works__preview a:hover img {
  transform: scale(1.05);
}

.how-it-works__steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* две колонки */
  gap: 20px;
  counter-reset: step-counter;
}

.how-it-works__step {
  position: relative;
  background: #1a1d26;
  border-radius: 16px;
  padding: 0 12px 0 80px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  counter-increment: step-counter;
  border-left: 5px solid #8358ff;
  transition: border-color 0.3s, box-shadow 0.3s;
  box-shadow: 0 0 0 transparent;
}

.how-it-works__step:hover {
  border-color: #a27cff;
  box-shadow: 0 0 12px #8358ff55;
}

.how-it-works__step::before {
  content: counter(step-counter);
  position: absolute;
  top: 50%;
  left: 24px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: #8358ff;
  color: #fff;
  font-weight: bold;
  font-size: 1rem;
  line-height: 36px;
  text-align: center;
  border-radius: 50%;
  box-shadow: 0 0 10px #8358ff88;
}
.how-it-works__step:nth-child(odd)::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -12px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid #8358ff;
}
  .how-it-works__step:last-child::after {
    display: none;
  }
.how-it-works__content {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.how-it-works__icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #2a2e3b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.how-it-works__icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.how-it-works__step-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: #fff;
}

.how-it-works__description {
  font-size: 1rem;
  color: #cfd2d6;
  line-height: 1.6;
}

.how-it-works__image img {
  width: 100%;
  max-width: 540px;
  border-radius: 10px;
  display: block;
  margin-top: 12px;
}

.lightbox {
  position: fixed;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  box-shadow: 0 0 20px #000;
}

.lightbox .close {
  position: absolute;
  top: 24px;
  right: 32px;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
  z-index: 10000;
}

@media (max-width: 768px) {
  .how-it-works__steps {
    grid-template-columns: 1fr;
  }

  .how-it-works__step {
    display: flex;
    flex-direction: column;
    padding: 16px;
    text-align: left;
    position: relative;
  }

  .how-it-works__step::before {
    left: 16px;
    top: 16px;
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
    line-height: 28px;
  }

  .how-it-works__step::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -20px;
    width: 2px;
    height: 20px;
    background: #8358ff;
    transform: translateX(-50%);
  }

  .how-it-works__step:last-child::after {
    display: none;
  }

  .how-it-works__content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .how-it-works__text {
    width: 100%;
  }

  .how-it-works__icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }

  .how-it-works__icon img {
    width: 28px;
    height: 28px;
  }

  .how-it-works__step-title {
    font-size: 1.3rem;
  }

  .how-it-works__description {
    font-size: 0.95rem;
    line-height: 1.5;
    width: 100%;
    word-break: normal;
    white-space: normal;
  }

  .how-it-works__step img {
    max-width: 80%;
    margin-top: 16px;
    align-self: center;
  }

  .how-it-works__layout {
    display: flex;          
    flex-direction: column; /* контент сверху, картинка ниже */
    gap: 16px;
    width: 100%;
  }

  .how-it-works__preview {
    align-self: center; 
    max-width: 80%;
  }
}


