/* ==============================
   料金ページ — page-fee.css
   ※ FV・パンくず・セクション見出しは page-common.css に集約
   ※ ヘッダー・フッター・CTAバンドは style.css に集約
   ============================== */

/* ==============================
   初回相談料
   ============================== */
.fee-initial {
  background: var(--color-bg);
  padding: 80px 20px;
}

.fee-initial__inner {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  gap: 48px;
}

.fee-initial__price-card {
  flex-shrink: 0;
  text-align: center;
  background: rgba(45, 184, 122, 0.06);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius);
  padding: 36px 44px;
  box-shadow: 0 4px 20px rgba(45, 184, 122, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.fee-initial__label {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.12em;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.fee-initial__price {
  font-family: var(--font-heading);
  color: var(--color-text);
  line-height: 1.2;
}

.fee-initial__price-num {
  font-family: var(--font-english);
  font-size: 44px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

.fee-initial__price-unit {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text);
  margin-left: 2px;
}

.fee-initial__price-unit small {
  font-size: 13px;
  font-weight: 400;
  color: #888;
}

.fee-initial__duration {
  font-family: var(--font-body);
  font-size: 14px;
  color: #888;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(45, 184, 122, 0.2);
  width: 100%;
}

.fee-initial__desc {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

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

.fee-initial__secondary {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 14px !important;
  color: #888 !important;
}

/* ==============================
   弁護士費用テーブルセクション
   ============================== */
.fee-table-section {
  background: rgba(45, 184, 122, 0.06);
  padding: 80px 20px 100px;
}

.fee-table-section__inner {
  max-width: 840px;
  margin: 0 auto;
}

.fee-table-section__intro {
  font-family: var(--font-body);
  font-size: 15px;
  color: #555;
  line-height: 1.9;
  text-align: center;
  margin-bottom: 36px;
}

/* --- 共通テーブルラッパー（カードスタイル＋横スクロール対応） --- */
.fee-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 24px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* --- 共通テーブルスタイル --- */
.fee-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
}

.fee-table thead {
  background: var(--color-primary);
}

/* 先頭th左上角丸、末尾th右上角丸 */
.fee-table thead th:first-child {
  border-radius: var(--radius) 0 0 0;
}

.fee-table thead th:last-child {
  border-radius: 0 var(--radius) 0 0;
}

.fee-table th {
  font-weight: 500;
  color: #fff;
  padding: 14px 20px;
  text-align: left;
  font-size: 14px;
  white-space: nowrap;
}

.fee-table__th-amount {
  text-align: right !important;
}

.fee-table tbody tr {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: background-color 0.2s;
}

.fee-table tbody tr:last-child {
  border-bottom: none;
}

.fee-table tbody tr:hover {
  background-color: rgba(45, 184, 122, 0.04);
}

.fee-table td {
  padding: 16px 20px;
  color: #555;
  vertical-align: middle;
}

.fee-table__amount {
  text-align: right;
  white-space: nowrap;
  font-family: var(--font-english), var(--font-body);
  font-weight: 500;
  color: var(--color-text);
}

/* 偶数行のストライプ */
.fee-table tbody tr:nth-child(even) td {
  background: rgba(45, 184, 122, 0.02);
}

/* --- 補足リスト --- */
.fee-supplement {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
}

.fee-supplement li {
  font-family: var(--font-body);
  font-size: 14px;
  color: #555;
  line-height: 1.7;
  padding-left: 16px;
  position: relative;
}

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

/* --- 注釈 --- */
.fee-note {
  font-family: var(--font-body);
  font-size: 13px;
  color: #999;
  line-height: 1.7;
}

/* ==============================
   見積もり例（シナリオカード）
   ============================== */
.fee-estimate {
  background: var(--color-bg);
  padding: 80px 20px 100px;
}

.fee-estimate__inner {
  max-width: 880px;
  margin: 0 auto;
}

.fee-estimate__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

/* --- シナリオカード --- */
.fee-case {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 28px 24px;
  border-top: 3px solid var(--color-primary);
}

.fee-case__title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.fee-case__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  color: var(--color-primary);
}

.fee-case__condition {
  font-family: var(--font-body);
  font-size: 14px;
  color: #777;
  line-height: 1.6;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.fee-case__amounts {
  display: flex;
  gap: 20px;
}

.fee-case__amount {
  flex: 1;
  text-align: center;
}

.fee-case__label {
  display: block;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: #999;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.fee-case__value {
  font-family: var(--font-english), var(--font-body);
  font-size: 28px;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
}

.fee-case__value small {
  font-size: 13px;
  font-weight: 500;
  color: #888;
}

.fee-case__value small:first-child {
  margin-right: 1px;
}

.fee-case__value small:last-child {
  margin-left: 2px;
}

/* ==============================
   その他の費用
   ============================== */
.fee-other {
  background: rgba(45, 184, 122, 0.06);
  padding: 80px 20px 100px;
}

.fee-other__inner {
  max-width: 720px;
  margin: 0 auto;
}

.fee-other__list {
  margin: 0;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px 32px;
}

.fee-other__item {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.fee-other__item:first-child {
  padding-top: 18px;
}

.fee-other__item:last-child {
  border-bottom: none;
}

.fee-other__item dt {
  flex-shrink: 0;
  width: 140px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
}

.fee-other__item dd {
  flex: 1;
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  color: #555;
  line-height: 1.8;
}

/* ==============================
   アニメーション
   — CSS animation（keyframes）を使用。transitionと異なり
     初回描画前にis-visibleが付与されても必ず再生される。
   — セクション(.fade-in)は見出しunderline用
   — 内部要素は個別.fade-inでスクロール連動
   ============================== */

/* --- keyframes定義 --- */
@keyframes fadeSlideFromLeft {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeSlideFromRight {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideUpSmall {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* --- 全セクション共通: 見出し underline-grow --- */
.fee-initial.fade-in .section-heading::after,
.fee-table-section.fade-in .section-heading::after,
.fee-estimate.fade-in .section-heading::after,
.fee-other.fade-in .section-heading::after {
  transform: scaleX(0);
  transform-origin: center;
}

.fee-initial.fade-in.is-visible .section-heading::after,
.fee-table-section.fade-in.is-visible .section-heading::after,
.fee-estimate.fade-in.is-visible .section-heading::after,
.fee-other.fade-in.is-visible .section-heading::after {
  animation: underline-grow 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

/* --- イントロ文: セクションis-visibleでフェード --- */
.fee-table-section.fade-in .fee-table-section__intro {
  opacity: 0;
}

.fee-table-section.fade-in.is-visible .fee-table-section__intro {
  animation: fadeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}

/* --- 初回相談料: カードが左からスライド --- */
.fee-initial__price-card.fade-in {
  opacity: 0;
}

.fee-initial__price-card.fade-in.is-visible {
  animation: fadeSlideFromLeft 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

/* --- 初回相談料: 説明文が右からスライド --- */
.fee-initial__desc.fade-in {
  opacity: 0;
}

.fee-initial__desc.fade-in.is-visible {
  animation: fadeSlideFromRight 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}

/* --- 弁護士費用テーブル: 下からスライド --- */
.fee-table-section .fee-table-wrap.fade-in {
  opacity: 0;
}

.fee-table-section .fee-table-wrap.fade-in.is-visible {
  animation: fadeSlideUp 1s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}

/* --- 弁護士費用: 補足＋注釈はテーブル後にフェード --- */
.fee-table-section .fee-table-wrap.fade-in ~ .fee-supplement,
.fee-table-section .fee-table-wrap.fade-in ~ .fee-note {
  opacity: 0;
}

.fee-table-section .fee-table-wrap.fade-in.is-visible ~ .fee-supplement,
.fee-table-section .fee-table-wrap.fade-in.is-visible ~ .fee-note {
  animation: fadeIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) 1s both;
}

/* --- 見積もりカード: 下からスライド（個別fade-in） --- */
.fee-case.fade-in {
  opacity: 0;
}

.fee-case.fade-in.is-visible {
  animation: fadeSlideUpSmall 1s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}

/* --- その他の費用: カードが下からスライド --- */
.fee-other__list.fade-in {
  opacity: 0;
}

.fee-other__list.fade-in.is-visible {
  animation: fadeSlideUpSmall 1s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}

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

  .fee-initial,
  .fee-table-section,
  .fee-estimate,
  .fee-other {
    padding: 80px 20px;
  }

  .fee-initial__inner {
    gap: 36px;
  }

  .fee-initial__price-card {
    padding: 28px 32px;
  }

  .fee-initial__price-num {
    font-size: 38px;
  }

  /* 弁護士費用テーブル */
  .fee-table {
    font-size: 14px;
  }

  .fee-table th {
    padding: 12px 16px;
    font-size: 13px;
  }

  .fee-table td {
    padding: 14px 16px;
  }

  /* 見積もりカード */
  .fee-estimate__grid {
    gap: 20px;
  }

  .fee-case {
    padding: 24px 24px 20px;
  }

  .fee-case__value {
    font-size: 26px;
  }

  /* アニメーション: カード移動量縮小 */
  .fee-initial__price-card.fade-in.is-visible {
    animation-name: fadeSlideFromLeft;
  }

  .fee-initial__desc.fade-in.is-visible {
    animation-name: fadeSlideFromRight;
  }
}

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

  .fee-initial {
    padding: 48px 20px 56px;
  }

  .fee-table-section,
  .fee-estimate,
  .fee-other {
    padding: 48px 20px 64px;
  }

  /* ===== 初回相談料: 縦積み ===== */
  .fee-initial__inner {
    flex-direction: column;
    align-items: center;
    gap: 28px;
  }

  .fee-initial__price-card {
    width: 100%;
    max-width: 280px;
    padding: 28px 24px;
  }

  .fee-initial__price-num {
    font-size: 38px;
  }

  .fee-initial__desc p {
    font-size: 15px;
    line-height: 1.8;
  }

  .fee-initial__secondary {
    font-size: 14px !important;
  }

  .fee-initial__price-unit small {
    font-size: 14px;
  }

  /* ===== 弁護士費用テーブル: SP最適化 ===== */
  .fee-table-wrap {
    border-radius: var(--radius);
  }

  .fee-table {
    font-size: 14px;
    min-width: 480px;
  }

  .fee-table thead th:first-child {
    border-radius: var(--radius) 0 0 0;
  }

  .fee-table thead th:last-child {
    border-radius: 0 var(--radius) 0 0;
  }

  .fee-table th {
    padding: 10px 12px;
    font-size: 14px;
  }

  .fee-table td {
    padding: 12px;
    font-size: 14px;
  }

  .fee-table-section__intro {
    font-size: 15px;
    text-align: left;
    margin-bottom: 28px;
  }

  .fee-supplement {
    flex-direction: column;
    gap: 6px;
  }

  .fee-supplement li {
    font-size: 14px;
  }

  .fee-note {
    font-size: 14px;
  }

  /* ===== 見積もりカード: 1列化 ===== */
  .fee-estimate__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .fee-case {
    padding: 22px 20px 18px;
  }

  /* タイトル 20px(700) / 条件 14px / 金額 20px → ジャンプ率 20÷15=1.33 → タイトルで階層表現 */
  .fee-case__title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
  }

  .fee-case__condition {
    font-size: 14px;
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  .fee-case__amounts {
    gap: 16px;
  }

  .fee-case__label {
    font-size: 12px;
    margin-bottom: 4px;
  }

  .fee-case__value {
    font-size: 24px;
  }

  .fee-case__value small {
    font-size: 14px;
  }

  .fee-case__icon {
    width: 24px;
    height: 24px;
  }

  /* ===== その他の費用: 縦積みカード ===== */
  .fee-other__list {
    padding: 4px 20px;
    border-radius: var(--radius);
  }

  .fee-other__item {
    flex-direction: column;
    gap: 4px;
    padding: 16px 0;
  }

  .fee-other__item dt {
    width: auto;
    font-size: 15px;
    font-weight: 700;
  }

  .fee-other__item dd {
    font-size: 15px;
    line-height: 1.8;
  }

  /* ===== アニメーション: SP最適化（全て縦移動12px以下） ===== */
  .fee-initial__price-card.fade-in.is-visible,
  .fee-initial__desc.fade-in.is-visible,
  .fee-table-section .fee-table-wrap.fade-in.is-visible,
  .fee-case.fade-in.is-visible,
  .fee-other__list.fade-in.is-visible {
    animation-name: fadeSlideUpSP;
  }
}

/* ==============================
   prefers-reduced-motion
   ============================== */
/* SP用keyframes */
@keyframes fadeSlideUpSP {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==============================
   prefers-reduced-motion
   ============================== */
@media (prefers-reduced-motion: reduce) {
  .fee-table tbody tr {
    transition: none;
  }

  .fee-initial__price-card.fade-in,
  .fee-initial__desc.fade-in,
  .fee-table-section.fade-in .fee-table-section__intro,
  .fee-table-section .fee-table-wrap.fade-in,
  .fee-table-section .fee-table-wrap.fade-in ~ .fee-supplement,
  .fee-table-section .fee-table-wrap.fade-in ~ .fee-note,
  .fee-case.fade-in,
  .fee-other__list.fade-in {
    opacity: 1 !important;
    transform: none !important;
  }

  .fee-initial__price-card.fade-in.is-visible,
  .fee-initial__desc.fade-in.is-visible,
  .fee-table-section.fade-in.is-visible .fee-table-section__intro,
  .fee-table-section .fee-table-wrap.fade-in.is-visible,
  .fee-table-section .fee-table-wrap.fade-in.is-visible ~ .fee-supplement,
  .fee-table-section .fee-table-wrap.fade-in.is-visible ~ .fee-note,
  .fee-case.fade-in.is-visible,
  .fee-other__list.fade-in.is-visible {
    animation: none !important;
  }
}
