/* ==========================================================================
   お問い合わせフォーム（Contact Form 7 想定）
   出典: サイトデザイン参照画像（CONTACT） + docs/CODING_GUIDELINES.md 1.2節
   ========================================================================== */

:root {
  --color-accent-orange: #dd8a3c;
  --color-input-bg: #efefef;
  --color-input-placeholder: #9a9a9a;
  --color-error: #d64545;
}

.contact-section {
  scroll-margin-top: 150px;
  position: relative;
  z-index: 1;
  background: var(--color-green-dark);
  padding: 106px 24px 96px;
}

/* 直前の濃色セクションとのサブピクセル境界を1px重ねて消す。 */
.closing-cta + .contact-section {
  margin-top: -1px;
}
.contact-section__inner {
  max-width: var(--container-max);
  margin: 0 auto;
}

.contact-section__heading {
  display: flex;
  align-items: center;
  gap: var(--section-eyebrow-gap);
  margin: 0 0 var(--section-content-gap);
  color: #fff;
}
.contact-section__en { font-family: "Inter", sans-serif; font-size: var(--section-eyebrow-size); font-weight: 800; letter-spacing: 0.03em; }
.contact-section__rule { width: var(--section-eyebrow-rule-width); height: 2px; background: rgba(255, 255, 255, 0.5); }
.contact-section__ja { font-size: var(--section-eyebrow-ja-size); font-weight: 600; color: rgba(255, 255, 255, 0.85); }

.contact-card {
  background: #fff;
  border-radius: 16px;
  padding: 48px 56px 56px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.contact-card__title { margin: 0; font-size: 22px; font-weight: 800; color: var(--color-accent-orange); text-align: center; }
.contact-card__title-break { display: none; }
.contact-card__note { margin: 12px 0 0; font-size: 12px; color: var(--color-text-dim); text-align: center; }
.contact-card__required-note { margin: 8px 0 0; font-size: 12px; color: var(--color-accent-orange); text-align: center; }
.contact-card__divider { margin: 24px 0 0; border: none; border-top: 1px solid #e5e5e5; }

.req-mark { color: var(--color-accent-orange); margin-left: 2px; }

/* ---- 価格シミュレーションから引き継いだ概算結果 ---- */
.contact-estimate {
  margin: 28px 0 10px;
  padding: 22px 24px;
  border: 1px solid rgba(47, 112, 91, 0.28);
  border-radius: 12px;
  background: #f1f7f4;
  color: #222;
}

.contact-estimate__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.contact-estimate__head small {
  display: block;
  margin-bottom: 3px;
  color: var(--color-green-dark);
  font-family: "Inter", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.contact-estimate__head strong {
  display: block;
  color: var(--color-green-dark);
  font-size: 17px;
}

.contact-estimate__head button {
  flex: none;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--color-green-dark);
  border-radius: 999px;
  background: #fff;
  color: var(--color-green-dark);
  font-size: 12px;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}

.contact-estimate__head button:hover,
.contact-estimate__head button:focus-visible {
  background: var(--color-green-dark);
  color: #fff;
}

.contact-estimate dl {
  margin: 18px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid rgba(47, 112, 91, 0.18);
}

.contact-estimate dl > div {
  min-width: 0;
  padding: 13px 12px 13px 0;
  border-bottom: 1px solid rgba(47, 112, 91, 0.18);
}

.contact-estimate dt {
  margin-bottom: 4px;
  color: #68746f;
  font-size: 11px;
}

.contact-estimate dd {
  margin: 0;
  color: #202a26;
  font-size: 14px;
  font-weight: 700;
  word-break: break-word;
}

.contact-estimate > p {
  margin: 14px 0 0;
  color: #59635f;
  font-size: 11px;
  line-height: 1.75;
}

/* ---- フォーム行 ---- */
.wpcf7-form { padding-top: 8px; }

/* CF7 が生成する補助要素をレイアウトから確実に除外する。 */
.cf7-honeypot,
.cf7-honeypot[aria-hidden="true"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Honeypot系プラグインがクラス構造を変えても入力欄を露出させない。 */
.wpcf7-form-control-wrap[data-name="website"],
.wpcf7-form input[name="website"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
}

.cf7-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  align-items: center;
  gap: 24px;
  padding: 18px 0;
}
.cf7-row--full { align-items: start; }
.cf7-row > label {
  position: relative;
  padding-left: 20px;
  font-size: 15px;
  font-weight: 600;
  color: #333;
}
.cf7-label {
  position: relative;
  display: block;
  padding-left: 20px;
  font-size: 15px;
  font-weight: 600;
  color: #333;
}
.cf7-row--full > label { padding-top: 14px; }
.cf7-row > label > .req-mark,
.cf7-label > .req-mark {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
}
.cf7-row--full > label > .req-mark { top: 14px; }

/* 姓名・フリガナはCF7のwrapを含めた2カラムで管理する。 */
.cf7-name-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}
.cf7-name-grid .wpcf7-form-control-wrap {
  display: block;
  min-width: 0;
}
.cf7-row > .wpcf7-form-control-wrap,
.cf7-select-wrap > .wpcf7-form-control-wrap {
  display: block;
  min-width: 0;
}

.wpcf7-form-control.wpcf7-text,
.wpcf7-form-control.wpcf7-tel,
.wpcf7-form-control.wpcf7-email,
.wpcf7-form-control.wpcf7-textarea,
.wpcf7-form-control.wpcf7-select {
  width: 100%;
  background: var(--color-input-bg);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 14px 16px;
  font: inherit;
  font-size: 15px;
  color: #1a1a1a;
  min-height: var(--tap-min);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.wpcf7-form-control.wpcf7-textarea { resize: vertical; min-height: 160px; line-height: 1.7; }
.wpcf7-form-control::placeholder { color: var(--color-input-placeholder); }
.wpcf7-form-control:focus {
  outline: none;
  background: #fff;
  border-color: var(--color-green-dark);
  box-shadow: 0 0 0 3px rgba(31, 92, 70, 0.12);
}

.cf7-split { display: flex; gap: 16px; }
.cf7-split .wpcf7-form-control { flex: 1 1 0; }

.cf7-zip-group { display: flex; align-items: center; gap: 10px; }
.cf7-zip-group .wpcf7-form-control-wrap { display: block; min-width: 0; }
.cf7-zip-mark { font-size: 15px; color: #333; flex: none; }
.cf7-zip-input { max-width: 220px; }
.cf7-zip-btn {
  flex: none;
  min-height: var(--tap-min);
  padding: 0 20px;
  background: #1a1a1a;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border-radius: 6px;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}
.cf7-zip-btn:hover { background: #333; }
.cf7-zip-btn[data-loading] { opacity: 0.6; pointer-events: none; }

.wpcf7-not-valid-tip,
.cf7-error {
  display: block;
  margin-top: 6px;
  color: #d63638;
  font-size: 12px;
  line-height: 1.5;
}
.wpcf7-response-output {
  margin: 22px 0 0 !important;
  padding: 15px 18px !important;
  border-width: 1px !important;
  border-radius: 8px;
  background: #fff7f2;
  color: #8a2c17 !important;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.7;
}
.wpcf7 form.sent .wpcf7-response-output {
  border-color: #2f765e !important;
  background: #eff7f3;
  color: #215d49 !important;
}
.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.aborted .wpcf7-response-output,
.wpcf7 form.spam .wpcf7-response-output,
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output {
  border-color: #d7623e !important;
}

.cf7-select-wrap { position: relative; }
.wpcf7-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}

.cf7-select-wrap::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 16px;
  width: 10px;
  height: 10px;
  border-right: 2px solid #666;
  border-bottom: 2px solid #666;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

/* ---- お問い合わせ種別 ---- */
.cf7-radio-group .wpcf7-form-control-wrap,
.cf7-radio-group .wpcf7-radio {
  display: block;
}
.cf7-radio-group .wpcf7-radio {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.cf7-radio-group .wpcf7-list-item {
  margin: 0;
}
.cf7-radio-group .wpcf7-list-item label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap-min);
  padding: 11px 20px;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  background: #fff;
  color: #333;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.cf7-radio-group input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin: 0;
  flex: none;
  border: 2px solid #9b9b9b;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}
.cf7-radio-group input[type="radio"]:checked {
  border: 6px solid var(--color-green-dark);
}
.cf7-radio-group .wpcf7-list-item label:has(input:checked) {
  border-color: var(--color-green-dark);
  background: #f2f8f5;
  box-shadow: 0 0 0 1px var(--color-green-dark) inset;
}
.cf7-radio-group input[type="radio"]:focus-visible {
  outline: 3px solid rgba(31, 92, 70, .2);
  outline-offset: 2px;
}

/* ---- 個人情報同意 ---- */
.cf7-acceptance {
  display: flex;
  justify-content: center;
  margin: 34px 0 0;
}
.cf7-acceptance label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #333;
}
.wpcf7-acceptance {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
}
.wpcf7-acceptance:checked { background: var(--color-green-dark); }
.wpcf7-acceptance:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}
.cf7-acceptance a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.cf7-acceptance a:hover { color: var(--color-green-dark); }

/* ---- 送信ボタン ---- */
.cf7-submit-row { display: flex; justify-content: center; margin-top: 32px; }
.cf7-submit-btn,
.cf7-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap-min);
  padding: 0 48px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.cf7-submit-btn { background: var(--color-green-dark); color: #fff; }
.cf7-submit-row .cf7-submit-btn {
  position: relative;
  width: min(100%, 560px);
  min-height: 66px;
  justify-content: center;
  padding: 0 62px;
  font-size: 18px;
  font-weight: 400;
}
.cf7-submit-row .cf7-submit-btn svg {
  position: absolute;
  right: 30px;
  width: 20px;
  height: 20px;
}
.cf7-submit-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.cf7-submit-btn:disabled { opacity: 0.5; pointer-events: none; }
.cf7-back-btn { background: #eee; color: #333; }
.cf7-back-btn:hover { background: #e2e2e2; }

/* ---- エラー表示（1.2節: リアルタイムバリデーション） ---- */
.cf7-error {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--color-error);
}
.cf7-row.has-error .wpcf7-form-control { background: #fbe9e9; box-shadow: 0 0 0 1px var(--color-error) inset; }

/* ---- 確認ステップ ---- */
.cf7-confirm {
  scroll-margin-top: 160px;
  max-width: 920px;
  margin: 0 auto;
  padding-top: 32px;
  color: #222;
}
.cf7-confirm > h3 {
  margin: 0;
  color: #292929;
  font-size: 24px;
  line-height: 1.5;
  text-align: center;
}
.cf7-confirm > p {
  margin: 10px 0 28px;
  color: #4b4b4b;
  font-size: 14px;
  line-height: 1.8;
  text-align: center;
}
.cf7-confirm-list { margin: 0; }
.cf7-confirm-list { border-top: 1px solid #e5e5e5; }
.cf7-confirm-list > div { display: grid; grid-template-columns: 170px 1fr; gap: 24px; padding: 18px 0; border-bottom: 1px solid #e5e5e5; }
.cf7-confirm-list dt { font-size: 14px; font-weight: 600; color: #333; }
.cf7-confirm-list dd { margin: 0; font-size: 15px; color: #1a1a1a; white-space: pre-wrap; word-break: break-word; }
.cf7-confirm-actions { display: flex; justify-content: center; gap: 16px; margin-top: 36px; }
.cf7-confirm-actions .cf7-submit-btn,
.cf7-confirm-actions .cf7-back-btn {
  width: min(100%, 300px);
  min-height: 58px;
  justify-content: center;
  padding-inline: 28px;
}
/* CF7の不可視スピナーが幅だけを占有してボタン群を左へずらさないようにする。 */
.cf7-confirm-actions .wpcf7-spinner {
  display: none !important;
}

.cf7-thanks { text-align: center; padding: 40px 0; font-size: 16px; color: #1a1a1a; }

/* ==========================================================================
   レスポンシブ
   ========================================================================== */
@media (max-width: 768px) {
  .contact-section { scroll-margin-top: 92px; }
  .contact-section {
    padding: clamp(70px, 12.3vw, 80px) clamp(16px, 4.5vw, 29px) var(--section-space-bottom);
    background: #32765f;
  }
  .home-page .contact-section { padding-bottom: calc(var(--section-space-bottom) - 9px); }
  .contact-section__heading {
    display: block;
    margin: 0 0 clamp(64px, 13.7vw, 89px);
  }
  .contact-section__en {
    display: block;
    font-size: clamp(38px, 8.6vw, 56px);
    line-height: 1.08;
    letter-spacing: 0;
  }
  .contact-section__rule {
    display: none;
  }
  .contact-section__ja {
    display: block;
    margin-top: clamp(7px, 1.8vw, 12px);
    font-size: clamp(14px, 3.2vw, 21px);
    font-weight: 400;
  }
  .contact-card {
    padding: clamp(34px, 8vw, 52px) clamp(20px, 4.8vw, 31px) 20px;
    border-radius: clamp(20px, 4.5vw, 30px);
    box-shadow: none;
  }
  .contact-estimate {
    margin: 24px 0 6px;
    padding: 18px 16px;
  }
  .contact-estimate__head {
    align-items: flex-start;
    gap: 12px;
  }
  .contact-estimate__head strong { font-size: 15px; }
  .contact-estimate__head button {
    min-height: 36px;
    padding-inline: 12px;
    font-size: 11px;
  }
  .contact-estimate dl {
    grid-template-columns: 1fr;
    margin-top: 14px;
  }
  .contact-estimate dl > div { padding: 10px 0; }
  .contact-card__title {
    font-size: clamp(24px, 5.8vw, 38px);
    line-height: 1.4;
  }
  .contact-card__title-break {
    display: block;
  }
  .contact-card__note {
    margin-top: clamp(24px, 5vw, 32px);
    font-size: clamp(12px, 2.8vw, 18px);
    line-height: 2;
    text-align: left;
  }
  .contact-card__required-note {
    margin-top: 5px;
    font-size: clamp(12px, 2.8vw, 18px);
    text-align: left;
  }
  .contact-card__divider {
    margin-top: clamp(24px, 4.8vw, 31px);
  }

  .cf7-row { grid-template-columns: 1fr; gap: 8px; padding: 5.65px 0; }
  .cf7-row > label,
  .cf7-label { padding-left: 30px; }
  .cf7-row > label > .req-mark,
  .cf7-label > .req-mark { left: 0; }
  .wpcf7-form-control.wpcf7-text,
  .wpcf7-form-control.wpcf7-tel,
  .wpcf7-form-control.wpcf7-email,
  .wpcf7-form-control.wpcf7-textarea,
  .wpcf7-form-control.wpcf7-select {
    padding: 10px 12px;
    /* iOS Safari prevents focus zoom when form controls are 16px or larger. */
    font-size: 16px;
  }
  .wpcf7-form-control.wpcf7-textarea { min-height: 120px; }
  .cf7-row--full > label { padding-top: 0; }
  .cf7-row--full > label > .req-mark { top: 0; }
  .cf7-split { flex-direction: column; }
  .cf7-name-grid { gap: 10px; }
  .cf7-zip-group {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }
  .cf7-zip-input { width: 100%; min-width: 0; max-width: none; }
  .cf7-zip-btn { padding-inline: 12px; font-size: 12px; }
  .cf7-radio-group .wpcf7-radio {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .cf7-radio-group .wpcf7-list-item label {
    min-height: 52px;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    font-size: clamp(11px, 3.2vw, 14px);
    white-space: nowrap;
  }
  .cf7-radio-group input[type="radio"] {
    width: 18px;
    height: 18px;
  }

  .cf7-confirm-list > div { grid-template-columns: 1fr; gap: 4px; }
  .cf7-confirm { padding-top: 24px; }
  .cf7-confirm { scroll-margin-top: 100px; }
  .cf7-confirm > h3 { font-size: 21px; }
  .cf7-confirm > p { margin-bottom: 22px; font-size: 13px; text-align: left; }
  .cf7-confirm-actions { flex-direction: column-reverse; }
  .cf7-confirm-actions .cf7-submit-btn,
  .cf7-confirm-actions .cf7-back-btn { width: 100%; justify-content: center; }

  .cf7-submit-row { margin-top: 26px; }
  .cf7-submit-row .cf7-submit-btn { width: 100%; min-height: 56px; padding-inline: 48px; justify-content: center; font-size: 16px; }
  .cf7-submit-row .cf7-submit-btn svg { right: 22px; width: 18px; height: 18px; }
}
