/* =========================================================
   sg-stepform.css — SG 無料相談ステップフォーム（261022 新設・v3-contact だけが読む）
   構造はルシュのステップフォームを流用・見た目は v3 のトークン（--ink／--sand／--chart-dk／--accent）だけで組む
   ★ルシュのピンク・丸ゴ・アイコンは持ち込まない。塗りのボタン＝送信（朱）と「次へ」（墨）だけ
   SP基準390・BP840px 1本・入力欄16px以上・タップ44px以上
   ========================================================= */

.sgsf { position: relative; max-width: 640px; margin-top: 24px; padding: 36px 40px 32px; background: var(--sand); scroll-margin-top: 96px; }
.sgsf__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.sgsf__time { font-size: 14px; line-height: 1.6; color: var(--ink-2); }
/* テストモードの印（本番化で消す。sg-stepform.js の CONFIG.SUBMIT_URL が空のあいだだけ意味がある） */
.sgsf__test { flex: none; font-size: 12px; line-height: 1.5; color: var(--ink-2); border: 1px dashed #A59F92; border-radius: 4px; padding: 1px 8px; }
.sgsf__prog { height: 4px; background: var(--sand-2); border-radius: 2px; overflow: hidden; }
.sgsf__prog span { display: block; height: 100%; width: 10%; background: var(--chart-dk); border-radius: 2px; transition: width .35s ease; }
.sgsf.is-done .sgsf__time { visibility: hidden; }

.sgsf__screen { padding-top: 28px; }
.sgsf__step { font-size: 14px; font-weight: 700; letter-spacing: .04em; color: var(--ink-2); line-height: 1.4; }
.sgsf__step .v3-num { font-size: 18px; color: var(--ink); letter-spacing: 0; }
.sgsf__step-of .v3-num { font-size: 14px; color: var(--ink-2); }
.sgsf__q { margin-top: 8px; font-size: 24px; font-weight: 700; line-height: 1.5; letter-spacing: .02em; outline: none; word-break: auto-phrase; text-wrap: pretty; }
.sgsf__sub { margin-top: 6px; font-size: 15px; line-height: 1.75; color: var(--ink-2); }

/* ?type= で来たとき＝1問目の答えを見せて「変更する」 */
.sgsf__chosen { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 12px; padding: 8px 4px 8px 14px; background: #fff; border-left: 3px solid var(--chart-dk); font-size: 15px; line-height: 1.6; }
.sgsf__chosen > span { color: var(--ink-2); font-size: 14px; }
.sgsf__chosen-edit { margin-left: auto; min-height: 44px; padding: 0 12px; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 700; color: var(--chart-dk); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* 選択肢：白い面＝押せる（砂色の地の上）。単一選択は右に矢印＝タップで進む／複数選択は左に四角 */
.sgsf__cards { display: grid; gap: 10px; margin-top: 20px; }
.sgsf__card { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 14px 18px; border: 1.5px solid #fff; border-radius: 6px; background: #fff; box-shadow: 0 1px 2px rgba(58,54,49,.08); font: inherit; color: var(--ink); text-align: left; cursor: pointer; transition: border-color .15s, background-color .15s; }
.sgsf__card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sgsf__card-label { font-size: 17px; font-weight: 700; line-height: 1.5; }
.sgsf__card-note { font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.sgsf__chev { flex: none; width: 9px; height: 9px; border-top: 2px solid var(--ink-2); border-right: 2px solid var(--ink-2); transform: rotate(45deg); margin-right: 4px; }
.sgsf__card.is-on { border-color: var(--chart-dk); background: var(--chart-lt); }
.sgsf__card.is-on .sgsf__chev { border-color: var(--chart-dk); }
.sgsf__check { flex: none; position: relative; width: 22px; height: 22px; border: 1.5px solid #8C867B; border-radius: 4px; background: #fff; }
.sgsf__card.is-on .sgsf__check { background: var(--chart-dk); border-color: var(--chart-dk); }
.sgsf__card.is-on .sgsf__check::after { content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg); }
@media (hover: hover) and (pointer: fine) {
  .sgsf__card:hover { border-color: #A59F92; }
  .sgsf__card.is-on:hover { border-color: var(--chart-dk); }
  .sgsf__skip:hover, .sgsf__back:hover { color: var(--ink); }
  .sgsf__next:hover { background: #26231F; }
}

.sgsf__mtoggle { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 14px; padding: 0 4px; border: 0; background: none; font: inherit; font-size: 15px; font-weight: 700; color: var(--ink); cursor: pointer; }
.sgsf__mbox { position: relative; width: 20px; height: 20px; border: 1.5px solid #8C867B; border-radius: 4px; background: #fff; }
.sgsf__mtoggle.is-on .sgsf__mbox { background: var(--chart-dk); border-color: var(--chart-dk); }
.sgsf__mtoggle.is-on .sgsf__mbox::after { content: ""; position: absolute; left: 5px; top: 1px; width: 6px; height: 11px; border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg); }
.sgsf__mtoggle + .sgsf__cards { margin-top: 6px; }

/* ボタンの優先順位：次へ＝墨の塗り／送信＝朱の塗り（v3-btn--primary）／まだ決めていない＝文字だけ／戻る＝文字だけ */
.sgsf__nav { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin-top: 24px; }
.sgsf__next { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 56px; padding: 0 30px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font: inherit; font-size: 17px; font-weight: 700; letter-spacing: .06em; cursor: pointer; }
.sgsf__skip { display: block; width: 100%; min-height: 48px; margin-top: 12px; padding: 0 12px; border: 0; background: none; font: inherit; font-size: 15px; font-weight: 700; color: var(--ink-2); text-decoration: underline; text-decoration-color: #B9B3A5; text-underline-offset: 4px; cursor: pointer; }
.sgsf__nav .sgsf__skip { margin-top: 0; }
.sgsf__back-wrap { margin-top: 12px; }
.sgsf__back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 8px 0 2px; border: 0; background: none; font: inherit; font-size: 15px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.sgsf__back-ico { width: 8px; height: 8px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-left: 4px; }
.sgsf button:focus-visible, .sgsf a:focus-visible, .sgsf__input:focus-visible { outline: 2px solid var(--chart-dk); outline-offset: 2px; }

/* 入力欄 */
.sgsf__field { margin-top: 22px; border: 0; padding: 0; min-width: 0; }
.sgsf__label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; padding: 0; font-size: 16px; font-weight: 700; line-height: 1.5; }
.sgsf__req, .sgsf__opt { display: inline-block; padding: 0 8px; border-radius: 4px; font-size: 12px; font-weight: 700; line-height: 1.7; }
.sgsf__req { background: var(--accent-dk); color: #fff; }
.sgsf__opt { border: 1px solid #B9B3A5; color: var(--ink-2); font-weight: 500; background: #fff; }
.sgsf__input { display: block; width: 100%; min-height: 52px; padding: 12px 14px; border: 1.5px solid #B9B3A5; border-radius: 6px; background: #fff; font: inherit; font-size: 16px; line-height: 1.6; color: var(--ink); }
.sgsf__input::placeholder { color: #8C867B; }
.sgsf__input[aria-invalid="true"] { border-color: var(--accent-dk); background: #FFF8F5; }
select.sgsf__input { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.sgsf__ta { min-height: 168px; margin-top: 18px; resize: vertical; }
.sgsf__hint { margin-top: 8px; font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.sgsf__hint--top { margin: -2px 0 8px; }
.sgsf__err { margin-top: 8px; font-size: 14px; font-weight: 700; line-height: 1.6; color: var(--accent-dk); }

/* 2〜3択の切り替え（人数・連絡方法）＝セグメント。中身は本物の radio＝矢印キーで動く */
.sgsf__seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; border: 1.5px solid #B9B3A5; border-radius: 6px; background: #fff; overflow: hidden; }
.sgsf__seg-i { position: relative; display: flex; align-items: center; justify-content: center; min-height: 50px; padding: 4px 8px; font-size: 16px; font-weight: 700; line-height: 1.4; text-align: center; cursor: pointer; }
.sgsf__seg-i + .sgsf__seg-i { border-left: 1.5px solid #D8D4CA; }
.sgsf__seg-i input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.sgsf__seg-i:has(input:checked) { background: var(--chart-dk); color: #fff; }
.sgsf__seg-i:has(input:focus-visible) { outline: 2px solid var(--chart-dk); outline-offset: -4px; box-shadow: inset 0 0 0 4px #fff; }

.sgsf__birth { display: grid; grid-template-columns: 76px minmax(0, 1.25fr) minmax(0, 1fr); gap: 8px; align-items: center; margin-top: 8px; }
.sgsf__birth:first-of-type { margin-top: 0; }
.sgsf__birth-no { font-size: 15px; font-weight: 700; color: var(--ink-2); }

/* 最後の画面＝同意と送信 */
.sgsf__agree { margin-top: 20px; }
.sgsf__agree-i { display: flex; align-items: center; gap: 12px; min-height: 48px; font-size: 16px; line-height: 1.6; cursor: pointer; }
.sgsf__agree-i input { flex: none; width: 24px; height: 24px; margin: 0; accent-color: var(--chart-dk); }
.sgsf__agree-i .sgsf__req { margin-left: 8px; }
.sgsf__agree-i a { display: inline-block; padding: 10px 0; margin: -10px 0; text-underline-offset: 3px; }
.sgsf__done-test { margin-top: 8px; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.sgsf__promise { margin: 8px 0 24px; font-size: 14px; line-height: 1.85; color: var(--ink-2); }
.sgsf__submit { width: 100%; border: 0; cursor: pointer; font: inherit; font-size: 18px; font-weight: 700; }

/* 完了画面 */
.sgsf__done .sgsf__q { margin-top: 0; }
.sgsf__done-mail { margin-top: 10px; font-size: 15px; line-height: 1.8; }
.sgsf__done-mail b { word-break: break-all; }
.sgsf__next3 { margin-top: 24px; border-top: 1.5px solid var(--ink); }
.sgsf__next3 > div { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.sgsf__next3 dt { font-size: 14px; font-weight: 700; line-height: 1.7; color: var(--accent-dk); }
.sgsf__next3 dd { margin: 0; font-size: 15px; line-height: 1.8; }
.sgsf__next3 dd b { display: block; font-size: 16px; }
.sgsf__done-links { margin-top: 20px; font-size: 15px; line-height: 1.8; }
.sgsf__done-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; text-underline-offset: 3px; }

/* JSが動かないとき */
.sgsf__nojs { padding-top: 20px; font-size: 15px; line-height: 1.8; }

@media (max-width: 840px) {
  .sgsf { margin-left: calc(var(--gut) * -1); margin-right: calc(var(--gut) * -1); padding: 24px 16px 24px; scroll-margin-top: 72px; }
  .sgsf__screen { padding-top: 22px; }
  .sgsf__q { font-size: 21px; }
  .sgsf__card { padding: 12px 14px; min-height: 60px; }
  .sgsf__card-label { font-size: 16px; }
  .sgsf__birth { grid-template-columns: 64px minmax(0, 1.25fr) minmax(0, 1fr); }
  .sgsf__next3 > div { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 14px 0; }
}

/* 261022 SP総点検：13px未満をなくす（SPのみ） */
@media (max-width: 840px) { .sgsf__test, .sgsf__req, .sgsf__opt { font-size: 13px; } .sgsf__nw { white-space: nowrap; } }

/* 261022 辛口レビュー：完了画面の「このあと」3行＝罫線で文字を並べただけ → 左に縦の線と点（時間の順に進む形）。最初の点だけ塗り＝いまここ */
.sgsf__next3 { position: relative; border-top: 0; padding-left: 26px; }
.sgsf__next3::before { content: ""; position: absolute; left: 6px; top: 26px; bottom: 30px; width: 2px; background: var(--line); }
.sgsf__next3 > div { position: relative; border-bottom: 0; padding: 12px 0; }
.sgsf__next3 > div::before { content: ""; position: absolute; left: -26px; top: 19px; width: 14px; height: 14px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--accent-dk); background: #fff; }
.sgsf__next3 > div:first-child::before { background: var(--accent-dk); }
.sgsf__next3:has(> div:only-child)::before { display: none; }
/* 線は点から次の点までだけ（最後の点の下に線を残さない） */
.sgsf__next3::before { display: none; }
.sgsf__next3 > div:not(:last-child)::after { content: ""; position: absolute; left: -20px; top: 33px; bottom: -19px; width: 2px; background: var(--line); }
