/* =====================================================================
   CONTACT（XDの比率を保ちつつ、内容の伸縮に強いフロー構成で実装）
   ===================================================================== */

.custom-contact {
  color: var(--color-text-form);
  padding-top: 16.7rem;
  padding-bottom: 16rem;
}

/* ---------- イントロ（写真＋見出し） ---------- */
.custom-contact-intro {
  display: grid;
  grid-template-columns: 60rem 1fr;
  column-gap: 7.5rem;
  align-items: center;
}
.custom-contact-photo {
  width: 60rem;
  height: 35rem;
  object-fit: cover;
  border-radius: 2rem;
}
.custom-contact-intro-text { min-width: 0; }
.custom-contact-title {
  font-weight: 700;
  font-size: 3.6rem;
  line-height: 6rem;
  color: #000;
}
.custom-contact-lead {
  margin-top: 2.4rem;
  font-weight: 400;
  font-size: 1.6rem;
  line-height: 3.2rem;
  color: var(--color-text-form);
}

/* ---------- フォーム ---------- */
.custom-form { margin-top: 9rem; }
.custom-form-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.custom-form-row {
  display: grid;
  grid-template-columns: 45.1rem 1fr;
  align-items: center;
  padding: 2.4rem 0;
  border-bottom: 1px solid var(--color-line-form);
}
.custom-form-row.is-type,
.custom-form-row.is-textarea { align-items: start; }
.custom-form-row.is-textarea { border-bottom: 3px solid var(--color-line-thick); }
.custom-form-row.is-agree { border-bottom: none; padding-bottom: 0; }

/* ラベル（文言＋必須/任意バッジをインラインで中央揃え） */
.custom-form-label {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding-left: 1.5rem;
  font-weight: 700;
  color: var(--color-text-form);
}
.custom-form-row.is-textarea .custom-form-label { padding-top: 1.2rem; }
.custom-form-label-text {
  min-width: 21rem;
  font-size: 2.4rem;
  line-height: 1.45;
}
.custom-req {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 9.2rem;
  height: 3.5rem;
  padding: 0 1rem;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-weight: 500;
  font-size: 1.8rem;
  line-height: 1;
}

/* 入力欄 */
.custom-form-field { min-width: 0; }
.custom-form-field input,
.custom-form-field textarea {
  width: 100%;
  max-width: 88.4rem;
  background: #fff;
  border: 1px solid var(--color-border-input);
  font-size: 1.6rem;
  color: var(--color-text-form);
}
.custom-form-field input {
  height: 5rem;
  border-radius: 2.5rem;
  padding: 0 2.2rem;
}
.custom-form-field textarea {
  height: 34.6rem;
  border-radius: 2rem;
  padding: 1.6rem 2.2rem;
  resize: none;
  line-height: 1.8;
}
.custom-form-field input::placeholder,
.custom-form-field textarea::placeholder { color: #b3b8c6; }
.custom-form-field input:focus,
.custom-form-field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.4rem rgba(50, 76, 225, 0.12);
}

/* チェックボックス（お問い合わせ内容・同意） */
.custom-check {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.custom-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.custom-check-box {
  flex: 0 0 auto;
  width: 3rem;
  height: 3rem;
  border-radius: 0.7rem;
  background: #fff;
  border: 1px solid var(--color-line);
  display: inline-grid;
  place-items: center;
}
.custom-check input:checked + .custom-check-box::before {
  content: "";
  width: 1.6rem;
  height: 0.9rem;
  border-left: 0.3rem solid var(--color-primary);
  border-bottom: 0.3rem solid var(--color-primary);
  transform: translateY(-0.2rem) rotate(-45deg);
}
.custom-check input:focus-visible + .custom-check-box { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.custom-check-text {
  margin-left: 1.5rem;
  font-weight: 500;
  font-size: 1.8rem;
  line-height: 1.5;
  color: var(--color-text-form);
}
.custom-check-text a { color: var(--color-text-form); text-decoration: underline; }

/* お問い合わせ内容＝2列グリッド（サービス／協業 ＋ その他） */
.custom-check-group {
  display: grid;
  grid-template-columns: 35rem auto;
  gap: 1.6rem 2rem;
  align-items: center;
}

/* 送信 */
.custom-form-submit { text-align: center; margin-top: 9.6rem; }
.custom-form-submit-btn {
  width: 37rem;
  height: 7.5rem;
  border-radius: 3.8rem;
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-jp);
  font-weight: 400;
  font-size: 2rem;
  transition: opacity 0.3s;
}
.custom-form-submit-btn:hover { opacity: 0.88; }
#submitBtn.is-loading { opacity: 0.6; pointer-events: none; }

/* バリデーション・通知 */
.is-invalid input:not([type="radio"]):not([type="checkbox"]),
.is-invalid textarea { border-color: #ff4d6a !important; background: #fff5f7 !important; }
.custom-form-error {
  display: block;
  margin-top: 0.8rem;
  color: #ff4d6a;
  font-size: 1.3rem;
  font-weight: 500;
}
/* 種別・同意行は .custom-form-field を持たないため row 直下に挿入される → 全幅で下に表示 */
.custom-form-row > .custom-form-error { grid-column: 1 / -1; padding-left: 1.5rem; }
.custom-form-alert {
  border-radius: 1.6rem;
  padding: 1.6rem 2rem;
  margin-bottom: 2.4rem;
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1.8;
}
.custom-form-alert.is-error { background: #fff0f3; color: #d6244a; border: 1px solid #ffccd5; }

/* 送信完了 */
.custom-contact-thanks { text-align: center; padding: 10rem 0 16rem; }
.custom-contact-thanks h2 { font-size: 3.2rem; font-weight: 700; color: var(--color-blue); margin-bottom: 2rem; }
.custom-contact-thanks p { color: var(--color-text-form); line-height: 2; margin-bottom: 4rem; font-size: 1.6rem; }
.custom-contact-thanks .custom-viewmore { margin-inline: auto; }

/* ---------- SP（PCより一回り小さめ・すっきり） ---------- */
@media (max-width: 767px) {
  .custom-contact { padding-top: 8.3rem; padding-bottom: 12.8rem; }

  .custom-contact-intro { grid-template-columns: 1fr; }
  .custom-contact-photo { width: 35rem; height: 22.3rem; }
  .custom-contact-intro-text { margin-top: 3.4rem; }
  .custom-contact-title { font-size: 1.6rem; line-height: 2.7rem; }
  .custom-contact-lead { margin-top: 1.4rem; font-size: 1.35rem; line-height: 2.5rem; }

  .custom-form { margin-top: 5rem; }

  /* 各行を縦積み（ラベル → 入力） */
  .custom-form-row {
    grid-template-columns: 1fr;
    padding: 2.2rem 0;
  }
  .custom-form-row.is-agree { padding-bottom: 0; }
  .custom-form-label {
    padding-left: 0;
    margin-bottom: 1.2rem;
  }
  .custom-form-row.is-textarea .custom-form-label { padding-top: 0; }
  .custom-form-label-text { min-width: 0; font-size: 1.5rem; line-height: 1.45; }
  .custom-req {
    min-width: 5.4rem;
    height: 2.2rem;
    padding: 0 0.9rem;
    font-size: 1.2rem;
  }

  .custom-form-field input,
  .custom-form-field textarea { max-width: none; font-size: 1.4rem; }
  .custom-form-field input { height: 4.4rem; padding: 0 1.6rem; border-radius: 2.2rem; }
  .custom-form-field textarea { height: 25rem; padding: 1.3rem 1.6rem; }

  /* お問い合わせ内容＝縦積み */
  .custom-check-group { grid-template-columns: 1fr; gap: 1.5rem; }
  .custom-check-box { width: 2.4rem; height: 2.4rem; border-radius: 0.6rem; }
  .custom-check input:checked + .custom-check-box::before { width: 1.2rem; height: 0.7rem; }
  .custom-check-text { margin-left: 1.2rem; font-size: 1.35rem; }

  .custom-form-submit { margin-top: 4.4rem; }
  .custom-form-submit-btn { width: 35rem; height: 6rem; border-radius: 3rem; font-size: 1.6rem; }

  .custom-form-row > .custom-form-error { padding-left: 0; }

  /* 送信完了画面 */
  .custom-contact-thanks h2 { font-size: 2.6rem; }
  .custom-contact-thanks p { font-size: 1.4rem; }
}
