:root {
  --main: #0f2c4b;
  --sub: #2365b1;
  --bg-mizuiro: #f4f9fe;
  --notes: #9d9d9d;
  --darkgray: #6f6f6f;
  --red: #ff383c;
  --ff: #ffffff;
}

.wpcf7 {
  width: 100%;
}
.wpcf7-list-item {
  display: inline-block;
  margin: 0 1em 0 0;
}
.wpcf7-turnstile {
  display: flex;
  justify-content: center;
}

/* ===== checkbox (同意/カタログ選択など、四角いチェックボックスを使う箇所で共通利用) ===== */

input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  background-color: #ffffff;
  border: 2px solid var(--notes);
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  height: 30px;
  margin: 0;
  position: relative;
  width: 30px;
}

input[type="checkbox"]:checked {
  background-color: var(--sub);
  border-color: var(--sub);
}

input[type="checkbox"]:checked::after {
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  content: "";
  height: 12px;
  left: 10px;
  position: absolute;
  top: 4px;
  transform: rotate(45deg);
  width: 6px;
}

input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--sub);
  outline-offset: 2px;
}

/* ===== contact-wrap (ステップ+フォーム本体を囲む外枠) ===== */

.b-contact-wrap {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 50px;
  padding: 100px 0;
  width: 100%;
}

@media (min-width: 769px) {
  .b-contact-wrap {
    padding: 150px 0;
  }
}

/* ===== step (ステップインジケーター) ===== */

.b-step {
  display: flex;
  isolation: isolate;
}
@media (min-width: 769px) {
  .b-step {
    height: 52px;
  }
}

.b-step > .e-item {
  align-items: center;
  color: #000000;
  display: flex;
  font-size: 18px;
  justify-content: center;
  line-height: 1.8;
  padding: 1em 20px 1em 30px;
  position: relative;
}

@media (min-width: 769px) {
  .b-step > .e-item {
    padding: 10px 45px;
  }
}

.b-step > .e-item::before {
  background-color: var(--notes);
  clip-path: polygon(
    0 0,
    calc(100% - 16px) 0,
    100% 50%,
    calc(100% - 16px) 100%,
    0 100%,
    16px 50%
  );
  content: "";
  inset: 0;
  position: absolute;
}

.b-step > .e-item::after {
  background-color: #ffffff;
  clip-path: polygon(
    0 0,
    calc(100% - 15px) 0,
    100% 50%,
    calc(100% - 15px) 100%,
    0 100%,
    15px 50%
  );
  content: "";
  inset: 1px;
  position: absolute;
}

.b-step > .e-item > .e-text {
  position: relative;
  z-index: 1;
}

.b-step > .e-item:first-child {
  padding-left: 30px;
  z-index: 3;
}

.b-step > .e-item:first-child::before {
  clip-path: polygon(
    0 0,
    calc(100% - 16px) 0,
    100% 50%,
    calc(100% - 16px) 100%,
    0 100%
  );
}

.b-step > .e-item:first-child::after {
  clip-path: polygon(
    0 0,
    calc(100% - 15px) 0,
    100% 50%,
    calc(100% - 15px) 100%,
    0 100%
  );
}

.b-step > .e-item:not(:first-child) {
  margin-left: -16px;
}

.b-step > .e-item:nth-child(2) {
  z-index: 2;
}

.b-step > .e-item:last-child {
  padding-right: 10px;
  z-index: 1;
}
@media (min-width: 769px) {
  .b-step > .e-item:last-child {
    padding-right: 45px;
  }
}

.b-step > .e-item:last-child::before {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 16px 50%);
}

.b-step > .e-item:last-child::after {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 15px 50%);
}

.b-step > .e-item.m-active {
  color: var(--ff);
}

.b-step > .e-item.m-active::before,
.b-step > .e-item.m-active::after {
  background-color: var(--sub);
}

/* ===== 確認メッセージ(ステップバーの下、確認画面のときだけ表示) ===== */

.e-confirm-message {
  border: 1px solid var(--red);
  color: var(--red);
  display: none;
  font-size: 18px;
  font-weight: 500;
  margin-top: 20px;
  max-width: 1300px;
  padding: 20px 0;
  text-align: center;
  width: 100%;
}

.b-contact-wrap.m-confirming .e-confirm-message {
  display: block;
}

/* ===== 送信完了パネル(サンクスページへのリダイレクトをせず、
   同一ページ内でwpcf7mailsent発生時に表示を切り替える方式) ===== */

.e-thanks-panel {
  display: none;
  max-width: 1000px;
  padding: 60px 0;
  text-align: center;
  width: 100%;
}

.e-thanks-panel p {
  line-height: 1.8;
  margin-top: 20px;
}

.b-contact-wrap.m-sent .e-thanks-panel {
  display: block;
}

.b-contact-wrap.m-sent .wpcf7 {
  display: none;
}

.b-contact-wrap.m-sent .b-catalog-preview {
  display: none;
}

/* ===== contents (フォーム本体の枠) ===== */

.b-contact-form {
  align-items: center;
  display: flex;
  flex-direction: column;
  max-width: 1300px;
  margin: 0 auto;
  padding: 50px 20px;
  width: 100%;
}

@media (min-width: 769px) {
  .b-contact-form {
    border: 1px solid var(--notes);
    padding: 100px 20px;
  }
}

/* ===== field (項目単位) =====
   e-field自体はこちらが直接書いたdivなので子要素セレクタ(>)を維持。
   ただし中の入力要素はCF7がspan.wpcf7-form-control-wrapで必ずラップするため、
   e-inputへは子孫セレクタ(半角スペース)で到達する。 */

.b-contact-form > .e-field {
  margin: 0 auto 50px;
  max-width: 1000px;
  width: 100%;
}

.b-contact-form > .e-field .e-label-row {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.b-contact-form > .e-field .e-label-row > .e-label {
  color: #000000;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.18px;
  line-height: 1.8;
}

/* .e-required は e-field 配下(通常項目)だけでなく e-agree 配下(同意チェックボックス)
   にも登場するため、子孫セレクタで両方に対応する */
.b-contact-form .e-required {
  background-color: #ffffff;
  border: 1px solid var(--red);
  color: var(--red);
  font-size: 14px;
  line-height: 1.6;
  padding: 2px 10px;
}

.b-contact-form > .e-field .e-label-row > .e-optional {
  background-color: #ffffff;
  border: 1px solid var(--darkgray);
  color: var(--darkgray);
  font-size: 14px;
  line-height: 1.6;
  min-width: 51px;
  padding: 2px 10px;
}

/* ===== input / textarea (CF7のspanラップ越しなので子孫セレクタ) ===== */

.b-contact-form > .e-field .e-input {
  background-color: #ffffff;
  border: 1px solid var(--notes);
  border-radius: 8px;
  font-size: 18px;
  height: 56px;
  padding: 0 10px;
  width: 100%;
}

.b-contact-form > .e-field .e-textarea {
  background-color: #ffffff;
  border: 1px solid var(--notes);
  border-radius: 8px;
  font-size: 18px;
  height: 220px;
  padding: 15px;
  resize: vertical;
  width: 100%;
}

.b-contact-form > .e-field > .e-row {
  display: flex;
  gap: 20px;
}

.b-contact-form > .e-field > .e-row .e-input {
  flex: 1 0 0;
}

/* ===== date group (第一希望・第二希望) ===== */

.b-contact-form > .e-field > .e-date-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.b-contact-form > .e-field > .e-date-group > .e-date-row {
  align-items: center;
  column-gap: 10px;
  display: flex;
  flex-wrap: wrap;
  row-gap: 15px;
}

.b-contact-form > .e-field > .e-date-group > .e-date-row > .e-date-label {
  color: #000000;
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1.8;
}

.b-contact-form > .e-field > .e-date-group > .e-date-row > span:nth-child(2) {
  flex: 1 0 0;
  max-width: 250px;
  min-width: 0;
}

.b-contact-form > .e-field > .e-date-group > .e-date-row > span:nth-child(3) {
  flex: 1 0 100%;
  max-width: 250px;
  margin: 0 0 0 auto;
}

@media (min-width: 769px) {
  .b-contact-form > .e-field > .e-date-group > .e-date-row > .e-date-label {
    width: 100px;
  }
  .b-contact-form > .e-field > .e-date-group > .e-date-row > span:nth-child(2) {
    max-width: unset;
  }
  .b-contact-form > .e-field > .e-date-group > .e-date-row > span:nth-child(3) {
    flex: 1 0 0;
    max-width: unset;
    min-width: 0;
  }
}

/* ===== 幅を絞る修飾子(郵便番号・日付欄など) ===== */

.b-contact-form > .e-field .e-input.m-narrow {
  max-width: 360px;
}

/* ===== notice (注意書き) ===== */

.b-contact-form > .e-notice {
  color: #000000;
  font-size: 16px;
  line-height: 1.6;
  margin: 0 auto 30px;
  max-width: 1000px;
  width: 100%;
}

.b-contact-form > .e-notice ul {
  list-style: none;
  padding: 0;
}
.b-contact-form > .e-notice ul li::before {
  content: "■";
}

/* ===== radio (CF7がwpcf7-list-item等で多段ラップするため子孫セレクタ) ===== */

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

.b-contact-form > .e-field > .e-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
}

.b-contact-form > .e-field > .e-radio-group label {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 10px;
}

.b-contact-form > .e-field > .e-radio-group label input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  background-color: #ffffff;
  border: 2px solid var(--notes);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  height: 28px;
  margin: 0;
  position: relative;
  width: 28px;
}

/* checkbox*にexclusive属性を付けてラジオボタン風に運用している項目(例:ご希望内容)も
   同じ丸いデザインで統一する */
.b-contact-form > .e-field > .e-radio-group label input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  background-color: #ffffff;
  border: 2px solid var(--notes);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  height: 28px;
  margin: 0;
  position: relative;
  width: 28px;
}

.b-contact-form > .e-field > .e-radio-group label input[type="radio"]:checked,
.b-contact-form
  > .e-field
  > .e-radio-group
  label
  input[type="checkbox"]:checked {
  border-color: var(--sub);
}

.b-contact-form
  > .e-field
  > .e-radio-group
  label
  input[type="radio"]:checked::before,
.b-contact-form
  > .e-field
  > .e-radio-group
  label
  input[type="checkbox"]:checked::before {
  background-color: var(--sub);
  border-radius: 50%;
  content: "";
  height: 16px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
}

.b-contact-form
  > .e-field
  > .e-radio-group
  label
  input[type="radio"]:focus-visible,
.b-contact-form
  > .e-field
  > .e-radio-group
  label
  input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--sub);
  outline-offset: 2px;
}

.b-contact-form > .e-field > .e-radio-group label .wpcf7-list-item-label {
  color: #000000;
  font-size: 18px;
  line-height: 1.8;
}

/* ===== checkbox (同意/CF7がacceptanceタグで多段ラップするため子孫セレクタ) ===== */

.b-contact-form > .e-agree {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin: 0 auto;
  max-width: 1000px;
  width: 100%;
}

.b-contact-form > .e-agree > .e-agree-row {
  align-items: center;
  display: flex;
}

.b-contact-form > .e-agree > .e-agree-row .e-label {
  color: #000000;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.8;
}

.b-contact-form > .e-agree > .e-agree-note {
  color: #000000;
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

/* ===== 送信・確認・修正ボタン (こちらが直接書いたボタンとCF7のsubmitタグは
   ラップspanなしで直下に出力されるため子要素セレクタのまま) ===== */

.b-contact-form > .e-actions {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 30px;
}

.b-contact-form > .e-actions > .e-confirm-button,
.b-contact-form > .e-actions > .e-edit-button,
.b-contact-form > .e-actions > .e-submit-wrap {
  align-items: center;
  border-radius: 200px;
  cursor: pointer;
  display: inline-flex;
  gap: 10px;
  height: 70px;
  justify-content: center;
  padding: 0 80px;
  position: relative;
}

.wpcf7-spinner {
  margin: 0;
}

.b-contact-form > .e-actions > .e-submit-wrap {
  padding: 0 45px 0 80px;
}

.b-contact-form > .e-actions > .e-confirm-button,
.b-contact-form > .e-actions > .e-submit-wrap {
  background-color: var(--main);
  border: none;
  color: var(--ff);
}

.b-contact-form > .e-actions > .e-confirm-button::after,
.b-contact-form > .e-actions > .e-submit-wrap::after {
  border-bottom: 6px solid transparent;
  border-left: 8px solid currentColor;
  border-top: 6px solid transparent;
  content: "";
  display: inline-block;
  height: 0;
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
}

.b-contact-form.m-confirming > .e-actions > .e-confirm-button {
  display: none;
}

.b-contact-form > .e-actions > .e-edit-button {
  background-color: #ffffff;
  border: 1px solid var(--notes);
  color: #000000;
  display: none;
}

.b-contact-form > .e-actions > .e-edit-button::after {
  border-bottom: 6px solid transparent;
  border-left: 8px solid currentColor;
  border-top: 6px solid transparent;
  content: "";
  display: inline-block;
  height: 0;
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
}

.b-contact-form > .e-actions > .e-submit-wrap {
  display: none;
}

.b-contact-form > .e-actions > .e-submit-wrap > .e-submit-button {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.wpcf7 .wpcf7-submit:disabled {
  cursor: not-allowed;
}

.e-input.wpcf7-not-valid,
.e-textarea.wpcf7-not-valid {
  border-color: var(--red);
}

.wpcf7-not-valid-tip {
  color: var(--red);
  display: block;
  font-size: 14px;
  margin-top: 8px;
}

.b-contact-form.m-confirming > .e-actions > .e-edit-button,
.b-contact-form.m-confirming > .e-actions > .e-submit-wrap {
  display: inline-flex;
}

.b-contact-form.m-confirming .e-input,
.b-contact-form.m-confirming .e-textarea {
  background-color: var(--bg-mizuiro);
  pointer-events: none;
}

/* カタログ */
.b-catalog-select .wpcf7-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.b-catalog-select .wpcf7-list-item {
  border: 1px solid var(--notes);
  flex: 1 0 0;
  max-width: 490px;
  min-width: 300px;
  padding: 20px;
  width: calc(50% - 0.5em);
}

.b-catalog-select .wpcf7-list-item label {
  align-items: flex-start;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.b-catalog-select .wpcf7-list-item-label {
  color: #000000;
  flex: 1 0 0;
  font-size: 16px;
  height: 2.6em;
  line-height: 1.6;
  min-width: 0;
}

.b-catalog-select .e-thumb {
  display: flex;
  height: 150px;
  justify-content: center;
  width: 100%;
}

.b-catalog-select .e-thumb > img {
  aspect-ratio: 100 / 139;
  height: 100%;
  object-fit: cover;
}

/* ===== catalog-preview (資料・カタログの紹介エリア、固定ページ側で使用) ===== */

.b-catalog-preview {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

.b-catalog-preview > .e-list {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
  width: 100%;
}

@media (min-width: 769px) {
  .b-catalog-preview > .e-list {
    gap: 50px;
  }
}

.b-catalog-preview > .e-list > .e-item {
  aspect-ratio: 216 / 300;
  box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
  flex: 0 0 auto;
  width: 215px;
}

.b-catalog-preview > .e-list > .e-item > img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}
