:root {
  --primary: #c026d3;
  --primary-hover: #a21caf;
  --husband-blue: #2563eb;
  --wife-pink: #ec4899;
  --accent-green: #10b981;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 6px 18px rgba(0,0,0,0.07);
  --shadow-lg: 0 12px 28px rgba(0,0,0,0.1);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background-color: var(--bg-page); color: var(--text-main); font-family: var(--font-family); line-height: 1.6; -webkit-font-smoothing: antialiased; }
.page-wrapper { max-width: 1040px; margin: 0 auto; padding: 0 16px 60px; }

/* ヘッダー */
.site-header { padding: 20px 0; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text-main); }
.logo-icon { font-size: 1.8rem; color: var(--primary); }
.logo-title { font-size: 1.15rem; font-weight: 800; display: block; }
.logo-badge { font-size: 0.75rem; font-weight: 700; color: var(--primary); background: #fdf4ff; border: 1px solid #f5d0fe; padding: 2px 8px; border-radius: 4px; display: inline-block; margin-top: 2px; }

/* ヒーロー */
.hero-section { text-align: center; padding: 24px 10px 32px; }
.hero-section h1 { font-size: 2rem; font-weight: 800; color: #0f172a; margin-bottom: 12px; line-height: 1.35; }
.hero-desc { font-size: 0.95rem; color: var(--text-muted); max-width: 720px; margin: 0 auto; line-height: 1.7; }

/* コンテナ */
.sim-container { display: flex; flex-direction: column; gap: 24px; }
.calc-card, .results-card, .affiliate-section, .seo-faq-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 30px;
  box-shadow: var(--shadow-sm);
}

.card-heading {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-heading i { color: var(--primary); }

/* 夫婦入力グリッド */
.couple-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.person-box {
  border-radius: var(--radius-md);
  padding: 22px;
  border: 2px solid;
}
.person-box.husband {
  background: #f8faff;
  border-color: #bfdbfe;
}
.person-box.wife {
  background: #fdfafc;
  border-color: #fbcfe8;
}

.person-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px dashed;
}
.person-box.husband .person-header { color: var(--husband-blue); border-color: #bfdbfe; }
.person-box.wife .person-header { color: var(--wife-pink); border-color: #fbcfe8; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.form-group label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}
.val-display {
  font-size: 1.2rem;
  font-weight: 800;
}
.husband-val { color: var(--husband-blue); }
.wife-val { color: var(--wife-pink); }

/* スライダー */
.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #cbd5e1;
  outline: none;
}
.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: transform 0.1s;
}
.range-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.husband .range-slider::-webkit-slider-thumb { background: var(--husband-blue); }
.wife .range-slider::-webkit-slider-thumb { background: var(--wife-pink); }
.common-setting .range-slider::-webkit-slider-thumb { background: var(--primary); }

.range-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* トグルスイッチ（2025年法改正手取り10割） */
.special-law-card {
  background: linear-gradient(135deg, #fdf4ff 0%, #fae8ff 100%);
  border: 1px solid #f0abfc;
  border-radius: var(--radius-md);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.special-law-info { flex-grow: 1; }
.special-law-title { font-size: 1rem; font-weight: 800; color: #86198f; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.special-law-badge { font-size: 0.7rem; font-weight: 800; background: #c026d3; color: #ffffff; padding: 2px 6px; border-radius: 4px; }
.special-law-desc { font-size: 0.82rem; color: #701a75; line-height: 1.5; }

.switch {
  position: relative;
  display: inline-block;
  width: 54px;
  height: 30px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider-toggle {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 34px;
}
.slider-toggle:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
input:checked + .slider-toggle { background-color: var(--primary); }
input:checked + .slider-toggle:before { transform: translateX(24px); }

/* 結果エリア */
.result-hero-box {
  background: linear-gradient(135deg, #fdf4ff 0%, #fdf2f8 50%, #eff6ff 100%);
  border: 2px solid #e9d5ff;
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  margin-bottom: 24px;
}
.result-hero-label { font-size: 1rem; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.result-hero-total { font-size: 2.5rem; font-weight: 900; color: #86198f; line-height: 1.2; margin-bottom: 8px; }
.result-hero-total .unit { font-size: 1.3rem; font-weight: 700; color: var(--text-main); }
.result-hero-sub { font-size: 0.95rem; font-weight: 700; color: #4338ca; }

/* 比較サマリーグリッド */
.stat-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.stat-box.husband-card { border-top: 4px solid var(--husband-blue); }
.stat-box.wife-card { border-top: 4px solid var(--wife-pink); }
.stat-box.tax-card { border-top: 4px solid var(--accent-green); background: #f0fdf4; }

.stat-label { font-size: 0.82rem; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.stat-num { font-size: 1.45rem; font-weight: 800; color: var(--text-main); line-height: 1.2; margin-bottom: 4px; }
.stat-desc { font-size: 0.78rem; color: var(--text-muted); }

/* タイムライン・グラフ */
.chart-wrapper {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
}
.chart-title { font-size: 1.05rem; font-weight: 800; color: var(--text-main); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.chart-title i { color: var(--primary); }

/* アラート・注意バナー */
.alert-notice-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 28px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.alert-notice-icon { font-size: 1.5rem; color: #d97706; flex-shrink: 0; margin-top: 2px; }
.alert-notice-content h4 { font-size: 0.95rem; font-weight: 800; color: #92400e; margin-bottom: 4px; }
.alert-notice-content p { font-size: 0.85rem; color: #78350f; line-height: 1.6; }

/* アフィリエイト枠 */
.aff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.aff-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}
.aff-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.aff-card.featured { border-color: var(--primary); box-shadow: 0 4px 16px rgba(192, 38, 211, 0.15); }
.aff-tag { align-self: flex-start; font-size: 0.75rem; font-weight: 700; color: #86198f; background: #fdf4ff; border: 1px solid #f5d0fe; padding: 3px 8px; border-radius: 4px; margin-bottom: 12px; }
.aff-brand { font-size: 0.85rem; font-weight: 700; color: var(--primary); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.aff-card h4 { font-size: 1.05rem; font-weight: 800; color: #0f172a; margin-bottom: 8px; line-height: 1.4; }
.aff-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 16px; flex-grow: 1; }
.aff-points { list-style: none; font-size: 0.8rem; color: #334155; display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.aff-points i { color: var(--accent-green); margin-right: 4px; }
.aff-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background-color: var(--primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 3px 10px rgba(192, 38, 211, 0.25);
}
.aff-btn:hover { background-color: var(--primary-hover); }
.aff-btn.btn-secondary { background-color: #0284c7; box-shadow: 0 3px 10px rgba(2, 132, 199, 0.25); }
.aff-btn.btn-secondary:hover { background-color: #0369a1; }
.aff-btn.btn-green { background-color: var(--accent-green); box-shadow: 0 3px 10px rgba(16, 185, 129, 0.25); }
.aff-btn.btn-green:hover { background-color: #059669; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 16px; }
.faq-item { background: #f8fafc; border-radius: var(--radius-sm); border: 1px solid var(--border); padding: 18px 20px; }
.faq-q { font-size: 0.98rem; font-weight: 800; color: var(--text-main); margin-bottom: 8px; line-height: 1.4; }
.faq-a { font-size: 0.88rem; color: #334155; line-height: 1.65; }

/* フッター */
.site-footer { text-align: center; padding-top: 24px; border-top: 1px solid var(--border); font-size: 0.85rem; color: var(--text-muted); margin-top: 24px; }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; margin-bottom: 14px; }
.footer-links a { color: var(--primary); text-decoration: none; font-weight: 600; }
.footer-links a:hover { text-decoration: underline; }
.copy { margin-bottom: 6px; }
.disclaimer { font-size: 0.76rem; color: #94a3b8; }

@media (max-width: 768px) {
  .couple-grid { grid-template-columns: 1fr; }
  .hero-section h1 { font-size: 1.6rem; }
  .calc-card, .results-card, .affiliate-section, .seo-faq-section { padding: 20px 16px; }
  .result-hero-total { font-size: 2rem; }
}
