/* かんたん概算査定ツール（指示書 v1.0 §3）
   site.css のカスタムプロパティ（--navy-900 等）を前提に、ツール部分だけを足す。
   ステップ切替でレイアウトシフトを起こさないよう、ステップ領域の高さを確保する。 */

.satei {
  --satei-radius: 6px;
  position: relative;
  padding: 26px 24px 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent);
  box-shadow: var(--shadow);
}
.satei *, .satei *::before, .satei *::after { box-sizing: border-box; }

.satei-head { margin-bottom: 18px; }
.satei-head h2 { margin: 0 0 6px; color: var(--navy-900); font-size: clamp(1.4rem, 3.4vw, 1.9rem); line-height: 1.35; }
.satei-head p { margin: 0; color: var(--muted); font-size: .95rem; }
.satei-head strong { color: var(--accent); }

/* ---- プログレス ---- */
.satei-progress { margin-bottom: 20px; }
.satei-progress-meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: .84rem; font-weight: 700; color: var(--navy-700); }
.satei-progress-meta span:last-child { color: var(--muted); font-weight: 600; }
.satei-progress-track { height: 6px; background: var(--navy-100); border-radius: 999px; overflow: hidden; }
.satei-progress-bar { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .3s ease; }

/* ---- ステップ ---- */
.satei-steps { min-height: 430px; }
.satei-step { display: none; }
.satei-step[data-active="true"] { display: block; }
.satei-step h3 { margin: 0 0 4px; color: var(--navy-900); font-size: 1.12rem; }
.satei-step .satei-hint { margin: 0 0 16px; color: var(--muted); font-size: .875rem; }

/* ---- 種別タイル ---- */
.satei-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.satei-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 118px; padding: 16px 10px; text-align: center;
  color: var(--navy-900); background: #fff; border: 2px solid var(--line);
  border-radius: var(--satei-radius); font-weight: 800; font-size: .98rem; cursor: pointer;
}
.satei-tile:hover { border-color: var(--navy-500); background: var(--navy-100); }
.satei-tile[aria-pressed="true"] { border-color: var(--accent); background: #fff5f0; }
.satei-tile-icon { font-size: 1.9rem; line-height: 1; }
.satei-tile-note { display: block; color: var(--muted); font-size: .76rem; font-weight: 600; }
.satei-other { margin: 16px 0 0; font-size: .875rem; }
.satei-other button { padding: 0; color: var(--navy-700); background: none; border: 0; font-weight: 700; text-decoration: underline; cursor: pointer; min-height: 0; }

/* ---- 入力 ---- */
.satei-fields { display: grid; gap: 16px; }
.satei-fields.satei-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.satei-field { display: flex; flex-direction: column; gap: 6px; }
.satei-field > label, .satei-field > .satei-legend { font-weight: 800; font-size: .92rem; color: var(--navy-900); }
.satei-field .satei-note { color: var(--muted); font-size: .8rem; font-weight: 500; }
.satei-field select, .satei-field input {
  width: 100%; min-height: 48px; padding: 10px 12px; font-size: 16px; /* iOSの自動ズーム防止 */
  color: var(--ink); background: #fff; border: 1px solid #9aa7b4; border-radius: var(--satei-radius);
}
.satei-field select:focus-visible, .satei-field input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.satei-field input[aria-invalid="true"], .satei-field select[aria-invalid="true"] { border-color: var(--red); background: #fff7f6; }
.satei-inline { display: flex; gap: 8px; align-items: stretch; }
.satei-inline input { flex: 1 1 auto; }
.satei-unit { display: inline-flex; flex: 0 0 auto; border: 1px solid #9aa7b4; border-radius: var(--satei-radius); overflow: hidden; }
.satei-unit button { min-width: 52px; padding: 0 10px; color: var(--navy-900); background: #f1f5f9; border: 0; font-weight: 800; font-size: .9rem; cursor: pointer; }
.satei-unit button[aria-pressed="true"] { color: #fff; background: var(--navy-700); }
.satei-error { display: none; color: var(--red); font-size: .84rem; font-weight: 700; }
.satei-error[data-shown="true"] { display: block; }
.satei-checkbox { display: flex; align-items: flex-start; gap: 8px; font-size: .9rem; font-weight: 700; }
.satei-checkbox input { width: 20px; min-height: 20px; margin-top: 3px; flex: 0 0 auto; }

/* ---- 操作ボタン ---- */
.satei-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.satei-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 26px; border: 2px solid transparent; border-radius: var(--satei-radius);
  font-weight: 900; font-size: 1rem; text-decoration: none; cursor: pointer;
}
.satei-btn-primary { flex: 1 1 240px; color: #fff; background: var(--accent); }
.satei-btn-primary:hover { background: var(--accent-dark); }
.satei-btn-primary[disabled] { background: #b9c2cc; cursor: not-allowed; }
.satei-btn-back { color: var(--navy-900); background: #fff; border-color: #9aa7b4; }

/* ---- 計算中 ---- */
.satei-loading { display: none; padding: 44px 0; text-align: center; }
.satei-loading[data-active="true"] { display: block; }
.satei-spinner { width: 46px; height: 46px; margin: 0 auto 18px; border: 4px solid var(--navy-100); border-top-color: var(--accent); border-radius: 50%; animation: satei-spin .9s linear infinite; }
@keyframes satei-spin { to { transform: rotate(360deg); } }
.satei-loading p { margin: 0; color: var(--navy-700); font-weight: 700; }

/* ---- 結果 ---- */
.satei-result h3 { margin: 0 0 2px; font-size: 1.05rem; color: var(--muted); font-weight: 800; }
.satei-price {
  margin: 6px 0 2px; color: var(--navy-900); font-weight: 900; line-height: 1.15;
  font-size: clamp(1.9rem, 7vw, 2.6rem); font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.satei-price-mid { margin: 0 0 18px; color: var(--muted); font-size: .95rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.satei-block { padding: 16px 0; border-top: 1px solid var(--line); }
.satei-block h4 { margin: 0 0 8px; font-size: .9rem; color: var(--navy-700); letter-spacing: .04em; }
.satei-breakdown { margin: 0; display: grid; gap: 6px; }
.satei-breakdown div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: .95rem; }
.satei-breakdown dt { font-weight: 700; }
.satei-breakdown dd { margin: 0; font-variant-numeric: tabular-nums; }
.satei-breakdown .satei-formula { display: block; margin-top: 4px; color: var(--muted); font-size: .82rem; }
.satei-confidence { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.satei-meter { display: inline-flex; gap: 4px; }
.satei-meter i { width: 13px; height: 13px; border-radius: 50%; background: var(--navy-100); border: 1px solid var(--navy-500); }
.satei-meter i[data-on="true"] { background: var(--navy-700); }
.satei-confidence-label { font-weight: 900; color: var(--navy-900); }
.satei-confidence-message { margin: 8px 0 0; color: var(--muted); font-size: .875rem; }
.satei-conditions { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.satei-conditions li { padding: 4px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: .8rem; font-weight: 700; }
.satei-notes { margin: 12px 0 0; padding: 14px 16px; background: var(--yellow); border-left: 5px solid #d7a600; font-size: .89rem; }
.satei-notes p { margin: 0 0 8px; }
.satei-notes p:last-child { margin: 0; }
.satei-disclaimer { margin-top: 16px; padding: 14px 16px; background: #fff0ed; border-left: 5px solid var(--red); font-size: .86rem; line-height: 1.7; }
.satei-disclaimer strong { display: block; margin-bottom: 4px; }

/* ---- 結果CTA ---- */
.satei-cta { margin-top: 20px; }
.satei-cta h4 { margin: 0 0 10px; color: var(--navy-900); font-size: 1.05rem; }
.satei-cta-list { display: grid; gap: 10px; }
.satei-cta-tel, .satei-cta-line, .satei-cta-form {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 60px;
  padding: 12px 18px; border-radius: var(--satei-radius); font-weight: 900; text-decoration: none; text-align: center;
}
.satei-cta-tel { color: #fff; background: var(--accent); font-size: 1.2rem; }
.satei-cta-tel small { display: block; font-size: .72rem; font-weight: 600; }
.satei-cta-tel-strong { min-height: 72px; font-size: 1.3rem; box-shadow: 0 6px 18px rgba(194, 65, 12, .35); }
.satei-cta-line { color: #fff; background: #06c755; }
.satei-cta-form { color: var(--navy-900); background: #fff; border: 2px solid var(--navy-500); }
.satei-cta-order-line .satei-cta-line { font-size: 1.15rem; min-height: 64px; }
.satei-sub-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.satei-sub-actions button {
  flex: 1 1 180px; min-height: 46px; padding: 8px 14px; color: var(--navy-900); background: #f1f5f9;
  border: 1px solid #9aa7b4; border-radius: var(--satei-radius); font-weight: 800; font-size: .9rem; cursor: pointer;
}
.satei-copy-note { margin: 8px 0 0; color: var(--muted); font-size: .82rem; }

/* 査定ツールの操作中はスマホ固定フッターCTAを隠す（§5.5） */
body[data-satei-active="true"] .mobile-cta { display: none !important; }

/* ---- スキップ（概算を出さない分岐） ---- */
.satei-skip { display: none; }
.satei-skip[data-active="true"] { display: block; }
.satei-skip h3 { margin: 0 0 10px; color: var(--navy-900); font-size: 1.25rem; }
.satei-skip > p { margin: 0 0 16px; font-size: 1rem; line-height: 1.8; }
.satei-skip strong { color: var(--accent); }

@media (max-width: 720px) {
  .satei { padding: 20px 16px 24px; }
  .satei-steps { min-height: 470px; }
  .satei-fields.satei-cols-2 { grid-template-columns: 1fr; }
  .satei-actions { flex-direction: column-reverse; }
  .satei-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .satei-spinner { animation-duration: 3s; }
  .satei-progress-bar { transition: none; }
}

/* ---- 印刷（PDF保存） ---- */
@media print {
  body > *:not(main), .site-header, .site-footer, .mobile-cta, .cta-band, .satei-sub-actions,
  .satei-progress, .satei-cta, .satei-step:not(.satei-step-result) { display: none !important; }
  main > section:not(.satei-section) { display: none !important; }
  .satei { border: 1px solid #333; box-shadow: none; padding: 0; }
  .satei-steps { min-height: 0; }
  .satei-price { font-size: 26pt; }
  .satei-print-only { display: block !important; }
  a[href]::after { content: ""; }
}
.satei-print-only { display: none; }
