/* =========================================
   相続税かんたん概算ツール - style.css
   トーン: 紺×白 / 士業らしい信頼感
   ========================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Yu Gothic", "游ゴシック", "Noto Sans JP", "Hiragino Sans", "ヒラギノ角ゴシック", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: #1a2438;
  background: #f4f6fa;
  -webkit-font-smoothing: antialiased;
}

/* カラー変数 */
:root {
  --navy-900: #0d1b3d;       /* ヘッダー / 強調 */
  --navy-800: #16275a;       /* タイトル */
  --navy-600: #2c4480;       /* アクセント */
  --navy-100: #e8edf7;       /* 薄い紺 */
  --gold:     #b89968;       /* 装飾アクセント */
  --red:      #c8233a;       /* 結果強調 */
  --green:    #2e7d4f;       /* OK表示 */
  --gray-700: #4a5568;
  --gray-500: #718096;
  --gray-300: #cbd5e0;
  --gray-100: #edf0f5;
  --white:    #ffffff;
  --bg:       #f4f6fa;
}

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

/* ----- ヘッダー ----- */
.site-header {
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-600) 100%);
  color: var(--white);
  padding: 28px 0 32px;
  border-bottom: 4px solid var(--gold);
  position: relative;
}

.site-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}

.site-subtitle {
  margin: 0;
  font-size: 13px;
  opacity: 0.9;
  line-height: 1.5;
}

@media (min-width: 600px) {
  .site-title { font-size: 28px; }
  .site-subtitle { font-size: 15px; }
}

/* ----- 注意書き（上部） ----- */
.notice-top {
  background: var(--navy-100);
  border-left: 4px solid var(--navy-600);
  border-radius: 4px;
  padding: 12px 16px;
  margin: 20px 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--navy-800);
}

.notice-top p { margin: 0; }
.notice-top p + p { margin-top: 8px; }
.notice-top strong { color: var(--navy-900); }
.notice-privacy {
  font-size: 12px !important;
  color: var(--gray-700);
  padding-top: 8px;
  border-top: 1px dashed var(--navy-600);
  line-height: 1.5;
}

/* ----- フォーム ----- */
.form {
  background: var(--white);
  border-radius: 8px;
  padding: 8px 0;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(13, 27, 61, 0.06);
}

.form-section {
  padding: 20px 20px 24px;
  border-bottom: 1px solid var(--gray-100);
}

.form-section:last-of-type {
  border-bottom: none;
}

.section-title {
  display: flex;
  align-items: center;
  font-size: 17px;
  font-weight: 700;
  color: var(--navy-900);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--navy-100);
}

.section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--navy-800);
  color: var(--white);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  margin-right: 10px;
  flex-shrink: 0;
}

.section-note {
  margin: -8px 0 16px;
  font-size: 13px;
  color: var(--gray-500);
}

/* ----- フィールド ----- */
.field {
  margin-bottom: 16px;
  position: relative;
}

.field:last-child {
  margin-bottom: 0;
}

.field-label {
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--navy-800);
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 4px;
}

fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

input[type="number"] {
  width: 100%;
  max-width: 220px;
  padding: 12px 14px;
  font-size: 16px; /* iOSのズーム回避 */
  border: 1.5px solid var(--gray-300);
  border-radius: 6px;
  background: var(--white);
  color: var(--navy-900);
  transition: border-color 0.2s;
  font-family: inherit;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"]:focus {
  outline: none;
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(44, 68, 128, 0.15);
}

.field-unit {
  display: inline-block;
  margin-left: 8px;
  font-size: 14px;
  color: var(--gray-700);
  font-weight: 500;
}

/* ----- ラジオボタン ----- */
.radio-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.radio-label {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border: 1.5px solid var(--gray-300);
  border-radius: 6px;
  cursor: pointer;
  background: var(--white);
  transition: all 0.15s;
  user-select: none;
  font-size: 15px;
  min-width: 100px;
  justify-content: center;
}

.radio-label:hover {
  border-color: var(--navy-600);
}

.radio-label input[type="radio"] {
  margin-right: 6px;
  accent-color: var(--navy-800);
}

.radio-label:has(input[type="radio"]:checked) {
  background: var(--navy-100);
  border-color: var(--navy-800);
  color: var(--navy-900);
  font-weight: 600;
}

/* ----- ツールチップ ----- */
.tooltip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 11px;
  font-weight: 700;
  background: var(--navy-100);
  color: var(--navy-800);
  border: 1px solid var(--navy-600);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  position: relative;
  font-family: inherit;
  line-height: 1;
}

.tooltip-btn:hover,
.tooltip-btn:focus {
  background: var(--navy-800);
  color: var(--white);
  outline: none;
}

.tooltip-btn:hover::after,
.tooltip-btn:focus::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: max-content;
  max-width: min(280px, 80vw);
  background: var(--navy-900);
  color: var(--white);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  white-space: normal;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  text-align: left;
}

.tooltip-btn:hover::before,
.tooltip-btn:focus::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--navy-900);
  z-index: 100;
}

/* ----- 条件付きブロック ----- */
.conditional-block {
  margin-top: 8px;
  padding: 16px;
  background: var(--gray-100);
  border-radius: 6px;
  border-left: 3px solid var(--navy-600);
}

/* ----- エラー ----- */
.error-box {
  background: #fff0f2;
  border: 1.5px solid var(--red);
  color: var(--red);
  padding: 12px 16px;
  margin: 0 20px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}

/* ----- 送信ボタン ----- */
.submit-wrap {
  padding: 24px 20px 28px;
  text-align: center;
}

.submit-btn {
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  padding: 18px 24px;
  font-size: 17px;
  font-weight: 700;
  color: var(--white);
  background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-600) 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.05em;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(13, 27, 61, 0.25);
  transition: transform 0.15s, box-shadow 0.15s;
}

.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(13, 27, 61, 0.3);
}

.submit-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(13, 27, 61, 0.25);
}

.reset-btn {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--gray-700);
  background: transparent;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}

.reset-btn:hover {
  background: var(--gray-100);
}

/* ----- 結果セクション ----- */
.result-section {
  background: var(--white);
  border-radius: 8px;
  padding: 24px 20px 28px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(13, 27, 61, 0.06);
  border-top: 4px solid var(--navy-800);
  animation: fadeIn 0.4s ease;
}

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

.result-title {
  font-size: 20px;
  color: var(--navy-900);
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--navy-100);
  text-align: center;
}

.result-block {
  margin-bottom: 24px;
}

.result-block-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy-800);
  margin: 0 0 10px;
  padding-left: 10px;
  border-left: 3px solid var(--gold);
}

.heirs-list {
  margin: 0;
  padding: 12px 14px;
  background: var(--navy-100);
  border-radius: 6px;
  font-size: 15px;
  color: var(--navy-900);
  font-weight: 600;
}

/* ----- 結果テーブル ----- */
.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.result-table th,
.result-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--gray-100);
  text-align: left;
  vertical-align: middle;
}

.result-table th {
  color: var(--gray-700);
  font-weight: 500;
  width: 55%;
}

.result-table td {
  color: var(--navy-900);
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.result-table tr.emphasized th,
.result-table tr.emphasized td {
  font-weight: 700;
  color: var(--navy-900);
  background: var(--navy-100);
  font-size: 15px;
}

/* 各人の納税額テーブル */
.per-heir-table th,
.per-heir-table td {
  font-size: 13px;
  text-align: center;
  padding: 8px 4px;
}

.per-heir-table thead th {
  background: var(--navy-800);
  color: var(--white);
  font-weight: 600;
  width: auto;
}

.per-heir-table tbody td {
  text-align: center;
}

.per-heir-table tbody td.tax-cell {
  color: var(--red);
  font-weight: 700;
}

/* ----- 相続税合計（赤強調） ----- */
.result-total {
  background: linear-gradient(135deg, #fff5f6 0%, #ffe8eb 100%);
  border: 2px solid var(--red);
  border-radius: 10px;
  padding: 20px;
  margin: 24px 0;
  text-align: center;
}

.result-total-label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
  letter-spacing: 0.05em;
}

.result-total-amount {
  margin: 0;
  font-size: 36px;
  font-weight: 800;
  color: var(--red);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 600px) {
  .result-total-amount { font-size: 44px; }
}

/* ----- 相続税ゼロブロック ----- */
.result-zero {
  background: linear-gradient(135deg, #e8f5ee 0%, #d1ebde 100%);
  border: 2px solid var(--green);
  border-radius: 10px;
  padding: 24px 20px;
  text-align: center;
  margin: 20px 0;
}

.zero-icon {
  font-size: 40px;
  color: var(--green);
  margin: 0 0 8px;
  font-weight: 700;
  line-height: 1;
}

.zero-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--green);
  margin: 0 0 10px;
}

.zero-desc {
  font-size: 13px;
  color: var(--gray-700);
  margin: 0;
  line-height: 1.6;
}

.note-small {
  font-size: 12px;
  color: var(--gray-500);
  margin: 8px 0 0;
}

/* ----- CTA セクション ----- */
.cta-section {
  margin-top: 28px;
  padding: 20px;
  background: var(--gray-100);
  border-radius: 8px;
}

.cta-lead {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--navy-800);
  text-align: center;
}

/* ステマ規制対応：広告表記 */
.cta-pr-label {
  margin: 0 0 12px;
  padding: 8px 12px;
  font-size: 11px;
  color: var(--gray-700);
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed var(--gray-300);
  border-radius: 4px;
  text-align: center;
}
.cta-pr-label strong {
  color: var(--navy-900);
}

.cta-pr-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 2px;
  margin-right: 7px;
  letter-spacing: 0.04em;
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
  opacity: 0.7;
  flex-shrink: 0;
  vertical-align: middle;
}

.cta-secondary .cta-pr-badge {
  background: transparent;
  color: var(--navy-600);
  border-color: var(--navy-600);
  opacity: 0.6;
}

.cta-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cta-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
  line-height: 1.4;
  position: relative;
}

.cta-button:hover {
  transform: translateY(-1px);
}

.cta-arrow {
  margin-left: 8px;
  font-weight: 400;
}

.cta-primary {
  background: var(--gold);
  color: var(--white);
  box-shadow: 0 3px 10px rgba(184, 153, 104, 0.3);
}

.cta-primary:hover {
  background: #a88859;
  box-shadow: 0 5px 14px rgba(184, 153, 104, 0.4);
}

.cta-secondary {
  background: var(--white);
  color: var(--navy-800);
  border: 1.5px solid var(--navy-600);
}

.cta-secondary:hover {
  background: var(--navy-100);
}

/* ----- 解説・FAQ セクション ----- */
.info-section {
  background: var(--white);
  border-radius: 8px;
  padding: 24px 20px 28px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(13, 27, 61, 0.06);
  border-left: 4px solid var(--gold);
}

.info-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--navy-900);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--navy-100);
}

.info-subtitle {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy-800);
  margin: 20px 0 8px;
  padding-left: 10px;
  border-left: 3px solid var(--navy-600);
}

.info-section p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--gray-700);
  margin: 8px 0;
}

.info-section strong {
  color: var(--navy-900);
}

.info-formula {
  background: var(--navy-100);
  border-radius: 6px;
  padding: 12px 16px;
  margin: 12px 0;
  text-align: center;
}
.info-formula p {
  margin: 0;
  font-size: 15px;
  color: var(--navy-900);
}

.info-rank-list,
.info-howto-list {
  margin: 8px 0 16px;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.9;
  color: var(--gray-700);
}
.info-rank-list li,
.info-howto-list li {
  margin-bottom: 8px;
}
.info-howto-list li {
  padding: 12px 14px;
  background: var(--gray-100);
  border-radius: 6px;
  margin-bottom: 10px;
  list-style-position: inside;
}

/* FAQ アコーディオン */
.faq-item {
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  margin-bottom: 8px;
  background: var(--white);
  transition: border-color 0.15s;
}
.faq-item[open] {
  border-color: var(--navy-600);
}
.faq-item summary {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--navy-800);
  list-style: none;
  position: relative;
  padding-right: 32px;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--navy-600);
  font-weight: 700;
}
.faq-item[open] summary::after {
  content: '−';
}
.faq-item summary:hover {
  background: var(--navy-100);
}
.faq-item p {
  padding: 0 16px 16px;
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
  color: var(--gray-700);
}

@media (min-width: 600px) {
  .info-section {
    padding: 28px 28px 32px;
  }
  .info-title {
    font-size: 22px;
  }
}

/* ----- 法的注意書き ----- */
.legal-notice {
  background: var(--navy-100);
  border-radius: 8px;
  padding: 20px;
  margin: 24px 0 40px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--gray-700);
}

.legal-notice h3 {
  font-size: 14px;
  color: var(--navy-900);
  margin: 0 0 10px;
  font-weight: 700;
}

.legal-notice p {
  margin: 0 0 10px;
}

.copyright {
  text-align: center;
  font-size: 11px !important;
  color: var(--gray-500) !important;
  margin: 16px 0 0 !important;
}

.footer-storage-note {
  font-size: 11px;
  color: var(--gray-700);
  background: rgba(255, 255, 255, 0.5);
  padding: 10px 12px;
  border-radius: 4px;
  margin: 14px 0 !important;
  line-height: 1.6;
}

.footer-nav {
  margin: 16px 0 0;
  padding: 14px 0 6px;
  border-top: 1px solid var(--gray-300);
  text-align: center;
  font-size: 12px;
  line-height: 2;
}
.footer-nav a {
  color: var(--navy-800);
  text-decoration: none;
  margin: 0 4px;
  white-space: nowrap;
}
.footer-nav a:hover {
  text-decoration: underline;
}
.footer-nav-sep {
  color: var(--gray-300);
  margin: 0 2px;
}

/* ----- レスポンシブ調整 ----- */
@media (min-width: 600px) {
  body { font-size: 16px; }

  .form-section {
    padding: 24px 28px 28px;
  }

  .section-title {
    font-size: 19px;
  }

  .submit-wrap {
    padding: 28px;
  }

  .result-section {
    padding: 32px 28px 36px;
  }

  .cta-buttons {
    /* 主要CTAは目立たせるため、デスクトップでも縦並びを維持 */
  }
}

/* =========================================
   介護費用シミュレーター 専用追加スタイル
   ========================================= */

/* 縦並びラジオボタン */
.radio-group-vertical {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-group-vertical .radio-label {
  min-width: auto;
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  padding: 12px 16px;
}

/* セレクトボックス */
select {
  width: 100%;
  max-width: 360px;
  padding: 12px 14px;
  font-size: 16px;
  border: 1.5px solid var(--gray-300);
  border-radius: 6px;
  background: var(--white);
  color: var(--navy-900);
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M6 8L0 0h12z' fill='%232c4480'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

select:focus {
  outline: none;
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(44, 68, 128, 0.15);
}

/* ライフサイクル連動ブロック */
.lifecycle-block {
  background: var(--navy-100);
  border-radius: 8px;
  padding: 20px;
  margin-top: 24px;
}

.lifecycle-block p {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--navy-800);
}

.lifecycle-link {
  display: inline-block;
  color: var(--navy-800);
  font-weight: 700;
  text-decoration: none;
  padding: 12px 16px;
  background: var(--white);
  border: 1.5px solid var(--navy-600);
  border-radius: 6px;
  transition: background 0.15s;
  font-size: 14px;
}

.lifecycle-link:hover {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}

/* 結果のサポートリスト */
#supportList {
  margin: 0;
  padding-left: 20px;
}

#supportList li {
  padding: 8px 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--gray-700);
}

#supportList strong {
  color: var(--navy-900);
}
