form {
  padding-top: 0;
}

.form_item {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 32px 0;
  border-top: 1px solid var(--border_color2);
  border-bottom: 1px solid var(--border_color2);
}

.form_item:not(:first-child) {
  margin-top: -1px;
}

/* head_box */

.form_item .head_box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.form_item .head_box p.head {
  font-size: 18px;
  line-height: 1;
}

/* 必須 */
.form_item .head_box p.must {
  margin-left: auto;
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 18px;
  padding: 0 10px;
  border-radius: 100px;
  background-color: #de5836;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

/* 任意 */
.form_item .head_box p.optional {
  margin-left: auto;
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 18px;
  padding: 0 10px;
  border-radius: 100px;
  background-color: #c9c9c9;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

/* エラー文 */
.form_item .element_box p.errors {
  color: #dc0000;
  margin-top: 5px;
}

/* element_box */

.input_wrap {
  width: 100%;
}
.double_text_input_wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* submitボタン */
.submit_btn {
  width: auto;
  min-width: 280px;
  padding: 16px 120px;
  border-radius: 4px;
  background-color: #f39800;
  text-align: center;
  display: block;
  margin: 48px auto 0;
  cursor: pointer;
  transition: all 0.3s;
  color: #ffffff;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.5;
}
.submit_btn:hover {
  opacity: 0.8;
}
@media screen and (max-width: 768px) {
  .submit_btn {
    width: 100%;
    min-width: 0;
    margin-top: 32px;
    padding: 16px;
  }
}

/* テキストボックス用スタイル */
.input_item.text {
  width: 100%;
  padding: 16px 12px;
  border-radius: 4px;
  background-color: #fff;
  font-size: 18px;
}

.input_item.half {
  width: 48%;
}
/* テキストエリア用スタイル */
.input_item.textarea {
  width: 100%;
  padding: 16px 12px;
  border-radius: 4px;
  background-color: #fff;
  height: 20vw;
  max-height: 270px;
  min-height: 160px;
  font-size: 18px;
  resize: none;
}

/* セレクトボックス */
select.input_item,
.contact_form_input select {
  width: 100%;
  max-width: 332px;
  height: 56px;
  padding: 14px 40px 14px 16px;
  border: none;
  border-radius: 4px;
  background-color: #fff;
  font-size: 18px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23222' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}

.contact_form_input {
  width: 100%;
  max-width: 332px;
}

.input_item.age {
  width: 124px;
}

.input_wrap:has(.age) {
  display: flex;
  align-items: center;
  gap: 32px;
}

.input_wrap:has(.age)::after {
  content: "歳";
  font-weight: 700;
  font-size: 18px;
}

/* ラジオボタン */
.radio_wrapper {
  display: flex;
  gap: 11px;
  flex-wrap: wrap;
  padding: 0;
  background-color: transparent;
}
.radio_label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 16px 24px;
  border: 1px solid var(--color1);
  border-radius: 100px;
  color: var(--color1);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.125;
  cursor: pointer;
  transition: 0.2s;
}

.radio_label:has(input:checked) {
  background-color: var(--color1);
  color: #fff;
}

.input_item.radio {
  width: 14px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 1px solid var(--color1);
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
}

.input_item.radio::before {
  content: "";
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background-color: #fff;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.input_item.radio:checked {
  border-color: #fff;
}

.input_item.radio:checked::before {
  opacity: 1;
  visibility: visible;
  background-color: #fff;
}

/* プライバシーポリシーの同意 */
.agree {
  margin-top: 66px;
}

.privacy_box {
  width: 100%;
  height: 200px;
  margin-top: 0;
  margin-bottom: 32px;
  padding: 21px 29px;
  border: 1px solid var(--border_color2);
  background-color: #fff;
  overflow-y: auto;
}

.privacy_box::-webkit-scrollbar {
  width: 16px;
}

.privacy_box::-webkit-scrollbar-thumb {
  background-color: #666464;
  height: 74px;
}

.privacy_box::-webkit-scrollbar-track {
  background-color: #EDECEC;
}

.agree_wrap {
  display: flex;
  align-items: center;
  margin-top: 24px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.form_agree {
  border: 1px solid var(--letter_base);
  width: 16px;
  height: 16px;
  margin-right: 8px;
  position: relative;
  cursor: pointer;
}

.form_agree::before {
  opacity: 0;
  visibility: hidden;
  content: "";
  display: block;
  background-image: url(../icon_check.svg);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  width: 12px;
  height: 12px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.2s;
}

.form_agree:checked::before {
  opacity: 1;
  visibility: visible;
}

.form_agree:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.form_agree:disabled + label {
  cursor: not-allowed;
  opacity: 0.5;
}

.agree_txt {
  cursor: pointer;
  flex: 1;
  a {
    border-bottom: 1px solid var(--black);
  }
}

/* 資格の有無 + 資格の種類：同一枠内にまとめる */
.form_item:has(.qualification) {
  border-bottom: none;
  padding-bottom: 0;
}

.form_item:has(.qualification_type) {
  border-top: none;
  margin-top: 0;
  padding-top: 32px;
}

.form_item:has(.qualification_type) .head_box {
  justify-content: flex-start;
}

.form_item:has(.qualification_type) .must {
  display: none;
}

/* 住所：1見出し「住所」＋郵便番号 / 都道府県 / 以下住所の横並び */
.form_item:has(.zip) {
  border-bottom: none;
  padding-bottom: 0;
}

.form_item:has(.zip) .head {
  font-size: 0;
  line-height: 0;
}

.form_item:has(.zip) .head::before {
  content: "住所";
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.form_item:has(.zip) .element_box {
  margin-top: 0;
}

.form_item:has(.zip) .input_wrap {
  display: flex;
  align-items: center;
  gap: 32px;
}

.form_item:has(.zip) .input_wrap::before {
  content: "郵便番号";
  flex-shrink: 0;
  width: 5.5em;
  font-weight: 500;
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
}

.form_item:has(.zip) .postal_code_wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.form_item:has(.zip) .postal_code_wrapper::before {
  content: "〒";
  flex-shrink: 0;
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
}

.form_item:has(.zip) .input_item {
  width: 185px;
  max-width: 100%;
  flex-shrink: 0;
}

.form_item:has(.zip) .postal-search {
  flex-shrink: 0;
  width: 86px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background-color: #c9c9c9;
  color: #1d2162;
  font-size: 0;
  line-height: 1;
  white-space: nowrap;
  margin-left: 24px;
}

.form_item:has(.zip) .postal-search::after {
  content: "住所検索";
  font-size: 14px;
  font-weight: 400;
}

.form_item:has(.prefecture),
.form_item:has(.address) {
  flex-direction: row;
  align-items: center;
  gap: 32px;
  margin-top: 0;
  padding-top: 24px;
  padding-bottom: 0;
  border-top: none;
  border-bottom: none;
}

.form_item:has(.address) {
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border_color2);
}

.form_item:has(.prefecture) .head_box,
.form_item:has(.address) .head_box {
  flex-shrink: 0;
  width: 5.5em;
  justify-content: flex-start;
}

.form_item:has(.prefecture) .head,
.form_item:has(.address) .head {
  font-weight: 500;
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
}

.form_item:has(.prefecture) .head_box p.must,
.form_item:has(.address) .head_box p.must {
  display: none;
}

.form_item:has(.prefecture) .element_box,
.form_item:has(.address) .element_box {
  flex: 1;
  min-width: 0;
}

.form_item:has(.prefecture) .input_item {
  width: 332px;
  max-width: 100%;
}

.form_item:has(.address) .input_item {
  width: 100%;
}

/* メールアドレス + 確認用：同一枠・2段入力 */
.form_item:has(.your_mail) {
  border-bottom: none;
  padding-bottom: 0;
}

.form_item:has(.mail_confirm) {
  margin-top: 0;
  padding-top: 24px;
  border-top: none;
}

.form_item:has(.mail_confirm) .head_box {
  display: none;
}

/* 郵便番号 */
.postal_code_wrapper {
  display: flex;
  align-items: center;
  gap: 27px;
}
/* .postal_code {
  padding: 20px 12px;
  background-color: #F4F4F4;
  font-size: 16px;
  width: 100%;
} */
.postal-search {
  appearance: none;
  background-color: #ffffff;
  border: 1px solid var(--site_letter_base);
  padding: 10px 12px;
  color: var(--site_letter_base);
  cursor: pointer;
  transition: 0.3s;
}
.postal-search:hover {
  background-color: #5A5A5A;
  border-color: #5A5A5A;
  color: #ffffff;
}

/* ２列配置 */
.form_item:not(.address):has(.cols) {
  flex-direction: row;
  align-items: center;
  margin-top: 16px;
}

.form_item:not(.address):has(.cols) .head {
  font-weight: 400;
}

.form_item:not(.address):has(.cols) .element_box {
  flex: 1;
}

.input_item.short {
  width: 62%;
}

.form_item:not(.address):has(.cols) .must {
  display: none;
}

/* ====================================================================================================== */
/* レスポンシブ */
/* ====================================================================================================== */
@media screen and (max-width: 1024px) {
  .privacy_box {
    margin-top: 0;
  }
}

@media screen and (max-width: 768px) {
  .form_item {
    flex-direction: column;
  }

  .form_item:first-child .head_box {
    border-top: unset;
  }

  .form_item:first-child .element_box {
    border-top: unset;
  }

  .form_item:has(.mail_confirm) {
    margin-top: 0;
    padding-top: 16px;
  }

  .element_box {
    width: 100%;
  }

  .input_item.text, .input_item.postal_code {
    padding: 12px;
  }

  .form_item:has(.zip) .input_wrap {
    flex-wrap: wrap;
    gap: 12px 16px;
  }

  .form_item:has(.zip) .input_wrap::before {
    width: 100%;
  }

  .form_item:has(.zip) .postal_code_wrapper {
    flex-wrap: wrap;
    width: 100%;
  }

  .form_item:has(.zip) .input_item {
    width: calc(100% - 2em - 8px);
    flex: 1;
  }

  .form_item:has(.prefecture),
  .form_item:has(.address) {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .form_item:has(.prefecture) .head_box,
  .form_item:has(.address) .head_box {
    width: auto;
  }

  .form_item:has(.prefecture) .input_item {
    width: 100%;
  }

  select.input_item,
  .contact_form_input,
  .contact_form_input select {
    max-width: none;
    width: 100%;
  }
}

@media screen and (max-width: 480px) {
  form {
    padding-top: 0;
  }

  .radio_wrapper {
    padding: 0;
    gap: 8px;
  }

  .must {
    font-size: 12px;
  }

  .radio_label {
    font-size: 14px;
  }

  .privacy_box {
    margin-top: 0;
    height: 160px;
  }

  .agree_wrap {
    align-items: flex-start;
  }

  .form_agree {
    margin-top: 7px;
  }
  
  .submit_btn {
    margin-top: 40px;
    font-size: 16px;
  }

  .postal_code_wrapper {
    gap: 16px;
  }

  .postal-search {
    padding: 6px 10px;
  }

  .input_item.postal_code {
    flex: 1;
  }

  /* .form_item:not(.address):has(.cols) {
    flex-direction: column;
    align-items: flex-start;
  } */

  .input_item.short {
    width: 100%;
  }
}
