/* ========================================
   5カード構成ステップセクション
   改善から成長までのワンストップ支援
======================================== */

.steps {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 20px 64px;
}

.steps__head {
  text-align: center;
  margin-bottom: 36px;
}

.steps__head h2 {
  font-size: 28px;
  line-height: 1.25;
  margin: 0 0 12px;
  font-weight: 800;
  color: #0b1b3a;
}

.steps__head p {
  margin: 0;
  color: #41506a;
  font-size: 14px;
  line-height: 1.7;
  max-width: 900px;
  margin: 0 auto;
}

.steps__grid {
  display: grid;
  gap: 16px;
  align-items: stretch;
}

/* 5 cards: desktop = 5 columns */
.steps__grid--5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* Card base */
.card {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(200, 215, 240, 0.85);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(12, 35, 80, 0.10);
  padding: 20px 18px 18px;
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 56px rgba(12, 35, 80, 0.15);
  border-color: rgba(43, 102, 255, 0.4);
}

.card__head {
  margin-bottom: 0;
}

.badge {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.badge__icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(180deg, #e9f2ff, #d7e8ff);
  box-shadow: 0 10px 18px rgba(22, 66, 142, 0.18);
  font-size: 18px;
  flex-shrink: 0;
}

.badge__step {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  color: #2b66ff;
}

.card__title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 800;
  color: #0b1b3a;
  line-height: 1.3;
}

.card__sub {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  color: #51627d;
}

/* STEP05 accent (控えめに"重要感"を出す) */
.card--accent {
  border-color: rgba(120, 180, 255, 0.85);
  box-shadow: 0 22px 55px rgba(45, 120, 255, 0.18);
  background: rgba(255, 255, 255, 0.85);
}

.card--accent:hover {
  border-color: rgba(43, 102, 255, 0.65);
}

.badge__icon--accent {
  background: linear-gradient(180deg, #dff3ff, #c9f0ff);
}

/* Note */
.steps__note {
  margin-top: 24px;
  text-align: center;
  padding: 14px 18px;
  background: rgba(255, 238, 191, 0.55);
  border: 1px solid rgba(255, 198, 70, 0.55);
  border-radius: 14px;
  font-size: 13px;
  color: #5b4a1f;
  font-weight: 700;
}

/* ========================================
   STEP番号マーカー（円形・優先度表示）
======================================== */
.card {
  position: relative;
}

.card__step-marker {
  position: absolute;
  top: -12px;
  left: 16px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  color: #fff;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(43, 102, 255, 0.25);
}

/* デフォルト：非アクティブ */
.card__step-marker {
  background: linear-gradient(135deg, rgba(180, 200, 230, 0.9), rgba(160, 180, 210, 0.85));
}

/* アクティブカード用マーカー */
.card--active .card__step-marker {
  background: linear-gradient(135deg, #2b66ff, #1a4fcc);
  box-shadow: 0 6px 16px rgba(43, 102, 255, 0.40);
}

/* ========================================
   接続ライン（視線誘導）
======================================== */
.steps__grid--5 {
  position: relative;
}

.steps__grid--5::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 8%;
  width: 84%;
  height: 1px;
  background: linear-gradient(
    to right,
    rgba(214, 228, 255, 0.3),
    rgba(214, 228, 255, 0.7) 20%,
    rgba(214, 228, 255, 0.7) 80%,
    rgba(214, 228, 255, 0.3)
  );
  pointer-events: none;
  z-index: 0;
}

/* ========================================
   アクティブカード強調
======================================== */
.card--active {
  background: rgba(239, 245, 255, 0.95);
  border: 2px solid rgba(43, 102, 255, 0.50);
  box-shadow: 0 28px 64px rgba(43, 102, 255, 0.20);
}

.card--active:hover {
  border-color: rgba(43, 102, 255, 0.70);
  box-shadow: 0 32px 72px rgba(43, 102, 255, 0.25);
}

/* 非アクティブカードを少し控えめに */
.card:not(.card--active) {
  opacity: 0.90;
}

.card:not(.card--active):hover {
  opacity: 1;
}

/* ========================================
   学習ループアイコン（STEP05専用）
======================================== */
.loop-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(120, 160, 255, 0.35);
  box-shadow: 0 6px 18px rgba(20, 60, 160, 0.08);
  color: rgba(40, 90, 210, 0.55);
  margin-left: 10px;
  vertical-align: middle;
}

.loop-icon {
  width: 16px;
  height: 16px;
  animation: loopSpin 12s linear infinite;
  opacity: 0.9;
}

@keyframes loopSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* アクセシビリティ：動きを減らす設定の人には停止 */
@media (prefers-reduced-motion: reduce) {
  .loop-icon {
    animation: none;
  }
}

/* ========================================
   順番に光るエフェクト + ループマーカー
======================================== */

/* カードの光るエフェクト（控えめ） */
.step-card {
  transition: transform 0.45s ease, box-shadow 0.45s ease, border-color 0.45s ease;
}

.step-card.is-active {
  transform: translateY(-2px);
  border-color: rgba(55, 120, 255, 0.55);
  box-shadow:
    0 18px 40px rgba(19, 74, 255, 0.12),
    0 0 0 3px rgba(55, 120, 255, 0.12) inset;
}

/* ループマーカー：薄い・低速・小さめ */
.loop-marker {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0.55;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.12));
  transform: translate(-50%, -50%);
  transition: left 0.55s ease, top 0.55s ease;
  background: conic-gradient(
    from 0deg,
    rgba(80, 140, 255, 0),
    rgba(80, 140, 255, 0.7),
    rgba(80, 140, 255, 0)
  );
  -webkit-mask: radial-gradient(circle, transparent 56%, #000 58%);
  mask: radial-gradient(circle, transparent 56%, #000 58%);
  animation: loopSpin 4.5s linear infinite;
  z-index: 10;
}

@keyframes loopSpin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* アクセシビリティ：動きを減らす設定の人にはマーカーを非表示 */
@media (prefers-reduced-motion: reduce) {
  .loop-marker {
    display: none;
  }
  
  .step-card {
    transition: none;
  }
}

/* ========================================
   Responsive
======================================== */
@media (max-width: 1200px) {
  .steps__grid--5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* 接続ラインを非表示（3列レイアウトでは不自然なため） */
  .steps__grid--5::before {
    display: none;
  }

  /* ループマーカーも非表示（3列以下では邪魔になる） */
  .loop-marker {
    display: none;
  }
}

@media (max-width: 820px) {
  .steps {
    padding: 48px 16px 56px;
  }

  .steps__head h2 {
    font-size: 24px;
  }

  .steps__head p {
    font-size: 13px;
  }

  .steps__grid--5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .card {
    padding: 18px 16px 16px;
  }

  .badge {
    gap: 8px;
    margin-bottom: 10px;
  }

  .badge__icon {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  .badge__step {
    font-size: 11px;
  }

  .card__title {
    font-size: 14px;
  }

  .card__sub {
    font-size: 11px;
  }

  .steps__note {
    font-size: 12px;
    padding: 12px 16px;
  }
}

@media (max-width: 520px) {
  .steps {
    padding: 40px 12px 48px;
  }

  .steps__head h2 {
    font-size: 20px;
    margin-bottom: 10px;
  }

  .steps__head p {
    font-size: 12px;
  }

  .steps__grid--5 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .card {
    padding: 16px 14px;
  }

  .badge {
    gap: 8px;
    margin-bottom: 8px;
  }

  .badge__icon {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }

  .badge__step {
    font-size: 10px;
  }

  .card__title {
    font-size: 13px;
    margin-bottom: 6px;
  }

  .card__sub {
    font-size: 11px;
    line-height: 1.6;
  }

  .steps__note {
    font-size: 11px;
    padding: 10px 14px;
  }
}
