/* ========================================
   Plan Page - 料金プランページ専用CSS
   依存: critical.css, base.css
   8ptグリッドシステム準拠
======================================== */

/* ========================================
   セクション共通
======================================== */
.plan-section {
  padding: 4rem 5%; /* 64px */
  background: var(--color-white);
  overflow-x: hidden;
  box-sizing: border-box;
}

.plan-section__inner {
  max-width: 1200px;
  margin: 0 auto;
  overflow-x: hidden;
}

/* ========================================
   ヘッダー
======================================== */
.plan-header {
  text-align: center;
  margin-bottom: 3rem; /* 48px */
}

.plan-header__label {
  font-family: var(--font-en);
  font-size: 0.75rem; /* 12px */
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-text-light);
  margin-bottom: 0.5rem; /* 8px */
}

.plan-header__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem); /* 28px〜40px */
  font-weight: 900;
  color: var(--color-black);
  margin-bottom: 0.5rem; /* 8px */
  line-height: var(--lh-heading);
}

.plan-header__desc {
  font-size: 1rem; /* 16px */
  color: var(--color-text-light);
  line-height: var(--lh-body);
}

/* ========================================
   プランカード グリッド
======================================== */
.plan-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem; /* 16px */
  margin-bottom: 4rem; /* 64px */
  max-width: 100%;
  width: 100%;
  color: var(--color-black);
}

@media (min-width: 769px) {
  .plan-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem; /* 24px */
    align-items: stretch;
  }
}

/* タブレット横向きでの調整 */
@media (min-width: 769px) and (max-width: 1024px) {
  .plan-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem; /* 48px - トップページと統一、RECOMMENDEDバッジ+transformのかぶり防止 */
  }
  
  /* 基本プラン: 左上 */
  .plan-card:nth-child(1) {
    order: 1;
  }
  
  /* コミットプラン: 下に落ちて幅100% */
  .plan-card:nth-child(2) {
    order: 3;
    grid-column: 1 / -1;
  }
  
  /* イージープラン: 右上 */
  .plan-card:nth-child(3) {
    order: 2;
  }
  
  .plan-card {
    padding: 1.5rem; /* 24px */
  }
}

/* ========================================
   プランカード
======================================== */
.plan-card {
  background: var(--color-white);
  border: 2px solid #e0e0e0;
  padding: 1.5rem; /* 24px */
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  min-width: 0;
}

.plan-card:hover {
  border-color: var(--color-black);
}

/* 推奨プラン */
.plan-card--recommended {
  background: var(--color-black);
  color: var(--color-white);
  border-color: var(--color-black);
  position: relative;
}

@media (min-width: 769px) {
  .plan-card--recommended {
    transform: translateY(-1rem);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  }
}

.plan-card__badge {
  position: absolute;
  top: -1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-white);
  font-family: var(--font-en);
  font-size: 0.75rem; /* 12px */
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.5rem 1.5rem; /* 8px 24px */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

.plan-card__badge-text {
  background: linear-gradient(90deg, 
    #00f5ff 0%,
    #ff6b9d 40%,
    #ffd89b 70%,
    #667eea 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.plan-card__label {
  font-size: 0.75rem; /* 12px */
  font-weight: 400; /* 500から変更 - フォント軽量化 */
  color: var(--color-text-light);
  margin-bottom: 0.25rem; /* 4px */
}

.plan-card--recommended .plan-card__label {
  color: rgba(255, 255, 255, 0.7);
}

.plan-card--recommended .plan-card__name {
  color: var(--color-white);
}

.plan-card__name {
  font-size: 1.5rem; /* 24px */
  font-weight: 900;
  margin-bottom: 1rem; /* 16px */
  color: var(--color-black);
  line-height: var(--lh-heading);
}

.plan-card__price {
  font-family: var(--font-en);
  font-size: 2.5rem; /* 40px */
  font-weight: 900;
  line-height: 1;
  color: var(--color-black);
}

.plan-card__price-tax {
  font-size: 0.75rem; /* 12px */
  font-weight: 400;
  color: var(--color-text-light);
  margin-top: 0.25rem; /* 4px */
  margin-bottom: 1rem; /* 16px */
}

.plan-card--recommended .plan-card__price-tax {
  color: rgba(255, 255, 255, 0.7);
}

.plan-card__desc {
  font-size: 1rem; /* 16px */
  line-height: var(--lh-body);
  color: var(--color-text);
  margin-bottom: 1rem; /* 16px */
  flex: 1;
}

.plan-card--recommended .plan-card__desc {
  color: var(--color-white);
}

.plan-card--recommended .plan-card__price {
  color: var(--color-white);
}

/* 主要機能リスト */
.plan-card__features {
  list-style: none;
  border-top: 1px solid #e0e0e0;
  padding-top: 1rem; /* 16px */
  margin: 0;
}

.plan-card--recommended .plan-card__features {
  border-top-color: rgba(255, 255, 255, 0.2);
}

.plan-card--recommended .plan-card__feature {
  color: var(--color-white);
}

.plan-card__feature {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem; /* 8px */
  font-size: 1rem; /* 16px */
  margin-bottom: 0.5rem; /* 8px */
  line-height: var(--lh-body);
  color: var(--color-text);
}

.plan-card__feature:last-child {
  margin-bottom: 0;
}

.plan-card__check {
  flex-shrink: 0;
  width: 1.125rem; /* 18px */
  height: 1.125rem;
  color: var(--color-black);
}

.plan-card--recommended .plan-card__check {
  color: var(--color-white);
}

/* ========================================
   比較テーブルセクション
======================================== */
.comparison-section {
  padding: 4rem 5%; /* 64px */
  background: #f5f5f5;
  color: var(--color-black);
}

.comparison-section__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.comparison-header {
  text-align: center;
  margin-bottom: 2rem; /* 32px */
}

.comparison-header__title {
  font-size: clamp(1.5rem, 3vw, 2rem); /* 24px〜32px */
  font-weight: 900;
  margin-bottom: 0.5rem; /* 8px */
  color: var(--color-black);
  line-height: var(--lh-heading);
}

.comparison-header__desc {
  font-size: 1rem; /* 16px */
  color: var(--color-text-light);
  line-height: var(--lh-body);
}

/* テーブルラッパー */
.comparison-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem; /* 16px */
}

/* テーブル */
.comparison-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  background: var(--color-white);
  font-size: 1rem; /* 16px */
  table-layout: fixed;
  color: var(--color-black);
}

.comparison-table th,
.comparison-table td {
  padding: 1rem 0.75rem; /* 16px 12px */
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid #e0e0e0;
}

.comparison-table th {
  font-weight: 700;
  background: var(--color-white);
}

/* 項目列（sticky） */
.comparison-table td:first-child,
.comparison-table th:first-child {
  text-align: left;
  font-weight: 400; /* 500から変更 - フォント軽量化 */
  width: 140px;
  min-width: 140px;
  position: sticky;
  left: 0;
  background: var(--color-white);
  z-index: 2;
  border-right: 1px solid #e0e0e0;
  color: var(--color-black);
}

/* 列幅設定 */
.comparison-table th:not(:first-child),
.comparison-table td:not(:first-child) {
  width: 125px;
  min-width: 110px;
}

/* ヘッダー行 */
.comparison-table thead th {
  padding: 1.25rem 1rem; /* 20px 16px */
  border-bottom: 2px solid var(--color-black);
}

.comparison-table__plan-name {
  font-size: 1rem; /* 16px */
  font-weight: 900;
  display: block;
  color: var(--color-black);
}

.comparison-table__plan-price {
  font-family: var(--font-en);
  font-size: 1.125rem; /* 18px */
  font-weight: 700;
  display: block;
  margin-top: 0.25rem; /* 4px */
  color: var(--color-black);
}

/* 他社列 */
.comparison-table__other {
  background: #f9f9f9;
  color: var(--color-text-light);
}

.comparison-table__other .comparison-table__plan-name {
  font-weight: 700;
}

.comparison-table__other .comparison-table__plan-price {
  font-size: 1rem; /* 16px */
  color: #999999;
}

/* ひたすら3列の外枠 */
.comparison-table__hitasura-start {
  border-left: 2px solid var(--color-black);
}

.comparison-table__hitasura-end {
  border-right: 2px solid var(--color-black);
}

.comparison-table thead th.comparison-table__hitasura-start,
.comparison-table thead th.comparison-table__hitasura-end,
.comparison-table thead th.comparison-table__recommended {
  border-top: 2px solid var(--color-black);
}

.comparison-table tbody tr:last-child td.comparison-table__hitasura-start,
.comparison-table tbody tr:last-child td.comparison-table__hitasura-end,
.comparison-table tbody tr:last-child td.comparison-table__recommended {
  border-bottom: 2px solid var(--color-black);
}

/* 推奨列 */
.comparison-table thead .comparison-table__recommended {
  background: var(--color-black);
  color: var(--color-white);
}

.comparison-table thead .comparison-table__recommended .comparison-table__plan-name,
.comparison-table thead .comparison-table__recommended .comparison-table__plan-price {
  color: var(--color-white);
}

/* コミットプラン名の虹色グラデ */
.comparison-table__plan-name--rainbow {
  background: linear-gradient(90deg, 
    #00f5ff 0%,
    #ff6b9d 40%,
    #ffd89b 70%,
    #667eea 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.comparison-table tbody .comparison-table__recommended {
  background: rgba(51, 51, 51, 0.08);
  color: var(--color-black);
}

/* カテゴリ行 */
.comparison-table__category {
  background: var(--color-black);
  color: var(--color-white);
  font-weight: 700;
  font-size: 0.75rem; /* 12px */
  letter-spacing: 0.05em;
}

.comparison-table__category td {
  padding: 0.75rem 1rem; /* 12px 16px */
  text-align: center;
  border-bottom: none;
  background: var(--color-black);
}

.comparison-table__category td:first-child {
  text-align: left;
  background: var(--color-black);
  color: var(--color-white);
}

/* 記号スタイル */
.comparison-table .mark {
  font-size: 1.125rem; /* 18px */
  font-weight: 700;
}

.comparison-table .mark--double {
  color: var(--color-black);
}

.comparison-table .mark--single {
  color: var(--color-black);
}

.comparison-table .mark--triangle {
  color: #b8860b;
}

.comparison-table .mark--cross {
  color: #cc0000;
}

.comparison-table__recommended .mark--double,
.comparison-table__recommended .mark--single {
  color: var(--color-black);
}

/* 補足テキスト */
.comparison-table .mark-note {
  display: block;
  font-size: 0.75rem; /* 12px */
  font-weight: 400;
  color: #999999;
  margin-top: 0.125rem; /* 2px */
}

.comparison-table__recommended .mark-note {
  color: var(--color-text-light);
}

/* 値段表示 */
.comparison-table .price-text {
  font-size: 0.75rem; /* 12px */
  color: #999999;
}

/* リンク */
.comparison-table .table-link {
  color: var(--color-black);
  text-decoration: underline;
  font-size: 0.75rem; /* 12px */
}

.comparison-table .table-link:hover {
  text-decoration: none;
}

/* 注釈 */
.comparison-notes {
  text-align: right;
}

.comparison-notes__text {
  font-size: 0.75rem; /* 12px */
  color: #999999;
  line-height: var(--lh-body);
}

/* ========================================
   CTA
======================================== */
.plan-cta {
  background: var(--color-black);
  color: var(--color-white);
  padding: 4rem 5%; /* 64px */
  text-align: center;
}

.plan-cta__title {
  font-size: clamp(1.5rem, 4vw, 2rem); /* 24px〜32px */
  font-weight: 900;
  margin-bottom: 1rem; /* 16px */
  color: var(--color-white);
  line-height: var(--lh-heading);
}

.plan-cta__desc {
  font-size: 1rem; /* 16px */
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 2rem; /* 32px */
  line-height: var(--lh-body);
}

/* ========================================
   Q&Aセクション（プラン詳細ページ専用）
======================================== */
.plan-qa-section {
  background: var(--color-white);
  padding: 4rem 5%; /* 64px */
}

.plan-qa-container {
  max-width: 1024px;
  margin: 0 auto;
  background: var(--color-white);
  border: 1px solid rgba(51, 51, 51, 0.15);
  overflow: hidden;
}

.plan-qa-header {
  text-align: center;
  padding: 2rem; /* 32px */
  background: var(--color-white);
  border-bottom: 1px solid rgba(51, 51, 51, 0.15);
}

.plan-qa-title {
  font-size: clamp(1.5rem, 4vw, 2rem); /* 24px〜32px - トップページの48px〜72pxより小さく */
  font-weight: 700;
  color: var(--color-black);
  margin-bottom: 0.25rem; /* 4px */
  line-height: var(--lh-heading);
}

.plan-qa-content {
  padding: 1.5rem 2rem; /* 24px 32px */
}

/* アコーディオン - base.cssの共通スタイルを継承 */
.plan-qa-section .qa-accordion {
  margin-bottom: 1rem; /* 16px */
  border: 1px solid rgba(51, 51, 51, 0.15);
  border-radius: 0;
}

.plan-qa-section .qa-accordion-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem; /* 20px */
  text-align: left;
  transition: background 0.2s;
  border-radius: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.plan-qa-section .qa-accordion-toggle:hover {
  background: rgba(51, 51, 51, 0.03);
}

.plan-qa-section .qa-accordion-question {
  font-size: 1.125rem; /* 18px */
  font-weight: 700; /* 500から変更 - フォント軽量化 */
  color: var(--color-black);
  flex: 1;
  line-height: var(--lh-heading);
}

.plan-qa-section .qa-accordion-icon {
  flex-shrink: 0;
  width: 1.5rem; /* 24px */
  height: 1.5rem;
  color: var(--color-text-light);
  transition: transform 0.3s;
}

.plan-qa-section .qa-accordion-toggle[aria-expanded="true"] .qa-accordion-icon {
  transform: rotate(180deg);
}

.plan-qa-section .qa-accordion-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: rgba(51, 51, 51, 0.03);
}

.plan-qa-section .qa-accordion-answer.open {
  max-height: 500px;
}

.plan-qa-section .qa-accordion-answer-text {
  padding: 1.25rem; /* 20px */
  color: var(--color-text);
  line-height: var(--lh-body);
  font-size: 1rem; /* 16px */
}

.plan-qa-section .qa-accordion-answer-text strong {
  color: var(--color-black);
}

/* ========================================
   レスポンシブ
======================================== */
@media (max-width: 768px) {
  .plan-section,
  .comparison-section,
  .plan-cta,
  .plan-qa-section {
    padding: 3rem 1rem; /* 48px 16px */
  }

  .plan-header {
    margin-bottom: 2rem; /* 32px */
  }

  .plan-grid {
    gap: 2rem; /* 32px - トップページと統一、RECOMMENDEDバッジのかぶり防止 */
  }

  .plan-card {
    padding: 1.5rem; /* 24px */
  }

  .plan-card--recommended {
    padding-top: 2rem; /* 32px */
  }

  .plan-card__price {
    font-size: 2rem; /* 32px */
  }

  /* テーブルスマホ対応 */
  .comparison-table {
    font-size: 0.75rem; /* 12px */
    min-width: 550px;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 0.5rem 0.375rem; /* 8px 6px */
  }

  .comparison-table td:first-child,
  .comparison-table th:first-child {
    width: 90px;
    min-width: 90px;
    font-size: 0.75rem; /* 12px */
    padding: 0.5rem 0.375rem;
  }

  .comparison-table th:not(:first-child),
  .comparison-table td:not(:first-child) {
    width: 90px;
    min-width: 80px;
  }

  .comparison-table thead th {
    padding: 0.75rem 0.375rem; /* 12px 6px */
  }

  .comparison-table__plan-name {
    font-size: 0.75rem; /* 12px */
  }

  .comparison-table__plan-price {
    font-size: 1rem; /* 16px */
  }

  .comparison-table .mark {
    font-size: 1rem; /* 16px */
  }

  .comparison-table .mark-note {
    font-size: 0.625rem; /* 10px - 例外：極小注釈 */
  }

  .comparison-table .price-text {
    font-size: 0.625rem; /* 10px - 例外：極小注釈 */
  }

  .comparison-table__category td {
    font-size: 0.625rem; /* 10px - 例外：極小注釈 */
    padding: 0.5rem 0.375rem;
  }

  /* Q&Aスマホ対応 */
  .plan-qa-container {
    border-left: none;
    border-right: none;
  }

  .plan-qa-header {
    padding: 1.5rem 1rem; /* 24px 16px */
  }

  .plan-qa-content {
    padding: 1.25rem 1rem; /* 20px 16px */
  }

  .plan-qa-section .qa-accordion-toggle {
    padding: 1rem; /* 16px */
  }

  .plan-qa-section .qa-accordion-question {
    font-size: 1rem; /* 16px */
  }

  .plan-qa-section .qa-accordion-answer-text {
    padding: 1rem; /* 16px */
  }

  /* プランカード内マーカーの折り返し防止 */
  .plan-card__feature .marker {
    display: inline-block;
    white-space: nowrap;
  }
}
