/*
 * カウンセリング予約フォーム v2 — フォーム専用 CSS（設計図 4・5・7 章、6.3）
 *
 * - スコープは body.reservationindex.formnew 配下のみ（P12）。共用の /theme/css/form.css は変更しない（R1）
 * - /theme/css/form.css より後に読み込む前提。!important は使わない（詳細度 (0,3,x) 以上で上書き）
 * - :has() / CSS ネスト / container query は使わない（古い WebView 対策・7 章）。
 *   選択状態は「label 内の input:checked ~ .form-choice-body」の兄弟結合子で表現する（JS 不要）
 *   配色の役割（7 章・2026-09-21）: ゴールド = 選択・操作（地 #faf6ec / 枠 #9f774b / 文字 #6b4f1d）、緑 = 入力完了（見出しのチェック）、
 *   赤 #a0293c = エラーだけ（送信ボタンは例外として据え置き）。赤系がエラー系以外のセレクタに現れないことは tests/run.php が検査する
 * - ネイティブ input は display:none にせず、フォーカス可能なまま視覚的に隠す。フォーカスリングはラッパー側に出す
 * - iOS の自動ズーム対策: input / select / textarea は 16px 以上（6.3）
 * - ブレークポイントは共用 CSS と同じ 750px（SP: 〜749px / PC: 750px〜）
 * - JS 依存の表示（ブロックの段階表示など）は html.js-form 配下だけに書く（4.3）
 */

/* ---------------------------------------------------------------------------
 * 共通フッターの固定ナビ（footer.tpl の .flow-navi）はフォームページでは出さない（5 章）
 * 共用 form.css にも .flow-navi{display:none} があるが、こちらでも明示しておく
 * ------------------------------------------------------------------------- */
body.reservationindex.formnew .flow-navi,
body.reservationindex.formnew .flow-navi-inner {
  display: none;
}

/* ---------------------------------------------------------------------------
 * ブロック（STEP1〜4・設計図 4.1）
 * ------------------------------------------------------------------------- */
/* 電話リンク（表示は 10〜18 時台・form.php の時刻判定）とフォーム本体の間（2026-09-23）。
   共用 CSS に .link-tel の規則は無く下マージンが 0 だった。上マージンは付けない:
   非表示の時間帯は要素ごと出力されないので余白は残らず、上側は直前の .form-ref-list の下マージン（SP 2rem / PC 20px）が担う */
body.reservationindex.formnew .link-tel {
  margin: 0 0 2rem;
}

body.reservationindex.formnew .form-step {
  margin: 0 0 2rem;
}

body.reservationindex.formnew .form-step-title {
  display: flex;
  align-items: center;
  margin: 0 0 .75rem;
  padding: 0;
  font-size: 17px;
  line-height: 1.3;
  font-weight: bold;
  color: #212529;
}

/* 見出しの文言と警告マーク（.form-step-name::after）を上下中央で揃える（2026-09-23）。
   vertical-align: middle は「ベースライン + x-height / 2」基準で、17px / 20px と字の大きさが変わるとずれるため、
   名前の span 自体を inline-flex にして align-items: center で揃える（JS の有無に関係しない指定） */
body.reservationindex.formnew .form-step-name {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

body.reservationindex.formnew .form-step-num {
  display: inline-block;
  flex: 0 0 auto;
  margin: 0 .6em 0 0;
  padding: .35em .6em .3em;
  border-radius: 4px;
  background-color: #6b4f1d;   /* ゴールド（白文字 7.61:1） */
  color: #fff;
  font-size: 12px;
  line-height: 1;
  letter-spacing: .05em;
}

/* 段階表示（4.2）: JS が動いているとき（html.js-form）だけ効く。JS 無効・失敗時は全ブロックが見える（4.3） */
html.js-form body.reservationindex.formnew .form-step-body[hidden] {
  display: none;
}

html.js-form body.reservationindex.formnew .form-step.is-locked {
  margin: 0 0 .75rem;
  padding: 0 0 .75rem;
  border-bottom: 1px solid #e0e0e0;
}

html.js-form body.reservationindex.formnew .form-step.is-locked .form-step-title {
  margin: 0;
  color: #999;
}

html.js-form body.reservationindex.formnew .form-step.is-locked .form-step-num {
  background-color: #bbb;
}

/* 常時バリデーション（6.1・JS が付ける）: 必須項目が有効なら見出し（.form-title）の右端に緑丸 + 白チェック（18px・アニメーションなし）。
   ::before は共用 CSS の「必須」バッジ（.form-title.is-required::before）が使っているので触らず、::after 1 つに
   インライン SVG（data URI・CSS 内に自己完結。外部画像・フォントに依存しない）で丸とチェックを 1 枚として描く。
   入力欄には触れないので重なりが構造的に起きず、全項目で同じ規則。
   位置は 2026-09-20 のステージング実測値から。
   SP: .form-title は高さ 38px・padding 8px・static、バッジは左側に inline（w 39 h 19）
       → 縦中央 (38 - 18) / 2 = 10px・右 8px。見出し文言が丸の下に回り込まないよう padding-right = 8 + 18 + 8 = 34px */
/* B-1（2026-09-23）: 緑チェックが出た瞬間に見出しが折り返さないよう、必須項目の見出しは最初から右 34px を確保する。
   任意項目（緑チェックが出ない）は共用 CSS のまま。padding はチェックの有無で変わらない */
html.js-form body.reservationindex.formnew .form-title.is-required {
  position: relative;
  padding-right: 34px;
}

html.js-form body.reservationindex.formnew .form-item.is-valid .form-title.is-required::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 8px;
  width: 18px;
  height: 18px;
  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='rgb(46,125,50)'/%3E%3Cpath d='M5 9.4l2.7 2.7L13.2 6.6' fill='none' stroke='rgb(255,255,255)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}

/* 入力補助（6.2・JS だけが出す要素） */
html.js-form body.reservationindex.formnew .form-tel-echo {
  margin: .5em 0 0;
  color: #444;
  font-size: 13px;
  line-height: 1.4;
}

html.js-form body.reservationindex.formnew .form-suggest {
  margin: .4em 0 0;
  color: #444;
  font-size: 13px;
  line-height: 1.4;
}

/* 候補アドレスはボタン（送信しない type=button）。リンク風の見た目で、タップ領域は 44px 以上 */
html.js-form body.reservationindex.formnew .form-suggest-button {
  display: inline-block;
  min-height: 44px;
  margin: 0;
  padding: .7em .2em;
  border: 0;
  background: none;
  color: #6b4f1d;
  font: inherit;
  font-size: 14px;
  font-weight: bold;
  text-decoration: underline;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

html.js-form body.reservationindex.formnew .form-suggest-button:focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 2px;
}

/* 「いつでもOK」: チップ群の直前。**未選択のチップと同じ配色**（白地・枠 #bbb・文字 #212529）。
   ゴールドの枠・文字にしていたが、選択済みのチップ（ゴールド）と見分けがつかず「選択済みに見える」ため 2026-09-28 に変更。
   選択肢の 1 つに見えることは許容し、区別の印は付けない */
html.js-form body.reservationindex.formnew .form-choice-all {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #bbb;
  border-radius: 6px;
  background-color: #fff;
  color: #212529;
  font: inherit;
  font-size: 14px;
  font-weight: bold;
  line-height: 1.3;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

html.js-form body.reservationindex.formnew .form-choice-all:active {
  background-color: #f5f5f5;   /* チップの押下中（.form-choice-body:active）と同じ */
}

html.js-form body.reservationindex.formnew .form-choice-all:focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
 * 7 章 希望日のインラインカレンダー（JS が select の option から描く。select は POST の実体として残す）
 * ------------------------------------------------------------------------- */
/* select を含む label は「フォーカス可能なまま視覚的に隠す」（display:none / visibility:hidden は使わない = キーボード・SR の経路を残す） */
html.js-form body.reservationindex.formnew .form-hope-fields.is-enhanced {
  position: relative;
}

html.js-form body.reservationindex.formnew .form-hope-fields.is-enhanced > label {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

html.js-form body.reservationindex.formnew .form-cal {
  flex: 1 1 100%;
  box-sizing: border-box;
  max-width: 360px;
  margin: 0;
}

html.js-form body.reservationindex.formnew .form-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 6px;
}

html.js-form body.reservationindex.formnew .form-cal-title {
  font-size: 15px;
  font-weight: bold;
  color: #212529;
}

/* 月送り: 44px 角・CSS の山形（文字なし） */
html.js-form body.reservationindex.formnew .form-cal-nav {
  position: relative;
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

html.js-form body.reservationindex.formnew .form-cal-nav::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -3px;
  border: solid #9f774b;
  border-width: 0 0 2px 2px;
  transform: rotate(45deg);
}

html.js-form body.reservationindex.formnew .form-cal-nav.is-next::before {
  margin-left: -7px;
  border-width: 2px 2px 0 0;
}

html.js-form body.reservationindex.formnew .form-cal-nav[disabled] {
  opacity: .3;
  cursor: default;
}

html.js-form body.reservationindex.formnew .form-cal-week,
html.js-form body.reservationindex.formnew .form-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}

html.js-form body.reservationindex.formnew .form-cal-weekday {
  padding: 4px 0;
  color: #666;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
}

/* 日付セル: 44px 以上。日曜は赤系・土曜は青系・選択不可はグレーで押せない・選択中は淡い地 + 枠 + 濃い文字（ゴールド） */
html.js-form body.reservationindex.formnew .form-cal-day {
  box-sizing: border-box;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid #ddd;
  border-radius: 6px;
  background-color: #fff;
  color: #212529;
  font-family: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

html.js-form body.reservationindex.formnew .form-cal-weekday.is-sun,
html.js-form body.reservationindex.formnew .form-cal-day.is-sun {
  color: #c62828;
}

html.js-form body.reservationindex.formnew .form-cal-weekday.is-sat,
html.js-form body.reservationindex.formnew .form-cal-day.is-sat {
  color: #1565c0;
}

html.js-form body.reservationindex.formnew .form-cal-day[disabled] {
  border-color: #eee;
  background-color: #f7f7f7;
  color: #bbb;
  cursor: default;
}

/* 第2希望のカレンダーで第1希望の日: グレー + 細い破線枠 */
html.js-form body.reservationindex.formnew .form-cal-day.is-blocked[disabled] {
  border: 1px dashed #bbb;
}

html.js-form body.reservationindex.formnew .form-cal-day.is-selected {
  border-color: #9f774b;
  box-shadow: inset 0 0 0 1px #9f774b;   /* 枠 2px 相当（サイズを変えない） */
  background-color: #faf6ec;
  color: #6b4f1d;
  font-weight: bold;
}

html.js-form body.reservationindex.formnew .form-cal-empty {
  min-height: 44px;
}

/* 希望時間のチップ 5 列 2 行（10:00〜14:00 / 15:00〜18:00。カレンダーの直下、日付が選ばれるまで hidden）。
   2026-09-21: 3×3・高さ 48 → 5 列・高さ 44・カレンダーとの間 16 → 8px（親の gap 8 のみ）。SP 375px でチップ幅 58.7px に「10:00」約 40px */
html.js-form body.reservationindex.formnew .form-hours {
  flex: 1 1 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  box-sizing: border-box;
  max-width: 360px;
  margin: 0;
}

html.js-form body.reservationindex.formnew .form-hours[hidden] {
  display: none;
}

html.js-form body.reservationindex.formnew .form-hour {
  box-sizing: border-box;
  min-height: 44px;
  margin: 0;
  padding: 0 4px;
  border: 1px solid #bbb;
  border-radius: 6px;
  background-color: #fff;
  color: #212529;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.3;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

html.js-form body.reservationindex.formnew .form-hour:active {
  background-color: #f5f5f5;
}

html.js-form body.reservationindex.formnew .form-hour.is-selected {
  border-color: #9f774b;
  box-shadow: inset 0 0 0 1px #9f774b;
  background-color: #faf6ec;
  color: #6b4f1d;
  font-weight: bold;
}

/* 案 C（7 章）: 第1希望が畳まれるまで第2希望のカレンダー（dd）を隠し、見出しの下に案内 dd「第1希望を選ぶと選べます」だけ出す。
   .form-hope-fields は display:flex なので UA の [hidden] が効かず、明示的に消す */
html.js-form body.reservationindex.formnew .form-hope-fields[hidden],
html.js-form body.reservationindex.formnew .form-hope-wait[hidden] {
  display: none;
}

html.js-form body.reservationindex.formnew .form-hope-wait {
  margin: 0;
  padding: 0 0 0 16px;
  color: #666;
  font-size: 13px;
  line-height: 1.4;
}

/* 4.2 日時の要約行（STEP2 完了時に希望ごとに .hope-inner を畳んで表示）。「第1希望 10/1(水) 14:00 ［変更］」 */
html.js-form body.reservationindex.formnew .hope-inner[hidden],
html.js-form body.reservationindex.formnew .form-hope-summary-row[hidden] {
  display: none;
}

html.js-form body.reservationindex.formnew .form-hope-summary-row {
  display: flex;
  align-items: center;
  margin: 0;
  min-height: 44px;
  color: #212529;
  font-size: 15px;
  line-height: 1.4;
}

html.js-form body.reservationindex.formnew .form-hope-change {
  display: inline-block;
  min-height: 44px;
  margin: 0;
  padding: 0 .2em;
  border: 0;
  background: none;
  color: #6b4f1d;
  font: inherit;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* 角括弧は装飾（文字列としては「変更」だけ） */
html.js-form body.reservationindex.formnew .form-hope-change::before {
  content: '［';
}

html.js-form body.reservationindex.formnew .form-hope-change::after {
  content: '］';
}

html.js-form body.reservationindex.formnew .form-hope-change:focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 2px;
}

/* D5 生年月日の 8 桁入力: 入力欄を先頭に置き、3 つの select（POST の実体）は視覚的に隠す（JS が tabindex=-1 で Tab 順からも外す） */
html.js-form body.reservationindex.formnew .form-birth.is-enhanced {
  position: relative;
  display: block;
}

html.js-form body.reservationindex.formnew .form-birth.is-enhanced > label {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

html.js-form body.reservationindex.formnew .form-birth-input {
  box-sizing: border-box;
  width: 100%;
  max-width: 220px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #bbb;
  border-radius: 6px;
  background-color: #fff;
  color: #212529;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: .05em;
}

html.js-form body.reservationindex.formnew .form-birth-input:focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 1px;
}

html.js-form body.reservationindex.formnew .form-birth-hint,
html.js-form body.reservationindex.formnew .form-birth-echo {
  margin: .5em 0 0;
  color: #444;
  font-size: 13px;
  line-height: 1.4;
}

html.js-form body.reservationindex.formnew .form-birth-hint[hidden] {
  display: none;
}

/* 5 章 送信バー（JS が付ける状態）: 「必須項目 あと n 件」・非アクティブ（aria-disabled）はグレー・
   テキスト入力中（is-typing）は SP の sticky を通常配置に落としてキーボードの上に乗らないようにする */
/* 残り件数の読み上げ用（aria-live）。画面にはボタン内の 2 行目（.form-submit-sub）で出すので、ここは視覚的に隠す。
   display:none にすると読み上げも消えるため、1px に潰して隠す（バーの高さを取らない） */
html.js-form body.reservationindex.formnew .form-submit-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  color: #424242;
  font-size: 13px;
  line-height: 1.4;
}

html.js-form body.reservationindex.formnew .form-submit-status[hidden] {
  display: none;
}

/* 残り件数だけゴールドの太字（赤はエラー専用・7 章の配色） */
html.js-form body.reservationindex.formnew .form-submit-count {
  color: #6b4f1d;
  font-weight: bold;
}

/* ボタン内の 1 行目（サーバー描画）と 2 行目（JS が入れる「必須項目 あと n 件」・aria-hidden） */
body.reservationindex.formnew .form-submit-label {
  display: block;
}

html.js-form body.reservationindex.formnew .form-submit-sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.3;
  font-weight: normal;
  color: #424242;   /* 非アクティブの地 #e8e8e8 に対して 8.20:1 */
}

/* display を指定したので UA の [hidden] が効かない。明示して消す */
html.js-form body.reservationindex.formnew .form-submit-sub[hidden] {
  display: none;
}

/* 非アクティブ（2026-09-23 配色見直し）: 明るいグレー地 + 濃い文字。白 × #bbb は 1.92:1 で不足していた */
html.js-form body.reservationindex.formnew .form-submit-button.is-inactive {
  background-color: #e8e8e8;
  color: #212529;   /* 地 #e8e8e8 に対して 12.59:1 */
  box-shadow: inset 0 0 0 1px #bdbdbd;
}

html.js-form body.reservationindex.formnew .form-submit.is-typing {
  position: static;
}

/* 7 章 選択状態の補強: JS が付ける .is-checked（主手段は input:checked ~ .form-choice-body。見た目は同じ） */
html.js-form body.reservationindex.formnew .form-choice.is-checked .form-choice-body {
  border-color: #9f774b;
  box-shadow: inset 0 0 0 1px #9f774b;
  background-color: #faf6ec;
  color: #6b4f1d;
  font-weight: bold;
}

html.js-form body.reservationindex.formnew .form-choice.is-checked .form-choice-body::before {
  border-color: #9f774b;
  background-color: #9f774b;
}

html.js-form body.reservationindex.formnew .form-choice.is-checked .form-choice-body::after {
  opacity: 1;
}

/* 第2希望の日付を JS がクリアしたときの案内（エラーではなく選択に関する案内なのでゴールド。左罫線は見出しと同じ #c7b27c） */
html.js-form body.reservationindex.formnew .form-hope-notice {
  flex: 1 1 100%;
  margin: 0 0 .5em;
  padding: 2px 0 2px 8px;
  border-left: 4px solid #c7b27c;
  color: #6b4f1d;
  font-size: 13px;
  line-height: 1.4;
  font-weight: bold;
}

/* 表示中のエラーがあるブロックは、ステップ名の右に赤丸 + 「!」（16px） */
html.js-form body.reservationindex.formnew .form-step.is-warning .form-step-name::after {
  content: '!';
  display: inline-block;
  box-sizing: border-box;
  width: 16px;
  height: 16px;
  margin-left: .5em;
  border-radius: 50%;
  flex: 0 0 auto;
  background-color: #a0293c;
  color: #fff;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  font-weight: bold;
}

/* ---------------------------------------------------------------------------
 * エラー一覧（サーバー差し戻し時・JS 無効時の表示）
 * ------------------------------------------------------------------------- */
body.reservationindex.formnew .form-error {
  margin: 0 0 1.5rem;
  padding: .9rem 1rem;
  border: 1px solid #a0293c;
  border-radius: 6px;
  background-color: #fdf2f4;
  color: #a0293c;
  font-size: 14px;
  line-height: 1.5;
}

body.reservationindex.formnew .form-error p {
  margin: 0 0 .4em;
  font-weight: bold;
}

body.reservationindex.formnew .form-error ul {
  margin: 0;
  padding: 0 0 0 1.2em;
  list-style: disc;
}

body.reservationindex.formnew .form-error li {
  margin: .2em 0 0;
}

/* 項目直下のエラー文（6.1: 赤文字 + 枠色 + アイコン）。aria-describedby の参照先 */
body.reservationindex.formnew .form-field-error {
  position: relative;
  margin: .5em 0 0;
  padding: 0 0 0 1.5em;
  color: #a0293c;
  font-size: 13px;
  line-height: 1.4;
  font-weight: bold;
}

body.reservationindex.formnew .form-field-error::before {
  content: '!';
  position: absolute;
  top: .05em;
  left: 0;
  box-sizing: border-box;
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  background-color: #a0293c;
  color: #fff;
  font-size: 12px;
  line-height: 1.15em;
  text-align: center;
}

/* エラー対象の要素は枠色を変える（aria-invalid はサーバー差し戻し時に form.php が付ける） */
body.reservationindex.formnew .form-area input[aria-invalid="true"],
body.reservationindex.formnew .form-area select[aria-invalid="true"],
body.reservationindex.formnew .form-area textarea[aria-invalid="true"] {
  border-color: #a0293c;
  background-color: #fffafb;
}

body.reservationindex.formnew .form-choice-input[aria-invalid="true"] ~ .form-choice-body {
  border-color: #a0293c;
}

/* ハニーポット（8.3）: 画面外配置。name 属性に依存せずラッパーのクラスで指定（inline style と二重に） */
body.reservationindex.formnew .form-hp {
  position: absolute;
  top: -9999px;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* 冒頭の注意書き（2 行・2026-09-22）。共用 CSS の 13px / PC 16px を少し小さく（下限 12px） */
body.reservationindex.formnew .form-ref-item {
  font-size: 12px;
}

/* ---------------------------------------------------------------------------
 * 選択 UI（7 章）: label 全体がタップ対象。高さ 56px・間隔 12px
 *   <label class="form-choice is-radio"><input class="form-choice-input" ...><span class="form-choice-body">ラベル</span></label>
 *   A-1（2026-09-21）: 選択インジケータは左ではなく右上隅の 16px バッジ（::before）+ チェック（::after）。
 *   本文の左右パディングが 12 / 14 になり、SP 2 列のラベル幅は 109px → 126.8px（9 字 116px が 1 行に入る）。
 *   戻すときは「A-1」と書いた宣言だけを左インジケータの値に戻す（CSS のみ・テンプレート / JS は関係しない）
 * ------------------------------------------------------------------------- */
body.reservationindex.formnew .form-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 小見出し付きグループ（7 章 treatment「脂肪吸引」）。fieldset の既定の枠・余白・min-width を消し、下のグリッドとの間は 12px */
body.reservationindex.formnew .form-choice-set {
  display: block;
}

body.reservationindex.formnew .form-choice-group {
  display: block;
  min-width: 0;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
}

/* 2 つ目以降のグループの上に余白（2026-09-29・3 群に分けて見出しが詰まって見えたため）。
   隣接兄弟結合子なので :first-child / :has() を使わない。隣り合うマージンは相殺するので、
   下 12px と上 16px で「群の間は 16px」になる（1 つ目の上は変わらず、見出し「ご希望の施術内容」との間隔のまま） */
body.reservationindex.formnew .form-choice-group + .form-choice-group {
  margin-top: 16px;
}

body.reservationindex.formnew .form-choice-legend {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  color: #212529;
  font-size: 14px;
  font-weight: bold;
  line-height: 1.3;
}

/* 短いラベル（顔 / 二の腕 / お腹 / 太もも / その他 = 3 字以下）だけ 3 列。セル 99px・文字幅 39px */
body.reservationindex.formnew .form-choice-grid.is-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.reservationindex.formnew .form-choice {
  position: relative;
  display: block;
  margin: 0;
  min-width: 0;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

/* ネイティブ input はフォーカス可能なまま視覚的に隠す（display:none / visibility:hidden / clip-path は使わない） */
body.reservationindex.formnew .form-choice-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

body.reservationindex.formnew .form-choice-body {
  position: relative;
  display: flex;
  flex-wrap: wrap;        /* .form-choice-part（改行位置固定）を次の行に落とすため。通常のラベルは 1 項目なので影響なし */
  align-items: center;
  align-content: center;
  box-sizing: border-box;
  min-height: 56px;   /* 7 章: 1 行でも 2 行折返しでも 56px で揃える */
  padding: 10px 14px 10px 12px;   /* A-1: 左 36 → 12（バッジは右上隅）。右 14 はバッジ（右 4 + 16）の下端と 1 行目が触れない余白 */
  border: 1px solid #bbb;
  border-radius: 6px;
  background-color: #fff;
  color: #212529;
  font-size: 13px;   /* SP: 2 列でラベルを 1 行に収めるため（6.3 の 16px は input / select / textarea が対象） */
  line-height: 1.3;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}

/* 選択インジケータ（radio は丸・checkbox は角丸四角）。A-1: 右上隅 top 4 / right 4 の 16px（下端 y=20 は 1 行目の上端 19.5 より上） */
body.reservationindex.formnew .form-choice-body::before {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  box-sizing: border-box;
  width: 16px;
  height: 16px;
  border: 2px solid #bbb;
  border-radius: 4px;
  background-color: #fff;
}

body.reservationindex.formnew .form-choice.is-radio .form-choice-body::before {
  border-radius: 50%;
}

/* チェックマーク（枠線で描く。画像に依存しない）。A-1: バッジ（16px）の中央に 4×8 */
body.reservationindex.formnew .form-choice-body::after {
  content: '';
  position: absolute;
  top: 7px;
  right: 10px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
}

/* 選択状態 = 淡い地 + 枠 + 濃い文字 + バッジのチェック（7 章・ゴールド）。枠は box-shadow で 2px 相当にし、サイズが変わらないようにする */
body.reservationindex.formnew .form-choice-input:checked ~ .form-choice-body {
  border-color: #9f774b;
  box-shadow: inset 0 0 0 1px #9f774b;
  background-color: #faf6ec;
  color: #6b4f1d;
  font-weight: bold;
}

body.reservationindex.formnew .form-choice-input:checked ~ .form-choice-body::before {
  border-color: #9f774b;
  background-color: #9f774b;
}

body.reservationindex.formnew .form-choice-input:checked ~ .form-choice-body::after {
  opacity: 1;
}

/* キーボード操作時のフォーカスリングはラッパー側に表示 */
body.reservationindex.formnew .form-choice-input:focus-visible ~ .form-choice-body {
  outline: 3px solid #1a73e8;
  outline-offset: 2px;
}

/* 押下中のフィードバック */
body.reservationindex.formnew .form-choice-body:active {
  background-color: #f5f5f5;
}

@media (hover: hover) {
  body.reservationindex.formnew .form-choice-body:hover {
    border-color: #888;
  }
}

/* クリニック: カード（SP 2×2）。太字で少し高く */
body.reservationindex.formnew .form-choice.is-card .form-choice-body {
  min-height: 64px;
  padding: 12px 14px 12px 12px;   /* A-1 */
  font-size: 13px;
  font-weight: bold;
}

/* 改行位置固定（config の display_labels に「|」で印を付け、テンプレートが <span class="form-choice-part"> に分ける）。
   SP は行いっぱい（= 次の行）、PC（750px〜）は同じ行に続ける */
body.reservationindex.formnew .form-choice-part {
  flex: 0 0 100%;
}

/* ---------------------------------------------------------------------------
 * ネイティブ入力欄（6.3: 16px 以上）
 * ------------------------------------------------------------------------- */
body.reservationindex.formnew .form-area input[type=text],
body.reservationindex.formnew .form-area input[type=tel],
body.reservationindex.formnew .form-area input[type=email],
body.reservationindex.formnew .form-area textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #bbb;
  border-radius: 6px;
  background-color: #fff;
  color: #212529;
  font-size: 16px;
  line-height: 1.4;
}

body.reservationindex.formnew .form-area textarea {
  height: 8em;
}

body.reservationindex.formnew .form-area select {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  height: 48px;
  padding: 0 12px;
  border: 1px solid #bbb;
  border-radius: 6px;
  background-color: #fff;
  color: #212529;
  font-size: 16px;
  line-height: 1.2;
}

body.reservationindex.formnew .form-area input:focus-visible,
body.reservationindex.formnew .form-area select:focus-visible,
body.reservationindex.formnew .form-area textarea:focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 1px;
}

/* 【第1希望】【第2希望】の見出し（案 A・2026-09-21）: 共用 form.css の .hope-title（SP 14px / PC 15px・本文色）を 16px 太字 + 左罫線 4px #c7b27c で上書き。
   文字色は本文色のまま（継承）。カレンダーの月名（15px 太字）より強くして「今どちらを選んでいるか」を見せる。text-indent（-.35em・全角括弧の食い込み）は共用のまま */
body.reservationindex.formnew .hope-title {
  margin: 0 0 8px;
  padding: 2px 0 2px 12px;
  border-left: 4px solid #c7b27c;
  font-size: 16px;
  font-weight: bold;
  line-height: 1.3;
}

/* 希望日時: 日付・時間の select を縦に並べる（SP） */
body.reservationindex.formnew .form-hope-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

body.reservationindex.formnew .form-hope-fields label {
  display: block;
  flex: 1 1 100%;
  margin: 0;
  min-width: 0;
}

body.reservationindex.formnew .form-hope-fields .is-caption,
body.reservationindex.formnew .form-hope-fields .form-field-error {
  flex: 1 1 100%;
}

/* 生年月日: 年・月・日を横並び（Phase 3 で 8 桁入力を載せるまでの表示） */
body.reservationindex.formnew .form-birth {
  display: flex;
  gap: 8px;
}

body.reservationindex.formnew .form-birth label {
  display: block;
  flex: 1 1 0;
  margin: 0;
  min-width: 0;
}

body.reservationindex.formnew .form-birth label:first-child {
  flex-grow: 1.4;
}

/* ---------------------------------------------------------------------------
 * 送信（5 章）: SP は画面下部に追従（sticky）。PC はフォーム末尾に通常配置
 * ------------------------------------------------------------------------- */
body.reservationindex.formnew .form-submit {
  position: -webkit-sticky;
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 1.5rem 0 0;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));   /* A + C（2026-09-23）: 状態表示の行をボタン内に移したうえで上下を詰めた（SP のバー 143.4 → 109.2px） */
  border-top: 1px solid #e0e0e0;
  background-color: rgba(255, 255, 255, .96);
}

/* 長野総院長の案内への入口（送信バー内・2026-09-23）。余白を詰めた版: タップ領域 32px（下限 24px）+ ボタンとの間 8px（下限 8px・押し間違い防止） */
body.reservationindex.formnew .form-nagano-link {
  display: block;
  box-sizing: border-box;
  min-height: 32px;
  margin: 0 0 8px;
  padding: 7px 4px;
  color: #6b4f1d;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  text-decoration: underline;
  cursor: pointer;
}

body.reservationindex.formnew .form-submit-button {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 56px;
  margin: 0;
  padding: 8px 16px;   /* 2 行（1 行目 22.1 + 2 行目 15.6 + 余白 16 = 53.7）でも min-height 56px に収まる */
  border: 0;
  border-radius: 8px;
  background-color: #a0293c;
  box-shadow: 0 2px 6px rgba(160, 41, 60, .35);
  color: #fff;
  font-size: 17px;
  line-height: 1.3;
  font-weight: bold;
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

body.reservationindex.formnew .form-submit-button:active {
  background-color: #8a2233;
  box-shadow: none;
}

body.reservationindex.formnew .form-submit-button:focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 2px;
}

@media (hover: hover) {
  body.reservationindex.formnew .form-submit-button:hover {
    background-color: #8a2233;
  }
}

/* ---------------------------------------------------------------------------
 * PC（750px〜）
 * ------------------------------------------------------------------------- */
@media (min-width: 750px) {
  body.reservationindex.formnew .link-tel {
    margin: 0 0 40px;   /* 上 20px（注意書きとの間隔）・下 40px（フォーム本体との区切り）で役割が違う */
  }

  body.reservationindex.formnew .form-step {
    margin: 0 0 40px;
  }

  body.reservationindex.formnew .form-step-title {
    margin: 0 0 12px;
    font-size: 20px;
  }

  body.reservationindex.formnew .form-step-num {
    font-size: 13px;
  }

  /* 選択肢は PC でも 2 列のまま（3 列 / 4 列はラベルが折り返すため廃止・2026-09-19）。
     最長「コンデンスリッチフェイス」（12 字）が 1 行に収まる 14px（余白は SP と同じ） */
  body.reservationindex.formnew .form-choice-body {
    font-size: 14px;
  }

  body.reservationindex.formnew .form-choice.is-card .form-choice-body {
    min-height: 72px;
    font-size: 16px;
  }

  body.reservationindex.formnew .form-ref-item {
    font-size: 14px;
  }

  /* PC は 1 行に入る（コンデンスリッチフェイス 12 字 × 13.9 = 167px < 175px）ので印の位置で改行しない */
  body.reservationindex.formnew .form-choice-part {
    flex: 0 0 auto;
  }

  body.reservationindex.formnew .form-area select {
    width: auto;
    min-width: 150px;
  }

  body.reservationindex.formnew .form-hope-fields label {
    flex: 0 0 auto;
  }

  body.reservationindex.formnew .form-hope-fields select {
    width: auto;
  }

  /* 生年月日: 年・月・日を自然な幅で横一列に。
     SP 用の label:first-child { flex-grow: 1.4 } は詳細度が高く label { flex: 0 0 auto } では打ち消せないため、同じセレクタで戻す */
  body.reservationindex.formnew .form-birth {
    gap: 10px;
  }

  body.reservationindex.formnew .form-birth label,
  body.reservationindex.formnew .form-birth label:first-child {
    flex: 0 0 auto;
  }

  body.reservationindex.formnew .form-birth select {
    width: auto;
    min-width: 0;
  }

  /* PC: .form-title は幅 240・padding 35/20/30/30・relative。「必須」バッジ（::before）は absolute top 6px right 5px（w 34 h 22）
     → 緑丸はバッジの左隣: 縦 6 + (22 - 18) / 2 = 8px、横 5 + 34 + 余白 6 = 45px（丸 177〜195px・バッジ 201〜235px で重ならない）。
     文言は padding-top 35px より下なので重ならない。SP 用の padding-right は共用 CSS の 20px に戻す */
  html.js-form body.reservationindex.formnew .form-title.is-required {
    padding-right: 20px;
  }

  html.js-form body.reservationindex.formnew .form-item.is-valid .form-title.is-required::after {
    top: 8px;
    right: 45px;
  }

  html.js-form body.reservationindex.formnew .form-choice-all {
    display: inline-block;
    width: auto;
    min-width: 160px;
  }

  html.js-form body.reservationindex.formnew .form-cal,
  html.js-form body.reservationindex.formnew .form-hours {
    max-width: 380px;
  }

  body.reservationindex.formnew .form-submit {
    position: static;
    margin: 40px 0 0;
    padding: 0;
    border-top: 0;
    background-color: transparent;
  }

  body.reservationindex.formnew .form-nagano-link {
    font-size: 14px;
  }

  body.reservationindex.formnew .form-submit-button {
    max-width: 480px;
    margin: 0 auto;
    font-size: 18px;
  }
}
