/* ==============================
   相談の流れページ — page-flow.css
   ※ FV・パンくず・FVアニメーションは page-common.css に集約
   ============================== */

/* ==============================
   フローステップ（メインセクション）
   ============================== */
.flow-detail {
  background: var(--color-bg);
  padding: 100px 20px;
}

/* セクション見出し → page-common.css .section-heading に集約 */

/* --- タイムライン --- */
.flow-detail__timeline {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  padding-left: 40px;
}

/* 縦ライン */
.flow-detail__timeline::before {
  content: '';
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: 59px;
  width: 2px;
  background: linear-gradient(
    180deg,
    rgba(45, 184, 122, 0.08) 0%,
    rgba(45, 184, 122, 0.25) 20%,
    rgba(45, 184, 122, 0.25) 80%,
    rgba(45, 184, 122, 0.08) 100%
  );
}

/* --- 各ステップ --- */
.flow-detail__step {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  padding-bottom: 48px;
  position: relative;
}

.flow-detail__step:last-child {
  padding-bottom: 0;
}

/* マーカー（番号＋ラベル） */
.flow-detail__marker {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.flow-detail__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-english);
  font-weight: 700;
  font-size: 16px;
  border-radius: 50%;
}

.flow-detail__step--highlight .flow-detail__number {
  width: 48px;
  height: 48px;
  font-size: 17px;
  box-shadow: 0 0 0 4px rgba(45, 184, 122, 0.15);
}

.flow-detail__label {
  font-family: var(--font-english);
  font-size: 11px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* カード */
.flow-detail__card {
  flex: 1;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.flow-detail__step--highlight .flow-detail__card {
  border-color: var(--color-primary);
  border-width: 2px;
  box-shadow: 0 2px 12px rgba(45, 184, 122, 0.1);
}

.flow-detail__title {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 20px;
  color: var(--color-text);
  line-height: 1.4;
  margin-bottom: 12px;
}

.flow-detail__step--highlight .flow-detail__title {
  color: var(--color-primary);
  font-weight: 700;
}

.flow-detail__note {
  display: inline-block;
  font-size: 13px;
  font-weight: 400;
  color: #888;
  margin-left: 10px;
}

.flow-detail__desc {
  font-family: var(--font-body);
  font-size: 15px;
  color: #555;
  line-height: 1.9;
}

/* カード内リスト */
.flow-detail__list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: 16px;
}

.flow-detail__list li {
  font-family: var(--font-body);
  font-size: 14px;
  color: #555;
  line-height: 1.7;
  padding: 6px 0 6px 20px;
  position: relative;
}

.flow-detail__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 6px;
  height: 6px;
  background: var(--color-primary);
  border-radius: 50%;
}

.flow-detail__list li strong {
  display: inline-block;
  font-weight: 500;
  color: var(--color-text);
  min-width: 68px;
  margin-right: 4px;
}

/* ==============================
   オンライン相談案内
   ============================== */
.online-guide {
  background: rgba(45, 184, 122, 0.05);
  padding: 80px 20px;
}

.online-guide__inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

/* オンライン案内見出し → page-common.css .section-heading に集約 */

.online-guide__text {
  font-family: var(--font-body);
  font-size: 15px;
  color: #555;
  line-height: 1.9;
  text-align: left;
}

/* ==============================
   @keyframes 定義
   ============================== */

/* タイムライン縦ライン: 上から伸びる */
@keyframes timeline-grow {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

/* ステップ番号: スケールバウンス */
@keyframes step-number-bounce {
  from {
    opacity: 0;
    transform: scale(0);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ステップラベル: フェードイン */
@keyframes step-label-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ステップカード: 右からスライド */
@keyframes step-card-slide {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ハイライトカード: 枠線＋影の変化 */
@keyframes highlight-border {
  from {
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
  }
  to {
    border-color: var(--color-primary);
    box-shadow: 0 2px 12px rgba(45, 184, 122, 0.1);
  }
}

/* オンライン案内: 下からフェード */
@keyframes online-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* SP用: ステップカード縦スライド */
@keyframes step-card-slide-down {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* SP用: ステップ番号 控えめスケール */
@keyframes step-number-scale-sp {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* SP用: オンライン案内 縦スライド縮小 */
@keyframes online-slide-up-sp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==============================
   アニメーション
   ============================== */

/* --- セクション見出し: underline-grow（page-common.css の共通アニメーション使用） --- */
.flow-detail.fade-in .section-heading::after {
  transform: scaleX(0);
  transform-origin: center;
}

.flow-detail.fade-in.is-visible .section-heading::after {
  animation: underline-grow 1.0s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}

/* --- タイムライン縦ライン: 上から伸びる --- */
.flow-detail__timeline::before {
  transform: scaleY(0);
  transform-origin: top;
}

.flow-detail.fade-in.is-visible .flow-detail__timeline::before {
  animation: timeline-grow 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}

/* --- ステップ番号: スケールバウンス --- */
.flow-detail__step.fade-in .flow-detail__number {
  opacity: 0;
}

.flow-detail__step.fade-in.is-visible .flow-detail__number {
  animation: step-number-bounce 1.0s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s both;
}

/* --- ステップラベル: フェードイン（番号の後） --- */
.flow-detail__step.fade-in .flow-detail__label {
  opacity: 0;
}

.flow-detail__step.fade-in.is-visible .flow-detail__label {
  animation: step-label-fade 1.0s cubic-bezier(0.22, 1, 0.36, 1) 0.55s both;
}

/* --- ステップカード: 右からスライド --- */
.flow-detail__step.fade-in .flow-detail__card {
  opacity: 0;
}

.flow-detail__step.fade-in.is-visible .flow-detail__card {
  animation: step-card-slide 1.0s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}

/* --- ハイライトSTEP3: 枠線の色変化 --- */
.flow-detail__step--highlight.fade-in .flow-detail__card {
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.flow-detail__step--highlight.fade-in.is-visible .flow-detail__card {
  animation: step-card-slide 1.0s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both,
             highlight-border 1.0s cubic-bezier(0.22, 1, 0.36, 1) 0.9s both;
}

/* --- オンライン案内: 下からフェード --- */
.online-guide.fade-in {
  opacity: 0;
}

.online-guide.fade-in.is-visible {
  animation: online-slide-up 1.0s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}

/* --- オンライン案内見出し: underline-grow --- */
.online-guide.fade-in .section-heading::after {
  transform: scaleX(0);
  transform-origin: center;
}

.online-guide.fade-in.is-visible .section-heading::after {
  animation: underline-grow 1.0s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}

/* ==============================
   レスポンシブ — タブレット（≤1024px）
   ============================== */
@media (max-width: 1024px) {
  /* FV・パンくず → page-common.css に集約 */

  /* レイアウト */
  .flow-detail {
    padding: 80px 20px;
  }

  .flow-detail__timeline {
    padding-left: 20px;
    max-width: 680px;
  }

  .flow-detail__timeline::before {
    left: 39px;
  }

  .flow-detail__step {
    gap: 24px;
    padding-bottom: 40px;
  }

  .flow-detail__number {
    width: 40px;
    height: 40px;
    font-size: 15px;
  }

  .flow-detail__step--highlight .flow-detail__number {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }

  .flow-detail__card {
    padding: 24px;
  }

  .flow-detail__title {
    font-size: 19px;
  }

  .flow-detail__desc {
    font-size: 14px;
    line-height: 1.85;
  }

  .flow-detail__list li {
    font-size: 13px;
  }

  /* オンライン案内 */
  .online-guide {
    padding: 64px 20px;
  }

  .online-guide__text {
    font-size: 14px;
  }
}

/* ==============================
   レスポンシブ — SP（≤768px）
   ============================== */
@media (max-width: 768px) {
  /* FV・パンくず → page-common.css に集約 */

  /* フローセクション */
  .flow-detail {
    padding: 56px 20px;
  }

  /* タイムライン：縦一列化 */
  .flow-detail__timeline {
    padding-left: 0;
    max-width: 100%;
  }

  .flow-detail__timeline::before {
    display: none;
  }

  .flow-detail__step {
    flex-direction: column;
    gap: 0;
    padding-bottom: 32px;
  }

  .flow-detail__step:last-child {
    padding-bottom: 0;
  }

  /* マーカー：横並び（番号＋ラベル） */
  .flow-detail__marker {
    flex-direction: row;
    gap: 10px;
    margin-bottom: 12px;
  }

  .flow-detail__number {
    width: 40px;
    height: 40px;
    font-size: 15px;
  }

  .flow-detail__step--highlight .flow-detail__number {
    width: 44px;
    height: 44px;
    font-size: 16px;
    box-shadow: 0 0 0 3px rgba(45, 184, 122, 0.15);
  }

  .flow-detail__label {
    font-size: 12px;
    font-weight: 700;
    align-self: center;
  }

  /* カード */
  .flow-detail__card {
    padding: 22px 20px;
  }

  .flow-detail__step--highlight .flow-detail__card {
    border-width: 2px;
  }

  /* タイトル: 本文との差を確保（20px vs 15px = ジャンプ率1.33） */
  .flow-detail__title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
  }

  .flow-detail__note {
    display: block;
    margin-left: 0;
    margin-top: 4px;
    font-size: 13px;
  }

  /* 本文: SPでも15pxを維持（可読性確保） */
  .flow-detail__desc {
    font-size: 15px;
    line-height: 1.8;
  }

  /* カード内リスト */
  .flow-detail__list {
    margin-top: 14px;
    padding-top: 14px;
  }

  .flow-detail__list li {
    font-size: 14px;
    padding: 5px 0 5px 18px;
    line-height: 1.7;
  }

  .flow-detail__list li::before {
    top: 13px;
  }

  .flow-detail__list li strong {
    display: block;
    margin-bottom: 2px;
    min-width: auto;
    font-size: 14px;
    font-weight: 700;
  }

  /* オンライン案内 */
  .online-guide {
    padding: 56px 20px;
  }

  .online-guide__inner {
    max-width: 100%;
  }

  .online-guide__text {
    font-size: 15px;
    line-height: 1.8;
  }

  /* ===== アニメーション: SP最適化 ===== */
  /* カード: 横→下スライドに変更、移動量12px */
  .flow-detail__step.fade-in.is-visible .flow-detail__card {
    animation-name: step-card-slide-down;
  }

  /* ハイライトカード: SP用スライドに差替 */
  .flow-detail__step--highlight.fade-in.is-visible .flow-detail__card {
    animation: step-card-slide-down 1.0s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both,
               highlight-border 1.0s cubic-bezier(0.22, 1, 0.36, 1) 0.9s both;
  }

  /* 番号: バウンス控えめ */
  .flow-detail__step.fade-in.is-visible .flow-detail__number {
    animation: step-number-scale-sp 1.0s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
  }

  /* オンライン案内: 移動量12px */
  .online-guide.fade-in.is-visible {
    animation: online-slide-up-sp 1.0s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
  }

  /* 縦ラインアニメーション無効化（SPでは非表示のため） */
  .flow-detail__timeline::before {
    transform: none;
    animation: none;
  }
}

/* ==============================
   prefers-reduced-motion
   ============================== */
@media (prefers-reduced-motion: reduce) {
  .flow-detail__timeline::before,
  .flow-detail__step.fade-in .flow-detail__number,
  .flow-detail__step.fade-in .flow-detail__label,
  .flow-detail__step.fade-in .flow-detail__card,
  .flow-detail__step--highlight.fade-in .flow-detail__card,
  .online-guide.fade-in,
  .flow-detail.fade-in .section-heading::after,
  .online-guide.fade-in .section-heading::after {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .flow-detail__step--highlight .flow-detail__card {
    border-color: var(--color-primary) !important;
    box-shadow: 0 2px 12px rgba(45, 184, 122, 0.1) !important;
  }
}
