/* ===================================================
   common.css - 新保険シミュレーター 共通スタイル
   外部ライブラリ不使用・WordPress完全独立
   =================================================== */

/* --- リセット & ベース --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Meiryo", sans-serif;
  background: linear-gradient(160deg, #edf2f7 0%, #e8f0fe 100%);
  background-attachment: fixed;
  color: #2d3748;
  line-height: 1.7;
  min-height: 100vh;
}

/* --- レイアウト --- */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* --- ヘッダー --- */
.site-header {
  background: linear-gradient(145deg, #1a365d 0%, #2b6cb0 100%);
  color: #fff;
  padding: 20px 16px;
  text-align: center;
}

.site-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.site-header p {
  font-size: 0.85rem;
  margin-top: 4px;
  opacity: 0.8;
}

/* --- ヘッダー内 トップページリンク --- */
.header-top-link {
  display: block;
  text-align: left;
  font-size: 0.87rem;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  margin-bottom: 20px;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}

.header-top-link:hover {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
}

/* --- カード（シミュレーター項目など） --- */
.card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(26, 54, 93, 0.08);
  border: 1px solid #e2e8f0;
  padding: 24px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a365d;
  margin-bottom: 8px;
}

.card-desc {
  font-size: 0.9rem;
  color: #718096;
  margin-bottom: 16px;
}

/* --- フォーム --- */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 6px;
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group select {
  width: 100%;
  padding: 10px 14px;
  font-size: 1rem;
  border: 1.5px solid #cbd5e0;
  border-radius: 6px;
  background: #fff;
  color: #2d3748;
  transition: border-color 0.2s;
  appearance: none;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.form-group .hint {
  font-size: 0.8rem;
  color: #a0aec0;
  margin-top: 4px;
}

/* --- ラジオ・チェックボックス --- */
.radio-group, .check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.radio-group label, .check-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
  cursor: pointer;
}

/* --- ボタン --- */
.btn {
  display: inline-block;
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: #2b6cb0;
  color: #fff;
  transition: background 0.3s, box-shadow 0.3s, transform 0.1s;
}

.btn-primary:hover {
  background-color: #2c5282;
  box-shadow: 0 4px 16px rgba(43, 108, 176, 0.35);
}

.btn-secondary {
  background-color: #e2e8f0;
  color: #4a5568;
}

.btn-secondary:hover {
  opacity: 0.85;
}

/* --- 結果表示 --- */
.result-box {
  background: #ebf8ff;
  border-left: 4px solid #3182ce;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 16px;
}

.result-box .result-label {
  font-size: 0.85rem;
  color: #2c5282;
  font-weight: 600;
  margin-bottom: 4px;
}

.result-box .result-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1a365d;
}

.result-box .result-unit {
  font-size: 1rem;
  font-weight: 400;
  margin-left: 4px;
}

.result-highlight {
  background: #fff5f5;
  border-left-color: #e53e3e;
}

.result-highlight .result-label {
  color: #c53030;
}

.result-highlight .result-value {
  color: #c53030;
}

/* --- 内訳テーブル --- */
.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 12px;
}

.breakdown-table th,
.breakdown-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.breakdown-table th {
  background: #f7fafc;
  font-weight: 600;
  color: #4a5568;
}

.breakdown-table td:last-child {
  text-align: right;
  font-weight: 600;
}

/* --- 注記 --- */
.note {
  font-size: 0.8rem;
  color: #a0aec0;
  margin-top: 12px;
  line-height: 1.6;
}

.note::before {
  content: "※ ";
}

/* --- ステップ表示 --- */
.step-indicator {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.step-indicator .step {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #a0aec0;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-indicator .step.active {
  background: #2b6cb0;
  color: #fff;
}

.step-indicator .step.done {
  background: #48bb78;
  color: #fff;
}

/* --- メニューリスト（index.html用） --- */
.menu-list {
  list-style: none;
}

.menu-list li {
  margin-bottom: 12px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  padding: 18px 20px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.1s;
}

.menu-item:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.menu-item .icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  width: 48px;
  text-align: center;
}

.menu-item .text .title {
  font-size: 1rem;
  font-weight: 700;
  color: #1a365d;
}

.menu-item .text .desc {
  font-size: 0.82rem;
  color: #718096;
  margin-top: 2px;
}

.menu-item .arrow {
  margin-left: auto;
  color: #cbd5e0;
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* --- ステップナビゲーション --- */
.step-nav {
  background: #fff;
  border-bottom: 2px solid #e2e8f0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.step-nav-inner {
  display: flex;
  align-items: center;
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 12px;
  gap: 2px;
  white-space: nowrap;
}

.step-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 6px;
  color: #a0aec0;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.step-nav-item:hover {
  background: #f7fafc;
  color: #2b6cb0;
}

.step-nav-item.active {
  color: #2b6cb0;
  background: #ebf8ff;
}

.step-nav-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #a0aec0;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 3px;
  flex-shrink: 0;
}

.step-nav-item.active .step-nav-num {
  background: #2b6cb0;
  color: #fff;
}

.step-nav-item:hover .step-nav-num {
  background: #bee3f8;
  color: #2b6cb0;
}

.step-nav-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-align: center;
}

.step-nav-sep {
  color: #cbd5e0;
  font-size: 1rem;
  flex-shrink: 0;
  padding: 0 2px;
  margin-bottom: 10px;
}

/* 次へボタン（result.html 専用） */
.btn-next {
  display: block;
  width: 100%;
  padding: 16px;
  font-size: 1.05rem;
  font-weight: 700;
  background: #2b6cb0;
  color: #fff;
  border: none;
  border-radius: 10px;
  text-align: center;
  text-decoration: none;
  margin-bottom: 10px;
  transition: background 0.3s, box-shadow 0.3s, transform 0.1s;
}

.btn-next:hover {
  background: #2c5282;
  box-shadow: 0 4px 16px rgba(43, 108, 176, 0.35);
}
.btn-next:active { transform: scale(0.98); }

/* --- トップページへ戻るボタン --- */
.btn-top-link {
  display: inline-block;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #3182ce;
  background: #fff;
  border: 2px solid #3182ce;
  border-radius: 8px;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 2px 8px rgba(49, 130, 206, 0.15);
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}

.btn-top-link:hover {
  background: #3182ce;
  color: #fff;
  box-shadow: 0 4px 16px rgba(49, 130, 206, 0.3);
}

/* --- タイトル下広告コンテナ --- */
.ad-top-container {
  margin: 20px auto 10px;
  width: 100%;
  max-width: 900px;
  text-align: center;
}

/* --- フッター --- */
.site-footer {
  text-align: center;
  padding: 1px 16px 10px;
  font-size: 0.8rem;
  color: #a0aec0;
}

/* --- 下部広告コンテナ --- */
.ad-container {
  margin: 12px 0 0 !important;
  text-align: center;
}

/* --- レスポンシブ --- */
@media (max-width: 480px) {
  .site-header h1 {
    font-size: 1.2rem;
  }

  .result-box .result-value {
    font-size: 1.5rem;
  }
}
