@charset "UTF-8";
/* ==========================================================================
   form.css — mailform 共通スタイル（お問い合わせ / 無料査定）
   デザイン元が無いため、common.css のデザイントークンに合わせた暫定スタイル
   （docs/questions.md 14）。デザイン確定後に差し替える前提。
   ========================================================================== */

.p-form { max-width: 900px; margin: 0 auto; }

.p-form__lead { font-size: var(--fz-body); line-height: 2; margin-bottom: 40px; }
.p-form__required { color: #c00; font-weight: 700; }

/* 送信エラー等の全体メッセージ（mailform が role="alert" に流し込む） */
.p-form .form-message:empty { display: none; }
.p-form .form-message {
  margin-bottom: 24px; padding: 14px 20px;
  border: 1px solid #c00; border-radius: 4px;
  background: #fff5f5; color: #c00; font-weight: 700;
}

/* ---- テーブル ------------------------------------------------------------ */
.p-form__table { width: 100%; border-collapse: collapse; }
.p-form__table th,
.p-form__table td {
  padding: 20px; font-size: var(--fz-body); line-height: 1.8;
  border-bottom: 1px solid var(--c-line); text-align: left; vertical-align: top;
}
.p-form__table th {
  width: 300px; background: var(--c-bg); font-weight: 700; color: var(--c-navy);
}
.p-form__table th .req,
.p-form__table th .any {
  display: inline-block; margin-left: 8px; padding: 2px 8px;
  border-radius: 3px; font-size: 12px; font-weight: 700; vertical-align: middle;
}
.p-form__table th .req { background: #c00; color: #fff; }
.p-form__table th .any { background: var(--c-line); color: var(--c-navy); }

/* ---- 入力部品 ------------------------------------------------------------ */
.p-form input[type="text"],
.p-form input[type="email"],
.p-form input[type="tel"],
.p-form select,
.p-form textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--c-line); border-radius: 4px;
  background: var(--c-white); color: var(--c-black);
  font-family: var(--ff-base); font-size: var(--fz-body); line-height: 1.6;
}
.p-form input[type="text"]:focus,
.p-form input[type="email"]:focus,
.p-form input[type="tel"]:focus,
.p-form select:focus,
.p-form textarea:focus {
  outline: 2px solid var(--c-blue); outline-offset: 1px;
}
.p-form textarea { min-height: 200px; resize: vertical; }
.p-form input.is-short { max-width: 220px; }

/* セレクトの下向き矢印（costs.php .p-sim__select と同じ手法。appearance:none で消える
   ネイティブ矢印の代わりに、擬似要素ではなく span を select に重ねて描画する） */
.p-form__select { position: relative; }
.p-form__select select { padding-right: 44px; }
.p-form__select-arrow {
  position: absolute;
  right: 18px;
  top: 50%;
  width: 10px; height: 10px;
  border-right: 2px solid var(--c-navy);
  border-bottom: 2px solid var(--c-navy);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.p-form__agree { text-align: center; margin: 40px 0 0; font-size: var(--fz-body); }
.p-form__agree label {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  line-height: 1.6;
}
/* チェックボックス本体は視認性が保てないため（reset.cssでappearance:none）、
   label::before を実体の見た目として使用し、input はアクセシビリティのために
   視覚的にのみ隠す（display:noneにするとフォーカス・スクリーンリーダーが失われるため）。 */
.p-form__agree label::before {
  content: "";
  flex: none;
  width: 18px; height: 18px;
  margin-right: 8px;
  border: 1px solid var(--c-line); border-radius: 4px;
  background-color: var(--c-white);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 11px 11px;
  box-sizing: border-box;
  transition: background-color .15s, border-color .15s;
}
.p-form__agree label:has(input:checked)::before {
  background-color: var(--c-blue);
  border-color: var(--c-blue);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M3 8.5l3.2 3.2L13 4.5'/%3E%3C/svg%3E");
}
.p-form__agree label:has(input:focus-visible)::before {
  outline: 2px solid var(--c-blue);
  outline-offset: 2px;
}
.p-form__agree input[type="checkbox"] {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.p-form__agree a { color: var(--c-blue); text-decoration: underline; }

/* ---- 項目ごとのエラー ---------------------------------------------------- */
.p-form .error:empty { display: none; }
.p-form .error { display: block; margin-top: 8px; color: #c00; font-size: var(--fz-min); font-weight: 700; }

/* ---- 送信ボタン ---------------------------------------------------------- */
/* ボタン自体の見た目は共通パーツ .c-btn-more / .c-btn-more--blue（common.css）に委譲 */
.p-form__submit { margin: 40px 0 0; text-align: center; }
.p-form__submit button:disabled { opacity: .5; cursor: default; pointer-events: none; }

/* ---- SP ------------------------------------------------------------------ */
@media screen and (max-width: 768px) {
  .p-form__table tr { display: block; margin-bottom: 28px; }
  .p-form__table tr:last-child { margin-bottom: 0; }
  .p-form__table th,
  .p-form__table td { display: block; width: auto; padding: 12px 14px; }
  .p-form__table th { border-bottom: none; }
  .p-form__table td { border-bottom: none; }

  /* 電話番号（is-short）以外の短い入力欄は横幅いっぱいに広げる */
  .p-form input.is-short { max-width: none; }
  .p-form input[type="tel"].is-short { max-width: 220px; }

  .p-form__submit button { min-width: 0; width: 90%; }
}
