/* ===== ベース ===== */
:root {
  --green: #1f9d72;
  --green-dark: #15795a;
  --green-light: #e8f6f0;
  --ink: #1f2937;
  --muted: #6b7280;
  --bg: #f5f7f6;
  --card: #ffffff;
  --accent: #ff7a45;
  --border: #e5e7eb;
  --radius: 14px;
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP",
    "Segoe UI", Meiryo, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== ヒーロー ===== */
.hero {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  color: #fff;
  padding: 40px 0 48px;
  text-align: center;
}
.hero__eyebrow {
  margin: 0 0 6px;
  font-size: 0.9rem;
  opacity: 0.9;
}
.hero__title {
  margin: 0 0 14px;
  font-size: 1.9rem;
  line-height: 1.3;
  font-weight: 800;
}
.hero__lead {
  margin: 0 auto 20px;
  max-width: 36em;
  font-size: 1rem;
}
.badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
}
.badge {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* ===== ボタン ===== */
.btn {
  display: inline-block;
  border: none;
  border-radius: 999px;
  padding: 14px 26px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform 0.05s ease, opacity 0.2s ease, background 0.2s ease;
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #ef6a35; }
.btn--ghost {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
}
.btn--text {
  background: transparent;
  color: var(--muted);
  padding: 14px 12px;
  font-weight: 600;
}
.btn--block { display: block; width: 100%; }

/* ===== カード ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px;
  margin: 20px 0;
}
.section-title {
  margin: 0 0 14px;
  font-size: 1.25rem;
  font-weight: 800;
  border-left: 5px solid var(--green);
  padding-left: 12px;
  line-height: 1.4;
}
.muted { color: var(--muted); font-size: 0.9rem; }

/* ===== 前提条件（世帯情報） ===== */
.prefs {
  border: 1.5px solid var(--green);
  background: var(--green-light);
  border-radius: 12px;
  padding: 14px 16px 16px;
  margin: 18px 0 4px;
}
.prefs__legend {
  font-weight: 800;
  color: var(--green-dark);
  padding: 0 8px;
}
.prefs__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.prefs__label { font-weight: 700; min-width: 110px; }
.prefs__select {
  flex: 1;
  min-width: 120px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 1.05rem;
  background: #fff;
}
.prefs__radios { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.prefs__radio {
  flex: 1;
  min-width: 130px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
}
.prefs__radio input { accent-color: var(--green); width: 18px; height: 18px; }
.prefs__radio small { color: var(--muted); }
.prefs__hint { font-size: 0.8rem; color: var(--muted); margin: 4px 0 0; }

/* ===== 「もっと詳しく」アコーディオン ===== */
.more {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  margin: 0 0 4px;
  background: #fafbfb;
}
.more__summary {
  cursor: pointer;
  font-weight: 700;
  padding: 12px 16px;
  color: var(--green-dark);
  list-style: none;
}
.more__summary::-webkit-details-marker { display: none; }
.more[open] .more__summary { border-bottom: 1px solid var(--border); }
.more__body { padding: 14px 16px 4px; }

/* ===== フォーム ===== */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 18px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-weight: 700; font-size: 0.95rem; }
.field__input {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.2s ease;
}
.field__input:focus-within { border-color: var(--green); }
.field__input input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 14px;
  font-size: 1.05rem;
  width: 100%;
  background: transparent;
}
.field__unit {
  padding: 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}
.form-actions {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.form-actions .btn--primary { width: 100%; }

/* ===== 結果サマリー ===== */
.summary__numbers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 8px 0 4px;
}
.summary__block {
  background: var(--green-light);
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
}
.summary__block--accent { background: #fff1ea; }
.summary__caption {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.summary__value {
  display: block;
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--green-dark);
}
.summary__block--accent .summary__value { color: var(--accent); }
.summary__total { margin: 14px 0 0; }
.summary__total .split { font-size: 0.82rem; color: var(--muted); }

/* 固定費/変動費 グループ見出し */
.advice-group {
  font-weight: 800;
  color: var(--green-dark);
  margin: 6px 0 2px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--green-light);
}
.advice-group__sub { font-size: 0.78rem; color: var(--muted); font-weight: 600; }

/* ===== シェア ===== */
.share {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  text-align: center;
}
.share__label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.share__buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.share__btn {
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  cursor: pointer;
}
.share__btn--x { background: #111827; }
.share__btn--line { background: #06c755; }
.share__btn--copy { background: var(--green); }
.share__btn--image { background: var(--accent); }
.share__btn:active { transform: scale(0.98); }

/* ===== アドバイス内アフィリリンク ===== */
.advice__link {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--green-dark);
  text-decoration: none;
  border: 1.5px solid var(--green);
  border-radius: 999px;
  padding: 7px 14px;
}
.advice__link:hover { background: var(--green-light); }

/* ===== TOP3 ===== */
.top3 { list-style: none; counter-reset: rank; padding: 0; margin: 0; }
.top3 li {
  counter-increment: rank;
  position: relative;
  background: #fafbfb;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 16px 16px 58px;
  margin-bottom: 12px;
}
.top3 li::before {
  content: counter(rank);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.top3 li:nth-child(1)::before { background: #e0a106; }
.top3 li:nth-child(2)::before { background: #8a9099; }
.top3 li:nth-child(3)::before { background: #b87333; }
.top3 .top3__name { font-weight: 800; font-size: 1.05rem; }
.top3 .top3__saving { color: var(--accent); font-weight: 800; }
.top3 .top3__desc { font-size: 0.9rem; color: var(--muted); margin: 4px 0 0; }

/* ===== アドバイス ===== */
.advice-list { display: flex; flex-direction: column; gap: 12px; }
.advice {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.advice__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.advice__name { font-weight: 800; }
.advice__saving { font-size: 0.85rem; color: var(--green-dark); font-weight: 700; }
.advice__text { margin: 8px 0 0; font-size: 0.92rem; }
.advice__note {
  margin: 8px 0 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--green-dark);
  background: var(--green-light);
  border-radius: 8px;
  padding: 6px 10px;
}

/* ===== アクション ===== */
.actions { list-style: none; padding: 0; margin: 0; }
.actions li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
}
.actions li:last-child { border-bottom: none; }
.actions input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--green);
  flex-shrink: 0;
}
.actions label { cursor: pointer; }

/* ===== CTA ===== */
.cta { background: var(--green-light); border: 1.5px solid #bfe6d6; }
.cta__lead { font-weight: 700; margin: 0 0 12px; }
.cta__points { padding-left: 0; list-style: none; margin: 0 0 18px; }
.cta__points li { margin-bottom: 8px; font-size: 0.95rem; }
.cta__note { margin-top: 12px; }

/* ===== 免責 / フッター ===== */
.disclaimer {
  font-size: 0.78rem;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 14px;
  margin: 20px 0;
}
.footer {
  background: #1f2937;
  color: #cbd5e1;
  padding: 28px 0;
  margin-top: 30px;
  text-align: center;
}
.footer__note { font-size: 0.82rem; margin: 0 0 8px; }
.footer__copy { font-size: 0.78rem; opacity: 0.7; margin: 0; }

/* ===== レスポンシブ（PCで2カラム） ===== */
@media (min-width: 600px) {
  .hero__title { font-size: 2.3rem; }
  .grid { grid-template-columns: 1fr 1fr; }
  .form-actions { flex-direction: row; justify-content: center; }
  .form-actions .btn--primary { width: auto; min-width: 260px; }
}
