/* ==========================================================================
   Orbit Core — contact.css
   お問い合わせページ専用。style.css のトークン（--navy 等）を前提にしているので
   必ず style.css の「後ろ」で読み込むこと。
   LP 側のセレクタには一切触れていないため、index.html の見た目は変わらない。

   数値は Figma「お問い合わせページ」(1440px幅) の実寸に合わせている。
     ヒーロー高さ 340 / カード 900×1126・#e2e7ef・角丸5
     入力欄 413×42・白・角丸なし / 行ピッチ 79 / 必須バッジ 50×24・角丸3
     送信ボタン 300×60・#1c2154・角丸5
   ========================================================================== */

/* ==========================================================================
   ページヘッダー（濃紺 340px ＋ 写真を不透明度 20% で重ねる）
   ========================================================================== */
.page-hero {
  position: relative;
  height: 340px;
  background: var(--navy);
  overflow: hidden;
}
.page-hero-bg {
  position: absolute; inset: 0;
  background-image: url('../images/contact-hero.jpg');
  background-size: cover;
  background-position: center;
  opacity: .2;
}
.page-hero-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
/* Figma: CONTACT のベースラインが y=180、見出しが y=228。
   ヘッダーのピルが上に重なるぶん、中央よりわずかに下げると原寸と一致する。 */
.page-hero-inner { padding-top: 46px; }

.page-hero-label {
  font-family: var(--font-en);
  font-weight: 500;
  font-size: 16px;
  line-height: 19.8px;
  letter-spacing: 1.98px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 28px;
}
.page-hero-title {
  font-size: 24px;
  font-weight: 500;
  line-height: 23.4px;
  letter-spacing: 3.52px;
  color: var(--white);
  /* letter-spacing は字間を最後の字の右にも足すので、その分だけ左に戻して中央を合わせる */
  text-indent: 3.52px;
}

/* ==========================================================================
   フォームセクション（回路パターンの背景）
   ========================================================================== */
.contact-section {
  position: relative;
  background: var(--white);
  padding: 113px 0 175px;
  overflow: hidden;
}
.contact-bg {
  position: absolute; inset: 0;
  background-image: url('../images/contact-pattern.jpg');
  background-size: cover;
  background-position: center;
  opacity: .6;
  pointer-events: none;
}
.contact-inner { position: relative; z-index: 1; }

.contact-lead {
  font-size: 18px;
  font-weight: 500;
  line-height: 36.4px;
  letter-spacing: .9px;
  color: var(--text-body);
  text-align: center;
  margin-bottom: 80px;
}

/* ==========================================================================
   フォームカード
   ========================================================================== */
.form-card {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  background: #e2e7ef;
  border-radius: 5px;
  /* Figma: 上 84 / 左 111 / 右 101 / 下 46（カード下端 1732） */
  padding: 84px 101px 33px 111px;
}

/* ---------- 1行（ラベル列 275px ＋ 入力列 413px） ---------- */
.form-row {
  display: grid;
  grid-template-columns: 275px 413px;
  align-items: start;
  margin-bottom: 37px; /* 42(入力高) + 37 = 79px ピッチ */
}
.form-row:last-of-type { margin-bottom: 0; }
/* ラジオ行だけ次の項目までの間隔が広い（Figma 実寸） */
.form-row-radio { margin-bottom: 45px; }

.form-label {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: .52px;
  color: var(--text-body);
  /* バッジ(24px)の中心を入力欄(42px)の中心に合わせる */
  padding-top: 9px;
}

.req, .any {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 24px;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .52px;
  line-height: 1;
  color: var(--white);
}
.req { background: var(--navy); }
.any { background: #7d7d7d; }

/* ---------- 入力欄 ---------- */
.form-field { min-width: 0; }

.input,
.textarea {
  display: block;
  width: 100%;
  height: 42px;
  font-family: var(--font-jp);
  font-size: 16px; /* iOS で拡大されないよう 16px を下回らせない */
  line-height: 1.6;
  color: var(--text-body);
  background: var(--white);
  border: 1px solid transparent; /* フォーカス時に枠が出ても行がずれないよう最初から確保 */
  border-radius: 0;
  padding: 9px 14px;
  transition: border-color .2s ease, box-shadow .2s ease;
  -webkit-appearance: none;
  appearance: none;
}
.textarea {
  height: 198px;
  resize: vertical;
  padding: 12px 14px;
  line-height: 1.8;
}
.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--teal-dark);
  box-shadow: 0 0 0 3px rgba(11,157,164,.18);
}
.input::placeholder,
.textarea::placeholder { color: #b4b9c6; }

/* ---------- ラジオボタン ----------
   Figma では白い円（20px・塗りのみ）。選択後の状態は用意されていないため、
   選択中は中央に紺のドットを出す形で補っている。 */
.radio-group {
  display: flex;
  flex-direction: column;
  /* Figma: 円の間隔は 43px ピッチ（20px + 21.6px）。上 10px で 1 つ目の円の中心を
     「必須」バッジの中心に合わせている */
  gap: 21.6px;
  padding-top: 10px;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 16px;
  font-weight: 500;
  line-height: 21.4px;
  color: var(--text-body);
  cursor: pointer;
}
.radio-item input[type="radio"] {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 0 0 0 8px; /* Figma: 円は入力列の左端から 8px */
  border: none;
  border-radius: 50%;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  /* 選択中のドットは疑似要素ではなく背景で描く。<input> に ::before / ::after を
     生成しないエンジン（Firefox）でも同じ見た目・同じアニメーションになる。 */
  background-color: var(--white);
  background-image: radial-gradient(circle closest-side, var(--navy) 96%, transparent 100%);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0 0;
  transition: background-size .18s ease, box-shadow .2s ease;
}
.radio-item input[type="radio"]:checked { background-size: 10px 10px; }
.radio-item input[type="radio"]:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(11,157,164,.35); }
.radio-item:hover input[type="radio"] { box-shadow: 0 0 0 3px rgba(28,33,84,.08); }

/* ---------- エラー表示 ---------- */
.form-error {
  display: none;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.7;
  color: #b3203b;
  margin-top: 7px;
}
.form-error.is-shown { display: block; }
.input.is-invalid,
.textarea.is-invalid { border-color: #b3203b; }
.radio-group.is-invalid input[type="radio"] { box-shadow: 0 0 0 2px #b3203b; }

/* ---------- 送信ボタン ---------- */
.form-submit {
  /* Figma: テキストエリア下端から 57px */
  margin-top: 57px;
  text-align: center;
  /* ボタンはカードの内側ではなくカード幅に対して中央に置かれているため、
     左右のパディングぶんを打ち消して中心を合わせる */
  margin-left: -111px;
  margin-right: -101px;
}
.btn-submit {
  width: 300px;
  height: 60px;
  background: var(--navy);
  border-radius: 5px;
  color: var(--white);
  font-family: var(--font-jp);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 3.52px;
  text-indent: 3.52px;
  transition: background-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.btn-submit:hover {
  background: #2a3170;
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -10px rgba(28,33,84,.55);
}
.btn-submit:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- プライバシーポリシー ---------- */
.form-privacy {
  /* Figma: ボタン下端から 81px、カード右端から 32px */
  margin-top: 68px;
  margin-right: -69px;
  text-align: right;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .52px;
  color: var(--text-body);
}
.form-privacy a {
  color: inherit;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.form-privacy a:hover { color: var(--teal-dark); }

/* スパム対策のダミー項目。人間には見えず、読み上げ・タブ移動からも外す */
.hp-field {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* 送信完了メッセージ（送信成功後に contact.js が表示） */
.form-done { display: none; text-align: center; padding: 30px 0 10px; }
.form-done.is-shown { display: block; }
.form-done h2 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: .1em;
  color: var(--navy);
  margin-bottom: 16px;
}
.form-done p { font-size: 16px; line-height: 1.9; color: var(--text-body); }

/* ==========================================================================
   レスポンシブ
   Figma は 1440px のみのため、以下は LP のブレイクポイント（1024 / 768 / 480）に
   合わせて構成している。
   ========================================================================== */
/* Figma の 1440px レイアウトでは選択肢が 1 行に収まる。日本語フォントの
   実測幅は Figma より数 px 広く出るため、この幅のときだけ折り返しを止める */
@media (min-width: 1025px) {
  .radio-item span { white-space: nowrap; }
}

@media (max-width: 1024.98px) {
  .form-card { padding: 64px 6% 40px; }
  .form-row { grid-template-columns: 240px minmax(0, 1fr); }
  .form-row-radio { margin-bottom: 37px; }
  .form-submit { margin-left: 0; margin-right: 0; }
  .form-privacy { margin-right: 0; }
}

@media (max-width: 768px) {
  .page-hero { height: 240px; }
  .page-hero-inner { padding-top: 65px; }
  .page-hero-label { font-size: 14px; letter-spacing: 1.6px; margin-bottom: 18px; }
  .page-hero-title { font-size: 21px; letter-spacing: 2.6px; text-indent: 2.6px; }

  .contact-section { padding: 64px 0 80px; }
  /* デザイン通り「1文＝1行」を保てるところまで文字サイズを落とす
     （375px 幅で 21〜22 文字が 1 行に収まる） */
  .contact-lead {
    font-size: 15px;
    line-height: 2.1;
    letter-spacing: 0;
    margin-bottom: 40px;
  }

  .form-card { padding: 36px 20px 32px; border-radius: 5px; }

  /* ラベルを入力欄の上に積む */
  .form-row {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 26px;
  }
  .form-label { padding-top: 0; font-size: 16px; gap: 12px; }
  .req, .any { width: 46px; height: 22px; font-size: 13px; }

  .radio-group { gap: 16px; padding-top: 0; }
  .radio-item { align-items: flex-start; font-size: 15px; line-height: 1.6; }
  .radio-item input[type="radio"] { margin-left: 0; margin-top: 2px; }

  .textarea { height: 170px; }

  .form-submit { margin-top: 36px; }
  .btn-submit { width: 100%; max-width: 300px; height: 56px; font-size: 16px; }

  .form-privacy { margin-top: 32px; text-align: center; font-size: 14px; }
}

/* Turnstile ウィジェットと送信エラー */
.form-turnstile { display: flex; justify-content: center; margin-top: 24px; min-height: 65px; }
.form-error-global { text-align: center; margin-top: 16px; }

/* ---------- アクセシビリティ ---------- */
/* 画面には出さず、読み上げソフトにだけ伝える */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* 入力エラーの件数（role="alert"）。空のときも描画したまま高さだけ 0 にする
   （display:none から切り替えると、読み上げソフトが変化を拾えないことがあるため） */
.form-error-summary {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.7;
  color: #b3203b;
  text-align: center;
}
.form-error-summary:empty { margin: 0; padding: 0; height: 0; }
.form-error-summary:not(:empty) { margin-bottom: 24px; }
/* 送信完了後にフォーカスを移す見出し。フォーカスが分かるようにしつつ、枠は控えめにする */
.form-done h2:focus { outline: 2px solid rgba(11, 157, 164, .45); outline-offset: 6px; }
.noscript-note { text-align: center; font-weight: 700; color: #b3203b; margin-bottom: 20px; }
/* Turnstile を data-size="flexible" にしたので、枠の幅に合わせて伸びる（狭い画面ではみ出さない） */
.form-turnstile .cf-turnstile { width: 100%; max-width: 400px; }

/* 送信失敗などのメッセージ（role="alert"）も、常に描画したまま高さだけ 0 にする
   （display:none から切り替えると、読み上げソフトが変化を拾えないことがあるため） */
.form-error.form-error-global { display: block; }
.form-error.form-error-global:empty { margin: 0; height: 0; }
