/* ==========================================================================
   記事内の資料DLフォーム（inc/parts/carousel-step-form.php）
   すべて .csf 配下に閉じる（記事本文・旧カルーセルのCSSと干渉させない）
   案A（csf--a）：1問ずつ／案B（csf--b）：2ステップ・左に資料／案C（csf--c）：1画面で段階表示
   ========================================================================== */
.csf {
  --csf-ink: #0b1f4d;
  --csf-ink2: #33415e;
  --csf-mute: #6b7690;
  --csf-line: #dfe5f1;
  --csf-bg: #f4f7fc;
  --csf-blue: #1f5fe0;
  --csf-blue2: #e9f0ff;
  --csf-cta: #ff6b5b;
  --csf-cta2: #ff9a85;
  --csf-ok: #12a150;
  --csf-err: #d93a3a;
  container-type: inline-size;
  position: relative;
  margin: 48px 0;
  border-radius: 20px;
  background: #fff;
  color: var(--csf-ink);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 0 var(--csf-line), 0 24px 48px -28px rgba(11, 31, 77, 0.35);
  overflow: hidden;
}
.csf *,
.csf *::before,
.csf *::after { box-sizing: border-box; }
.csf p,
.csf ul,
.csf figure,
.csf fieldset { margin: 0; padding: 0; }
.csf ul { list-style: none; }
.csf fieldset { border: 0; min-width: 0; }
.csf [hidden] { display: none !important; }
/* 記事本文の ul/li 装飾（「・」や字下げ）を打ち消す */
.csf ul > li { margin: 0 !important; padding: 0; list-style: none !important; background: none; text-indent: 0; }
.csf ul > li::before,
.csf ul > li::marker { content: none !important; }
/* 記事本文の li::before に translate: 0 -50% が付いているので、フォーム内では打ち消す（チェックマークが上にずれる原因） */
.csf li::before { translate: none !important; transform: none !important; }
.csf label,
.csf legend { margin: 0; padding: 0; }

/* ---- 見出し・資料 ---- */
.csf-head { display: flex; gap: 24px; align-items: center; padding: 28px 28px 22px; }
.csf-head__text { flex: 1 1 auto; min-width: 0; }
.csf-kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--csf-blue); font-size: 13px; font-weight: 800; letter-spacing: 0.08em; }
.csf-kicker__free { padding: 2px 8px; border-radius: 4px; background: var(--csf-cta); color: #fff; font-size: 12px; letter-spacing: 0.06em; }
.csf .csf-title { margin-top: 8px; color: var(--csf-ink); font-size: 24px; font-weight: 900; line-height: 1.4; letter-spacing: 0.01em; }
.csf .csf-desc { margin-top: 6px; color: var(--csf-ink2); font-size: 15px; font-weight: 600; }
.csf-learn { margin-top: 14px !important; display: grid; gap: 6px; }
.csf .csf-learn > li { position: relative !important; padding-left: 26px !important; color: var(--csf-ink) !important; font-size: 15px !important; font-weight: 700 !important; line-height: 1.5 !important; }
.csf .csf-learn > li::before { content: "" !important; position: absolute !important; left: 0 !important; top: 3px !important; width: 18px !important; height: 18px !important; border-radius: 50% !important; background: var(--csf-blue2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.4l2.6 2.6L13 6.6' fill='none' stroke='%231f5fe0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px no-repeat !important; }
.csf-doc { flex: 0 0 230px; }
.csf .csf-doc img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; box-shadow: 0 18px 30px -18px rgba(11, 31, 77, 0.55); transform: rotate(-2deg); }
.csf-doc figcaption { margin-top: 12px; color: var(--csf-ink); font-size: 13px; font-weight: 800; line-height: 1.4; text-align: center; }
.csf-doc figcaption span { display: block; color: var(--csf-mute); font-size: 12px; font-weight: 700; }

/* ---- 進捗 ---- */
.csf-body { padding: 0 28px 26px; }
.csf-progress { margin-bottom: 18px; }
.csf-progress__bar { height: 8px; border-radius: 999px; background: var(--csf-bg); overflow: hidden; }
.csf-progress__bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--csf-blue), #4f8cff); transition: width 0.35s ease; }
.csf-progress__txt { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px !important; color: var(--csf-ink); font-size: 14px; font-weight: 800; }
.csf-progress__time { color: var(--csf-mute); font-weight: 700; }
.csf.is-complete .csf-progress__txt [data-csf-left] { color: var(--csf-ok); }

/* ---- 入力欄 ---- */
.csf-step__no { margin-bottom: 10px !important; color: var(--csf-blue); font-size: 13px; font-weight: 900; letter-spacing: 0.1em; }
.csf-step__no span { color: var(--csf-mute); font-weight: 700; }
.csf-fields { display: grid; gap: 16px; }
.csf-label { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: var(--csf-ink); font-size: 15px; font-weight: 800; }
.csf-req { padding: 1px 6px; border-radius: 4px; background: #fdecec; color: var(--csf-err); font-size: 11px; font-weight: 800; }
.csf .csf-input { display: block; width: 100%; height: 56px; margin: 0; padding: 0 16px; border: 2px solid var(--csf-line); border-radius: 12px; background: #fff; color: var(--csf-ink); font-size: 17px; font-weight: 600; line-height: 1.4; -webkit-appearance: none; appearance: none; transition: border-color 0.2s, box-shadow 0.2s; }
.csf .csf-input::placeholder { color: #9aa4ba; font-weight: 500; }
.csf .csf-input:focus { outline: none; border-color: var(--csf-blue); box-shadow: 0 0 0 4px rgba(31, 95, 224, 0.14); }
.csf-field.is-done .csf-input { border-color: #bfe6cf; background: #fbfffc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.4l3.2 3.2L15 6.8' fill='none' stroke='%2312a150' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 14px center/20px no-repeat; padding-right: 44px; }
.csf-field.is-error .csf-input { border-color: var(--csf-err); }
.csf-hint { margin-top: 6px !important; color: var(--csf-mute); font-size: 13px; font-weight: 600; }
.csf-err { margin-top: 6px !important; color: var(--csf-err); font-size: 13px; font-weight: 800; }
.csf-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.csf-chip { position: relative; display: block; cursor: pointer; }
.csf .csf-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.csf-chip span { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 6px 8px; border: 2px solid var(--csf-line); border-radius: 10px; background: #fff; color: var(--csf-ink); font-size: 14px; font-weight: 800; line-height: 1.3; text-align: center; transition: border-color 0.2s, background 0.2s, color 0.2s; }
.csf-chip:hover span { border-color: #b9c8ea; }
.csf-chip input:checked + span { border-color: var(--csf-blue); background: var(--csf-blue); color: #fff; }
.csf-chip input:focus-visible + span { box-shadow: 0 0 0 4px rgba(31, 95, 224, 0.2); }

/* ---- ボタン ---- */
.csf-actions { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.csf .csf-btn { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; gap: 8px; height: 60px; margin: 0; padding: 0 20px; border: 0; border-radius: 999px; background: linear-gradient(100deg, var(--csf-cta) 0%, var(--csf-cta2) 100%); box-shadow: 0 14px 30px -12px rgba(255, 107, 91, 0.65); color: #fff; font-size: 18px; font-weight: 900; letter-spacing: 0.04em; cursor: pointer; -webkit-appearance: none; appearance: none; transition: transform 0.2s, box-shadow 0.2s; }
.csf .csf-btn::after { content: "→"; font-weight: 700; }
.csf .csf-btn:hover { transform: translateY(-1px); box-shadow: 0 18px 34px -12px rgba(255, 107, 91, 0.75); }
.csf .csf-btn--next { background: var(--csf-ink); box-shadow: 0 14px 30px -14px rgba(11, 31, 77, 0.6); }
.csf .csf-back { flex: 0 0 auto; height: 60px; margin: 0; padding: 0 18px; border: 2px solid var(--csf-line); border-radius: 999px; background: #fff; color: var(--csf-ink2); font-size: 15px; font-weight: 800; cursor: pointer; }
.csf-assure { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-top: 14px !important; }
.csf .csf-assure > li { position: relative !important; padding-left: 20px !important; color: var(--csf-ink2) !important; font-size: 13px !important; font-weight: 700 !important; }
.csf .csf-assure > li::before { content: "" !important; position: absolute !important; left: 0 !important; top: 4px !important; width: 14px !important; height: 14px !important; border-radius: 50% !important; background: #e7f6ee url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3.6 7.2l2.2 2.2L10.4 4.8' fill='none' stroke='%2312a150' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat !important; }
.csf-policy { margin-top: 10px !important; color: var(--csf-mute); font-size: 12px; text-align: center; }
.csf-policy a { color: inherit; text-decoration: underline; }
.csf ._formrun_gotcha { position: absolute !important; width: 1px; height: 1px; overflow: hidden; }

/* ==========================================================================
   案A：1問ずつ（濃紺の見出し帯＋大きな1問）
   ========================================================================== */
.csf--a .csf-head { padding: 30px 30px 26px; background: radial-gradient(120% 120% at 100% 0%, rgba(79, 140, 255, 0.35), rgba(79, 140, 255, 0) 55%), linear-gradient(160deg, #10306e, #0b1f4d); color: #fff; }
.csf--a .csf-kicker { color: #9cc0ff; }
.csf--a .csf-title { color: #fff; }
.csf--a .csf-desc { color: rgba(255, 255, 255, 0.85); }
.csf--a .csf-learn > li { color: #fff !important; }
.csf--a .csf-learn > li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Ccircle cx='9' cy='9' r='9' fill='rgba(255,255,255,0.18)'/%3E%3Cpath d='M5 9.2l2.6 2.6L13 6.4' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important; background-color: transparent !important; }
.csf--a .csf-doc figcaption { color: #fff; }
.csf--a .csf-doc figcaption span { color: rgba(255, 255, 255, 0.7); }
.csf--a .csf-body { padding-top: 24px; }
.csf--a .csf-label { font-size: 20px; font-weight: 900; }
.csf--a .csf-input { height: 64px; font-size: 19px; }

/* ==========================================================================
   案B：2ステップ（左に資料、右にフォームカード）
   ========================================================================== */
.csf--b { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--csf-bg); }
.csf--b .csf-head { flex-direction: column; align-items: stretch; gap: 18px; padding: 30px 26px; }
.csf--b .csf-doc { order: -1; flex: 0 0 auto; max-width: 300px; }
.csf--b .csf-doc img { transform: none; }
.csf--b .csf-doc figcaption { text-align: left; }
.csf--b .csf-body { margin: 14px 14px 14px 0; padding: 26px 24px 22px; border-radius: 16px; background: #fff; box-shadow: 0 1px 0 var(--csf-line); }
/* 記事本文の中で埋もれないように：青の太枠＋淡い青の面＋上部の濃紺帯、表紙を大きく、CTAを強く */
.csf.csf--b { margin: 64px 0; border: 3px solid var(--csf-blue); border-radius: 22px; background: #eef4ff; box-shadow: 0 30px 60px -36px rgba(31, 95, 224, 0.55); }
.csf--b .csf-band { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin: 0 !important; padding: 13px 24px; background: var(--csf-ink); color: #fff; font-size: 16px; font-weight: 900; line-height: 1.4; letter-spacing: 0.04em; }
.csf--b .csf-band__tag { flex: none; padding: 3px 10px; border-radius: 999px; background: #ffd84d; color: var(--csf-ink); font-size: 12px; font-weight: 900; letter-spacing: 0.06em; }
.csf--b .csf-head { padding: 28px 24px 24px; }
.csf--b .csf-doc { max-width: none; padding: 14px; border-radius: 14px; background: #fff; box-shadow: 0 1px 0 var(--csf-line); }
.csf--b .csf-doc img { border-radius: 8px; box-shadow: 0 22px 36px -18px rgba(11, 31, 77, 0.55); }
.csf--b .csf-doc figcaption { margin-top: 12px; font-size: 15px; }
.csf--b .csf-body { margin: 20px 20px 20px 0; padding: 28px 26px 24px; box-shadow: 0 1px 0 var(--csf-line), 0 18px 36px -24px rgba(11, 31, 77, 0.35); }
.csf--b .csf-btn,
.csf--b .csf-btn--next { width: 100%; height: 64px; background: linear-gradient(100deg, var(--csf-cta) 0%, var(--csf-cta2) 100%); box-shadow: 0 16px 32px -12px rgba(255, 107, 91, 0.7); }
.csf--b .csf-actions { flex-direction: column-reverse; align-items: stretch; gap: 6px; }
.csf--b .csf-back { align-self: center; height: 40px; border: 0; background: transparent; color: var(--csf-mute); text-decoration: underline; }
.csf--b .csf-chip span { font-size: clamp(12px, 3.6cqi, 14px); padding: 6px 4px; }

/* ボタン文字はどの幅でも1行（矢印も同じ行）。狭い幅では文字と左右の余白を縮める */
.csf .csf-btn { white-space: nowrap; min-width: 0; padding: 0 clamp(12px, 4cqi, 24px); font-size: clamp(15px, 4.2cqi, 19px); letter-spacing: 0.02em; }
.csf .csf-btn::after { flex: none; }
.csf .csf-back { white-space: nowrap; flex: none; padding: 0 clamp(10px, 3cqi, 18px); }

/* .csf 自身はコンテナなので、列数の切り替えだけは画面幅で判定する（記事本文の幅が足りるのは PC 表示のとき） */

/* チェックマークを1行目の文字の中央に揃える（絶対配置をやめて行の中に並べる） */
.csf .csf-learn > li { display: flex !important; align-items: flex-start !important; gap: 8px !important; padding-left: 0 !important; }
.csf .csf-learn > li::before { position: static !important; flex: none !important; margin-top: 2px !important; width: 18px !important; height: 18px !important; border-radius: 0 !important; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Ccircle cx='9' cy='9' r='9' fill='%23d9e6ff'/%3E%3Cpath d='M5 9.2l2.6 2.6L13 6.4' fill='none' stroke='%231f5fe0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px 18px no-repeat !important; }
.csf .csf-assure > li { display: flex !important; align-items: center !important; justify-content: center !important; gap: 6px !important; padding-left: 0 !important; }
.csf .csf-assure > li::before { position: static !important; flex: none !important; }

@media (max-width: 1023px) {
  .csf--b { grid-template-columns: minmax(0, 1fr); }
  .csf.csf--b { margin: 48px 0; }
}
@container (max-width: 640px) {
  .csf--b .csf-band { padding: 11px 16px; font-size: 14px; }
  .csf--b .csf-head { padding: 20px 14px 14px; }
  .csf--b .csf-doc { max-width: none; margin: 0; padding: 10px; }
  .csf--b .csf-body { margin: 0 8px 8px; padding: 20px 14px 18px; }
  .csf--b .csf-btn { height: 58px; }
}

/* ==========================================================================
   案C：1画面で段階表示（番号付きの行・入力済みで次が開く）
   ========================================================================== */
.csf--c { border: 2px solid var(--csf-ink); box-shadow: 8px 8px 0 var(--csf-blue2); }
.csf--c .csf-head { border-bottom: 2px solid var(--csf-ink); }
.csf--c .csf-doc img { transform: none; border-radius: 6px; }
.csf--c .csf-body { padding-top: 22px; }
.csf--c .csf-fields { counter-reset: csf; gap: 0; }
.csf--c .csf-field { position: relative; padding: 16px 0 16px 48px; border-bottom: 1px dashed var(--csf-line); transition: opacity 0.3s, filter 0.3s; }
.csf--c .csf-field::before { counter-increment: csf; content: counter(csf); position: absolute; left: 0; top: 16px; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--csf-ink); color: #fff; font-size: 15px; font-weight: 900; }
.csf--c .csf-field.is-done::before { content: "✓"; background: var(--csf-ok); }
.csf--c .csf-field.is-locked { opacity: 0.35; filter: grayscale(1); pointer-events: none; }
.csf--c .csf-field.is-locked .csf-input,
.csf--c .csf-field.is-locked .csf-chip span { background: var(--csf-bg); }

/* ---- 狭い幅（記事本文・スマホ） ---- */
@container (max-width: 640px) {
  .csf-head { flex-direction: column-reverse; align-items: stretch; gap: 16px; padding: 22px 18px 18px; }
  .csf-doc { flex-basis: auto; max-width: 260px; margin: 0 auto; }
  .csf .csf-title { font-size: 21px; }
  .csf-body { padding: 0 18px 22px; }
  .csf-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .csf .csf-btn { height: 56px; }
  .csf .csf-back { height: 56px; padding: 0 14px; }
  .csf--c .csf-field { padding-left: 42px; }
}
/* 狭い幅（スマホ）では「戻る」をボタンの下の文字リンクにして、送信ボタンを幅いっぱいに */
@container (max-width: 480px) {
  .csf .csf-actions { flex-direction: column-reverse; align-items: stretch; gap: 6px; }
  .csf .csf-actions .csf-btn { width: 100% !important; }
  .csf .csf-back { height: 40px; border: 0; background: transparent; color: var(--csf-mute); text-decoration: underline; }
}
@media (prefers-reduced-motion: reduce) {
  .csf *, .csf *::before, .csf *::after { transition: none !important; }
}
