/* ============================================================
   無料査定フォーム（autoc-one / MOTA 車買取スタイル忠実再現）
   - 赤背景セクション + 白カード + 必須バッジ + 黒CTA
   - 第1ステップ → 第2ステップ → 確認画面 → 完了画面
   ============================================================ */

.kf-section {
  width: 100%;
  background: #e60012;
  padding: 28px 16px 36px;
}

.kf-section * {
  box-sizing: border-box;
}

/* ---- カード ---- */
.kf-card {
  position: relative;
  max-width: 448px;
  margin: 0 auto;
  background: #fff;
  border-radius: 14px;
  padding: 22px 18px 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

/* 「完全無料」バッジ（画像） */
.kf-card .kf-badge {
  position: absolute;
  top: -16px;
  right: -10px;
  width: 90px;
  height: auto;
  z-index: 1;
}

/* ヘッドコピー */
.kf-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}


.kf-head .kf-head-txt {
  font-size: 21px;
  font-weight: 700;
  color: #222;
  line-height: 1.4;
}

.kf-head .kf-head-txt b {
  color: #e60012;
  font-size: 40px;
  margin-right: 2px;
}

.kf-sub {
  font-size: 12px;
  color: #555;
  line-height: 1.6;
  margin-bottom: 16px;
  border-bottom: 1px solid #eee;
  padding-bottom: 14px;
}

/* ---- トップLP限定：見出し・説明を中央揃え ---- */
.kf-card[data-kf-page="top"] .kf-head {
  justify-content: center;
  text-align: center;
}

.kf-card[data-kf-page="top"] .kf-head::before,
.kf-card[data-kf-page="top"] .kf-head::after {
  content: "";
  width: 3px;
  height: 44px;
  background: #e60012;
  border-radius: 2px;
  flex-shrink: 0;
}

.kf-card[data-kf-page="top"] .kf-head::before {
  transform: translateY(8px) rotate(-18deg);
  margin-right: 16px;
}

.kf-card[data-kf-page="top"] .kf-head::after {
  transform: translateY(8px) rotate(18deg);
  margin-left: 16px;
}

.kf-card[data-kf-page="top"] .kf-sub {
  text-align: center;
}

/* ---- ファネル誘導三角（トップLPのみ。要素は index.html にしか置かない） ---- */
.kf-funnel-arrow {
  width: 0;
  height: 0;
  margin: 0 auto 14px;
  border-left: 26px solid transparent;
  border-right: 26px solid transparent;
  border-top: 26px solid #e60012;
}

/* ステップ表示 */
.kf-steps {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 18px;
}

.kf-steps .kf-step-dot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #aaa;
  font-weight: 700;
}

.kf-steps .kf-step-dot .kf-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ddd;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.kf-steps .kf-step-dot.is-active { color: #e60012; font-size: 15px; }
.kf-steps .kf-step-dot.is-active .kf-num { background: #e60012; width: 28px; height: 28px; font-size: 15px; }
.kf-steps .kf-step-dot.is-done .kf-num { background: #011e62; }
.kf-steps .kf-arrow { color: #ccc; align-self: center; }

/* ---- フォーム行 ---- */
.kf-row {
  margin-bottom: 14px;
}

.kf-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.kf-label > span:first-child {
  font-size: 14px;
  font-weight: 700;
  color: #222;
}

.kf-required {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #e60012;
  border-radius: 3px;
  padding: 2px 6px;
  line-height: 1;
}

/* 入力済み「OK」バッジ */
.kf-ok {
  display: none;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #011e62;
  border-radius: 3px;
  padding: 2px 7px;
  line-height: 1;
}
.kf-row.is-done .kf-ok { display: inline-block; }
.kf-row.is-done .kf-required { display: none; }
.kf-row.is-done .kf-select-btn { border-color: #011e62; }

/* 選択ボタン（メーカー/車種/年式/グレード） */
.kf-select-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1.5px solid #d2d2d2;
  border-radius: 8px;
  padding: 13px 14px;
  font-size: 15px;
  color: #999;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s;
}

.kf-select-btn.is-filled { color: #222; font-weight: 600; }
.kf-select-btn:disabled { background: #f5f5f5; cursor: not-allowed; opacity: 0.7; }
.kf-select-btn:not(:disabled):hover { border-color: #011e62; }

.kf-select-btn .kf-icon {
  flex-shrink: 0;
  color: #e60012;
  font-size: 20px;
  line-height: 1;
}

/* テキスト/数値 入力 */
.kf-input {
  width: 100%;
  border: 1.5px solid #d2d2d2;
  border-radius: 8px;
  padding: 13px 14px;
  font-size: 15px;
  color: #222;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
}

.kf-input:focus {
  outline: none;
  border-color: #011e62;
}

/* エラーメッセージ */
.kf-error {
  display: none;
  font-size: 12px;
  color: #e60012;
  margin-top: 5px;
}
.kf-row.has-error .kf-error { display: block; }
.kf-row.has-error .kf-select-btn,
.kf-row.has-error .kf-input { border-color: #e60012; }

/* ---- CTA ボタン ---- */
.kf-cta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #e60012;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 16px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
  transition: transform 0.1s, opacity 0.2s;
}
.kf-cta { transition: background-color 0.2s, transform 0.1s; }
.kf-cta:not(.is-back) {
  background: linear-gradient(180deg, #F0030F 0%, #F0030F 50%, #D11319 50%, #D11319 100%);
  position: relative;
  padding-left: 46px;
  padding-right: 46px;
}
.kf-cta:not(.is-back)::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-top: 3px solid #fff;
  border-right: 3px solid #fff;
  transform: translateY(-50%) rotate(45deg);
}
.kf-cta:not(.is-back):hover {
  background: linear-gradient(180deg, #F0030F 0%, #F0030F 50%, #D11319 50%, #D11319 100%);
  filter: brightness(1.12);
}
.kf-cta:hover { background: #b8000e; }
.kf-cta:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
.kf-cta:disabled { opacity: 0.5; cursor: not-allowed; }

.kf-cta .kf-cta-free {
  background: #fff;
  color: #1a1a1a;
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
  padding: 4px 12px;
}

.kf-cta.is-back {
  background: #fff;
  color: #555;
  border: 1.5px solid #ccc;
  box-shadow: none;
  font-size: 15px;
}

.kf-btn-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.kf-btn-row .kf-cta { margin-top: 0; }
.kf-btn-row .kf-cta.is-back { flex: 0 0 38%; }
.kf-btn-row .kf-cta.is-next { flex: 1; }

.kf-btn-row--stack { flex-direction: column; }
.kf-btn-row--stack .kf-cta.is-next { flex: 0 0 auto; width: 100%; }
.kf-btn-row--stack .kf-cta.is-back { flex: 0 0 auto; width: 60%; align-self: center; }

.kf-note {
  font-size: 11px;
  color: #fff;
  text-align: center;
  margin-top: 14px;
  line-height: 1.7;
  opacity: 0.92;
}
.kf-note a { color: #fff; text-decoration: underline; }

/* ---- パネル切り替え ---- */
.kf-panel { display: none; }
.kf-panel.is-active { display: block; }

/* セクション見出し（お車の情報 / お客様の情報） */
.kf-section-head {
  font-size: 15px;
  font-weight: 700;
  color: #222;
  margin: 4px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e60012;
}
.kf-section-head + .kf-step2-lead { margin-top: -6px; }
.kf-panel .kf-section-head ~ .kf-section-head { margin-top: 26px; }

/* インライン選択（修復歴・売却希望時期） */
.kf-choice-inline {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.kf-choice-inline button {
  border: 1.5px solid #d2d2d2;
  border-radius: 8px;
  background: #f7f7f7;
  padding: 12px 6px;
  font-size: 14px;
  font-weight: 700;
  color: #333;
  cursor: pointer;
  transition: all 0.15s;
}
.kf-choice-inline button:hover { border-color: #011e62; }
.kf-choice-inline button.is-selected {
  border-color: #011e62;
  background: #eef2fb;
  color: #011e62;
}

/* お客様情報ステップの補足 */
.kf-step2-lead {
  font-size: 13px;
  color: #555;
  margin-bottom: 16px;
  line-height: 1.6;
}
.kf-row-note {
  font-size: 11px;
  color: #888;
  margin-bottom: 6px;
  line-height: 1.5;
}
.kf-agree-note {
  font-size: 11px;
  color: #888;
  text-align: center;
  margin: 4px 0 12px;
  line-height: 1.6;
}

/* モーダル注記 */
.kf-modal-note {
  display: none;
  font-size: 12px;
  color: #888;
  padding: 8px 18px 0;
  line-height: 1.6;
}

/* カラースウォッチ */
.kf-swatch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 10px;
}
.kf-swatch-grid button {
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px;
}
.kf-swatch {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: block;
}
.kf-swatch-label {
  font-size: 12px;
  color: #444;
  font-weight: 600;
}

/* 選択肢グリッド（修復歴・売却希望時期） */
.kf-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.kf-choice-grid.is-wide { grid-template-columns: 1fr; }
.kf-choice {
  border: 1.5px solid #d2d2d2;
  border-radius: 10px;
  background: #f7f7f7;
  padding: 18px 8px;
  font-size: 15px;
  font-weight: 700;
  color: #333;
  cursor: pointer;
  transition: all 0.15s;
}
.kf-choice:hover { border-color: #011e62; color: #011e62; background: #eef2fb; }
.kf-choice.is-selected { border-color: #011e62; background: #eef2fb; color: #011e62; }

/* ハニーポット（視覚的に隠す・bot のみ入力） */
.kf-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* 送信エラー */
.kf-submit-error {
  display: none;
  font-size: 13px;
  color: #e60012;
  background: #fff3f3;
  border: 1px solid #f3c2c2;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  line-height: 1.6;
}

/* ---- 確認画面 ---- */
.kf-confirm-title {
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
  color: #222;
}
.kf-confirm-lead {
  font-size: 12px;
  color: #666;
  text-align: center;
  margin-bottom: 16px;
}
.kf-confirm-list {
  border-top: 1px solid #eee;
  margin-bottom: 16px;
}
.kf-confirm-list dl {
  display: flex;
  border-bottom: 1px solid #eee;
  padding: 11px 2px;
  gap: 10px;
}
.kf-confirm-list dt {
  flex: 0 0 38%;
  font-size: 13px;
  color: #888;
  font-weight: 700;
}
.kf-confirm-list dd {
  flex: 1;
  font-size: 14px;
  color: #222;
  word-break: break-all;
}

/* ---- 完了画面 ---- */
.kf-done {
  text-align: center;
  padding: 18px 4px;
}
.kf-done .kf-done-check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #011e62;
  color: #fff;
  font-size: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.kf-done h3 {
  font-size: 19px;
  color: #222;
  margin-bottom: 10px;
}
.kf-done p {
  font-size: 13px;
  color: #555;
  line-height: 1.8;
}
.kf-done .kf-tel {
  margin-top: 18px;
  padding: 14px;
  background: #fff7f7;
  border-radius: 10px;
}
.kf-done .kf-tel a {
  font-size: 22px;
  font-weight: 800;
  color: #e60012;
  text-decoration: none;
}

/* ---- モーダル（選択肢・画面いっぱい近くまで広がる中央カード） ---- */
.kf-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  /* 周囲の余白（上下は少し広め・セーフエリア考慮） */
  padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
}
.kf-modal.is-open { display: flex; }

.kf-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

/* 周囲に余白を残し角丸・中身は内部スクロール（autoc-one / MOTA 準拠） */
.kf-modal-box {
  position: relative;
  background: #fff;
  width: 100%;
  max-width: 480px;
  height: 100%;
  max-height: 100%;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  animation: kf-modal-in 0.22s ease;
}

@keyframes kf-modal-in {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* PC: モーダルを広げて中央ダイアログ表示（モバイルは100%幅/高さのまま維持） */
@media (min-width: 769px) {
  .kf-modal-box {
    max-width: 800px;
    height: auto;
    max-height: 85vh;
  }
}

.kf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}
.kf-modal-header h4 {
  font-size: 16px;
  font-weight: 700;
  color: #222;
}
.kf-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: #fff;
  color: #666;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kf-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 18px 24px;
}

/* メーカーグリッド（3列・autoc-one / MOTA 準拠） */
.kf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.kf-grid button {
  border: 1.5px solid #e2e2e2;
  border-radius: 10px;
  background: #fff;
  padding: 16px 6px;
  font-size: 13px;
  font-weight: 700;
  color: #333;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.3;
  word-break: break-word;
}
.kf-grid button:hover { border-color: #011e62; color: #011e62; }

/* ============================================================
   sell.html（査定依頼フォーム本体ページ）専用の画面まわり
   ============================================================ */
.kf-sell-header {
  position: sticky;
  top: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}
.kf-sell-header img {
  height: 24px;
  width: auto;
  display: block;
}
.kf-section--sell {
  background: #011e62;
}

/* リスト選択（車種/年式/グレード） */
.kf-list button {
  width: 100%;
  text-align: left;
  border: none;
  border-bottom: 1px solid #eee;
  background: #fff;
  padding: 15px 6px;
  font-size: 15px;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kf-list button:hover { background: #eef2fb; color: #011e62; }
.kf-list button .kf-chev { color: #ccc; }

/* ===== 追加項目（型式・車台番号・写真・PRコメント / 任意） ===== */
/* 「任意」バッジ（必須バッジのグレー版） */
.kf-optional {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #9aa0a6;
  border-radius: 3px;
  padding: 2px 6px;
  line-height: 1;
}

/* 複数行入力（PRコメント） */
.kf-textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.6;
  font-family: inherit;
}

/* ファイル選択（車両写真） */
.kf-file {
  width: 100%;
  border: 1.5px dashed #c4c4c4;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  color: #444;
  background: #fafafa;
  cursor: pointer;
}
.kf-file:focus { outline: none; border-color: #011e62; }

/* 選択中の写真プレビュー */
.kf-photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.kf-photo-chip {
  max-width: 100%;
  font-size: 12px;
  color: #011e62;
  background: #eef2fb;
  border-radius: 4px;
  padding: 4px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kf-photo-count {
  width: 100%;
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}

/* グレード手入力モーダル */
.kf-grade-input { display: flex; flex-direction: column; gap: 12px; }
.kf-grade-input .kf-grade-ok { margin-top: 0; }
.kf-grade-unknown {
  width: 100%;
  border: 1.5px solid #d2d2d2;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  color: #555;
  background: #fff;
  cursor: pointer;
}
.kf-grade-unknown:hover { border-color: #011e62; color: #011e62; background: #eef2fb; }
