/* =========================================
   Meeting Form CSS (page-only file)
========================================= */

/* 余白・幅 */
.page__content .my-contact {
  margin: 4rem auto 10rem;
  width: 100%;
}

/* フォーム枠（あなたが直した設定を採用） */
.page__content .my-contact .wpcf7 {
  background: #fff;
  border: 1px solid rgba(28, 72, 181, 0.14);
  border-radius: 2.4rem;
  /* box-shadow: 0 1.2rem 3.2rem rgba(0,0,0,0.06); */
  padding: 4.8rem 4.8rem 4rem;
}

.my-contact .wpcf7-form p {
  margin: 0;
}

/* -----------------------------------------
   Labels / Fields
----------------------------------------- */
.form_item {
  margin: 0 0 3.2rem;
}

.contact-label > p {
  margin: 0;
}

.item_label {
  display: block;
  font-weight: 700;
  color: #1c1c1c;
  letter-spacing: 0.02em;
}

/* 必須・任意バッジ（WeBright寄せ） */
.required,
.optional {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 0.6rem;
  font-size: 1.2rem;
  line-height: 1;
  color: #fff;
}

.required {
  background: #FF8D2E;
}

.optional {
  background: rgba(92, 92, 92, 0.45);
}

/* 入力共通 */
.my-contact input[type="text"],
.my-contact input[type="email"],
.my-contact input[type="tel"],
.my-contact input[type="date"],
.my-contact textarea,
.my-contact select {
  width: 100%;
  margin-top: 1.2rem;
  border: 1px solid rgba(28, 72, 181, 0.18);
  border-radius: 1.4rem;
  padding: 1.2rem 1.4rem;
  background: #fff;
  color: #1c1c1c;
  font-size: 1.6rem;
  line-height: 1.6;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.my-contact textarea {
  min-height: 16rem;
  resize: vertical;
}

.my-contact select {
  cursor: pointer;
}

.my-contact input:focus,
.my-contact textarea:focus,
.my-contact select:focus {
  outline: none;
  border-color: rgba(28, 72, 181, 0.55);
  box-shadow: 0 0 0 4px rgba(28, 72, 181, 0.12);
}

.my-contact ::placeholder {
  color: rgba(28, 28, 28, 0.35);
}

/* -----------------------------------------
   Section headings (h3) ※このページだけ前提でもフォーム内に限定
----------------------------------------- */
.my-contact h3 {
  margin: 4rem 0 0;
  padding: 1.6rem 2rem;
  border-radius: 1.6rem;
  background: rgba(28, 72, 181, 0.06);
  color: #1C48B5;
  font-size: 1.8rem;
  line-height: 1.6;
}

/* -----------------------------------------
   Date + Time blocks
----------------------------------------- */
.date {
  margin-top: 4rem;
}

.calender {
  margin-top: 2.4rem;
  padding: 2.4rem;
  border: 1px solid rgba(28, 72, 181, 0.14);
  border-radius: 2rem;
  background: rgba(28, 72, 181, 0.02);
}

.calender p {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24rem; /* 日付 / 時間 */
  gap: 1.6rem;
  align-items: end;
  margin: 0;
}

/* -----------------------------------------
   Question blocks / Options (checkbox / radio)
----------------------------------------- */
.meet-question {
  margin-top: 4rem;
  padding-top: 3.2rem;
  border-top: 1px solid rgba(28, 72, 181, 0.10);
}

.wpcf7-checkbox,
.wpcf7-radio {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem 1.6rem;
  margin-top: 1.6rem;
}

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

.wpcf7-list-item label {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.4rem 1.6rem;
  border-radius: 1.6rem;
  border: 1px solid rgba(28, 72, 181, 0.18);
  background: #fff;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}

.wpcf7-list-item label:hover {
  border-color: rgba(28, 72, 181, 0.45);
  background: rgba(28, 72, 181, 0.03);
  transform: translateY(-1px);
}

.my-contact input[type="checkbox"],
.my-contact input[type="radio"] {
  accent-color: #1C48B5;
  margin-top: 0.25rem;
  flex: 0 0 auto;
}

/* 選択中（対応ブラウザでカード強調） */
.wpcf7-list-item label:has(input:checked) {
  border-color: rgba(255, 141, 46, 0.75);
  background: rgba(255, 141, 46, 0.06);
}

/* -----------------------------------------
   Privacy / acceptance
----------------------------------------- */
.privacy {
  margin-top: 1.6rem;
  padding-top: 2.4rem;
  border-top: 1px solid rgba(28, 72, 181, 0.10);
  color: #333;
  font-size: 1.5rem;
  line-height: 1.8;
}

.privacy a {
  color: #FF8D2E;
  text-decoration: underline;
  transition: opacity 0.3s ease;
}

.privacy a:hover {
  opacity: 0.7;
}

/* 同意チェックだけはカード化を外す */
.wpcf7-acceptance .wpcf7-list-item label {
  border: none;
  background: transparent;
  padding: 0;
  transform: none;
}
.wpcf7-acceptance .wpcf7-list-item label:hover {
  background: transparent;
}

/* -----------------------------------------
   Submit button（デザインは既存btn_assetに任せて、幅と配置だけ）
----------------------------------------- */
.wpcf7-submit.btn_asset {
  margin: 2.4rem auto 0;
  width: min(42rem, 100%);
  display: block;
}

.wpcf7-submit[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* -----------------------------------------
   CF7 Error / Notice
----------------------------------------- */
.wpcf7-not-valid {
  border-color: rgba(217, 48, 37, 0.65) !important;
  box-shadow: 0 0 0 4px rgba(217, 48, 37, 0.12);
}

.wpcf7-not-valid-tip {
  margin-top: 0.8rem;
  font-size: 1.3rem;
  color: #d93025;
}

.wpcf7-response-output {
  margin: 2.4rem 0 0;
  padding: 1.6rem 1.8rem;
  border-radius: 1.6rem;
  font-size: 1.4rem;
  line-height: 1.7;
  border: 1px solid rgba(28, 72, 181, 0.18);
  background: rgba(28, 72, 181, 0.04);
  color: #1C48B5;
}

/* -----------------------------------------
   Responsive
----------------------------------------- */
@media (max-width: 768px) {
  .page__content .my-contact .wpcf7 {
    padding: 2.8rem 2rem 2.4rem;
    border-radius: 2rem;
  }

  .calender {
    padding: 1.8rem;
    border-radius: 1.6rem;
  }

  .calender p {
    grid-template-columns: 1fr;
  }

  .wpcf7-checkbox,
  .wpcf7-radio {
    grid-template-columns: 1fr;
  }

  .wpcf7-list-item label {
    padding: 1.2rem 1.4rem;
    border-radius: 1.4rem;
  }

  .wpcf7-submit.btn_asset {
    width: 100%;
  }
}
/* ------------------------------
  iPhoneでの横はみ出し対策（まず効くセット）
------------------------------ */
.my-contact,
.my-contact * ,
.my-contact *::before,
.my-contact *::after {
  box-sizing: border-box;
}

.my-contact {
  overflow-x: clip; /* Safari古め対策なら hidden でもOK */
}

/* 入力系だけ100%に（checkbox/radioは触らない） */
.my-contact input.wpcf7-text,
.my-contact input.wpcf7-email,
.my-contact input.wpcf7-tel,
.my-contact input.wpcf7-date,
.my-contact select.wpcf7-select,
.my-contact textarea.wpcf7-textarea {
  width: 100%;
  max-width: 100%;
}

/* iOSの自動ズーム回避（16px未満だと拡大されてレイアウトが崩れがち） */
@media (max-width: 480px) {
  .my-contact input.wpcf7-text,
  .my-contact input.wpcf7-email,
  .my-contact input.wpcf7-tel,
  .my-contact input.wpcf7-date,
  .my-contact select.wpcf7-select,
  .my-contact textarea.wpcf7-textarea {
    font-size: 16px;
  }
}

/* ------------------------------
  カレンダー塊：BRの空白をCSS側で詰める
------------------------------ */
.my-contact .calender br {
  display: none;
}

/* label内のwrapをブロック化して、br無しでも自然に改行 */
.my-contact .calender label {
  display: block;
}

.my-contact .calender label .wpcf7-form-control-wrap {
  display: block;
  margin-top: 1.2rem;
}

/* labelの外にある select 側wrap（第1希望の時間など） */
.my-contact .calender > p > .wpcf7-form-control-wrap {
  display: block;
  margin-top: 1.2rem;
}

/* JSバリデーションのメッセージ表示用 */
.my-contact .js-date-error {
  display: block;
  margin-top: 0.8rem;
  font-size: 1.3rem;
  line-height: 1.4;
  color: #c23a3a;
}
/* 日付＋時間のブロックだけ “実機iOSの幅暴れ” を止める */
.calender .wpcf7-form-control-wrap{
  display:block;
  width:100%;
  min-width:0;
}

.calender input[type="date"],
.calender select{
  display:block;
  width:100%;
  max-width:100%;
  min-width:0;
}

/* iOS実機：dateだけ横はみ出す対策 + 未入力の真っ白対策 */
@supports (-webkit-touch-callout: none) {
  /* grid内でiOSが勝手に最小幅を主張するのを止める */
  .my-contact .calender p,
  .my-contact .calender p > *,
  .my-contact .calender label,
  .my-contact .calender .wpcf7-form-control-wrap {
    min-width: 0;
  }

  /* dateの“箱”をwrapで作る（はみ出しをクリップ）＋ アイコン */
  .my-contact .calender .wpcf7-form-control-wrap:has(> input[type="date"]) {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden; /* ← はみ出し止めの本体 */
    border-radius: 1.4rem;
    border: 1px solid rgba(28, 72, 181, 0.18);
    background: #fff;

    /* 見た目アイコン（iOSのネイティブ有無に左右されない） */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%231C48B5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.4rem center;
    background-size: 2rem 2rem;
  }

  /* input側は“箱の中身”だけにする */
  .my-contact .calender input[type="date"] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;

    border: 0 !important;
    border-radius: 0 !important;
    background: transparent;

    /* 右側のアイコン分の余白 */
    padding: 1.2rem 4.4rem 1.2rem 1.4rem;

    /* ネイティブ挙動は維持（ピッカー自体はこれでOK） */
    -webkit-appearance: auto;
    appearance: auto;
  }

  /* wrap側にフォーカス表現 */
  .my-contact .calender .wpcf7-form-control-wrap:has(> input[type="date"]):focus-within {
    border-color: rgba(28, 72, 181, 0.55);
    box-shadow: 0 0 0 4px rgba(28, 72, 181, 0.12);
  }

  /* 未入力が真っ白問題：wrapに疑似placeholder */
  .my-contact .calender .wpcf7-form-control-wrap:has(> input[type="date"]):not(.is-filled)::after {
    content: "年 / 月 / 日";
    position: absolute;
    left: 1.4rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(28, 28, 28, 0.35);
    font-size: 1.6rem;
    pointer-events: none;
  }

  /* フォーカス中は邪魔なので消す */
  .my-contact .calender .wpcf7-form-control-wrap:has(> input[type="date"]):focus-within::after {
    opacity: 0;
  }
}

