/*
 * Contact Form 7 integration for the 資料請求・事前相談 form.
 *
 * The form markup keeps the site's own classes; these rules only neutralise the
 * wrappers Contact Form 7 inserts around each control, and give the generated
 * checkbox/acceptance items the same look the hand-written `.choice` had.
 */

.inquiry-form .wpcf7 {
  margin: 0;
}

/* CF7 wraps every control in a span; the layout expects the control itself. */
.form-field__control .wpcf7-form-control-wrap,
.address-line .wpcf7-form-control-wrap,
.address-zip__row .wpcf7-form-control-wrap,
.input-select .wpcf7-form-control-wrap {
  display: block;
}

/* Checkbox list: the flex layout has to apply to the items, not the wrapper. */
.choice-list .wpcf7-form-control-wrap,
.choice-list .wpcf7-checkbox {
  display: flex;
  flex-direction: column;
  gap: var(--space-300);
  width: 100%;
}

.choice-list .wpcf7-list-item {
  margin: 0;
}

.choice-list .wpcf7-list-item > label {
  display: flex;
  align-items: center;
  gap: var(--space-300);
  padding: var(--space-300) var(--space-400);
  border: 1px solid var(--color-secondary);
  border-radius: var(--radius-200);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.choice-list .wpcf7-list-item > label:hover {
  border-color: var(--color-primary);
  transform: translateX(2px);
}

.choice-list .wpcf7-list-item > label:has(input:checked) {
  border-color: var(--color-primary);
  background: var(--color-bg-soft);
}

.choice-list .wpcf7-list-item input {
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: var(--color-primary);
}

.choice-list .wpcf7-list-item-label {
  font: 500 16px/1.5 var(--font-base);
  color: var(--color-text);
}

/*
 * 同意チェックと送信ボタン。
 *
 * pages/inquiry.css には .form-agree（中央寄せ・余白・薄い背景の帯）と
 * .agree / .agree__text が定義されているが、ブロック側のマークアップは
 * .form-agreement / .form-submit という別のクラス名を使っていたため、
 * これらのスタイルが一度も当たっていなかった（CF7化以前からの不一致）。
 * マークアップを .form-agree に合わせたうえで、CF7 が生成する
 * .wpcf7-list-item 側へ .agree 相当の見た目を移している。
 */
/*
 * CF7 は要素を <p> で包み、改行位置に <br> を入れる。.form-agree に指定された
 * 縦並び・中央寄せはこの <p> に対して効かせる必要があるため、<p> 側へ移す。
 */
.form-agree p {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-400);
  margin: 0;
}

.form-agree p br {
  display: none;
}

.form-agree .wpcf7-list-item {
  margin: 0;
}

.form-agree .wpcf7-list-item > label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-300);
  cursor: pointer;
}

.form-agree .wpcf7-list-item input {
  width: 20px;
  height: 20px;
  flex: none;
  accent-color: var(--color-primary);
}

.form-agree .wpcf7-list-item-label {
  font: 700 16px/1.6 var(--font-base);
  color: var(--color-text);
}

/* 送信ボタンの直後に CF7 がスピナーを挿す。帯の中央寄せを崩さないようにする。 */
.form-agree .wpcf7-spinner {
  margin: 0;
}

/* Validation messages and the send result. */
.inquiry-form .wpcf7-not-valid-tip {
  display: block;
  margin-top: var(--space-200);
  font: 500 14px/1.6 var(--font-base);
  color: #df0615;
}

.inquiry-form .wpcf7-response-output {
  margin: var(--space-400) 0 0;
  padding: var(--space-300) var(--space-400);
  border-width: 1px;
  font: 500 15px/1.7 var(--font-base);
}

.inquiry-form .wpcf7-spinner {
  vertical-align: middle;
}
