form {
  padding-top: 80px;
}

input::placeholder, textarea::placeholder {
  color: #A8A8A8;
}

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

.form_item:last-child, .form_item:has(.input_item.bb) {
  border-bottom: 1px solid var(--border_color);
}

/* head_box */

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

.form_item .head {
  color: var(--color3);
  font-size: 18px;
}

/* 必須 */
.form_item .head_box p.must {
  margin-left: 15px;
  white-space: nowrap;
  color: var(--white);
  background-color: #F52424;
  border-radius: 100px;
  padding: 2px 5px;
}

/* エラー文 */
.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;
  gap: 72px;
  position: relative;
  width: fit-content;
}

.double_text_input_wrapper::before {
  content: "〜";
  display: block;
  font-weight: bold;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* submitボタン */
.submit_btn {
  width: calc(380 / 880 * 100%);
  max-width: 380px;
  padding: 16px;
  background-color: var(--color2);
  border-radius: 100px;
  text-align: center;
  display: block;
  margin: auto;
  margin-top: 4.8%;
  cursor: pointer;
  transition: all 0.3s;
  color: #ffffff;
}
.submit_btn:hover {
  opacity: 0.8;
}
@media screen and (max-width: 768px) {
  .submit_btn {
    margin-top: 60px;
    padding: 12px;
  }
}

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

.input_wrap.half {
  max-width: 200px;
  position: relative;
}

.input_wrap.half::before {
  content: "";
  display: block;
  width: 19px;
  aspect-ratio: 1 / 1;
  background-image: url(../icon_date.svg);
  background-size: contain;
  background-repeat: no-repeat;
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  z-index: 1;
}

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

/* ラジオボタン */
.radio_wrapper {
  display: flex;
  gap: 4%;
  flex-wrap: wrap;
}
.radio_label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  border-radius: 100px;
  color: var(--letter_base);
  border: 1px solid var(--letter_base);
  padding: 20px 56px;
  transition: .3s;
  margin-top: 18px;
}

.input_item.radio {
  width: 16px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 1px solid var(--letter_base);
  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: var(--letter_base);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.radio_label:has(.input_item.radio:checked) {
  background-color: var(--color3);
  color: var(--white);
}

.input_item.radio:checked {
  border-color: var(--white);
}

.input_item.radio:checked::before {
  opacity: 1;
  visibility: visible;
  background-color: var(--white);
}

/* プライバシーポリシーの同意 */
.privacy_box {
  border: 1px solid var(--border_color);
  height: 200px;
  overflow-y: scroll;
  padding: 16px 24px;
  margin-bottom: 40px;
  margin-top: 8%;  
  background-color: #ffffff;
}

.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 #222222;
  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(.your_mail) {
  padding-bottom: 0;
  border-bottom: none;
}

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

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

/* 郵便番号 */
.postal_code_wrapper {
  display: flex;
  align-items: center;
  gap: 29px;
  max-width: 332px;
}
.postal_box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}
.postal_mark {
  font-weight: 700;
  flex: none;
}
.postal_code {
  padding: 20px 12px;
  background-color: var(--white);
  font-size: 16px;
  width: 100%;
  border-radius: 4px;
}
.postal-search {
  appearance: none;
  background-color: var(--border_color);
  border-radius: 4px;
  border: none;
  padding: 8px 16px;
  color: var(--color3);
  cursor: pointer;
  transition: 0.3s;
  font-size: 14px;
}
.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;
  gap: 80px;
  border-top: none;
  padding: 8px;
  margin-top: 0;
}

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

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

.input_item.short {
  max-width: 332px;
}

/* 往路・復路 */
.route_wrapper {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 28px;
}

.route_time_wrapper,
.route_place_wrapper {
  display: flex;
  align-items: center;
  gap: 34px;
}

.route_head {
  width: 120px;
  flex: none;
  font-size: 18px;
  font-weight: 500;
}

.route_time_inputs,
.route_place_inputs {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.route_time_inputs .input_item.short {
  max-width: 80px;
  padding-left: 0;
  padding-right: 0;
  text-align: center;
}

.route_place_inputs .input_item.place {
  max-width: 240px;
}

.route_unit,
.route_separator,
.route_mark,
.route_arrow {
  flex: none;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.route_separator {
  margin: 0 8px;
}

.route_arrow {
  width: 38px;
  height: 14px;
  display: inline-block;
  background-image: url(../arrow_route.svg);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  font-size: 0;
  color: transparent;
  overflow: hidden;
  margin: 0 10px;
}

.form_item:has(.input_item.short_last) {
  padding-bottom: 32px;
}

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

.input_wrap:has(.input_item.age) {
  max-width: 200px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.input_wrap:has(.input_item.age)::after {
  content: "歳";
  flex: none;
}

.input_wrap:has(.input_item.number) {
  max-width: 200px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.input_wrap:has(.input_item.people)::after {
  content: "名";
  flex: none;
}

.input_wrap:has(.input_item.car)::after {
  content: "台";
  flex: none;
}

.form_item:has(.input_item.detail) {
  position: relative;
  margin-top: 100px;
}

.form_item:has(.input_item.customer) {
  position: relative;
  margin-top: 190px;
}

.form_item:has(.input_item.detail)::before, .form_item:has(.input_item.customer)::before {
  display: block;
  font-size: 24px;
  font-weight: 500;
  color: var(--white);
  background-color: var(--color2);
  padding: 12px 24px;
  position: absolute;
  bottom: calc(100% + 40px);
  left: 0;
  width: 100%;
  box-sizing: border-box;
}

.form_item:has(.input_item.detail)::before {
  content: "01　ご利用詳細のご入力";
}

.form_item:has(.input_item.customer)::before {
  content: "02　お客様情報のご入力";
}

.input_item.datepicker {
  max-width: 200px;
}

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

@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: 8px;
  }

  .element_box {
    width: 100%;
  }

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

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

  .form_item {
    padding: 16px 0;
  }

  .radio_wrapper {
    flex-direction: column;
    gap: 8px;
  }

  .must {
    font-size: 12px;
  }

  .radio_label {
    padding: 16px 24px;
    font-size: 14px;
    margin-top: 0;

  }

  .privacy_box {
    margin-top: 56px;
    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) {
    gap: 16px;
  }

  .form_item:not(.address):has(.cols) .head {
    font-size: 14px;
  }

  .input_item.short {
    width: 100%;
  }

  .route_wrapper {
    gap: 14px;
  }

  .route_time_wrapper,
  .route_place_wrapper {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .route_head {
    width: auto;
    font-size: 16px;
  }

  .route_time_inputs,
  .route_place_inputs {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .route_time_inputs .input_item.short {
    max-width: 40px;
    padding: 12px 0;
    font-size: 16px;
  }

  .route_place_inputs .input_item.place {
    width: calc(100% - 2em);
    max-width: none;
  }

  .route_unit,
  .route_separator,
  .route_mark {
    font-size: 16px;
  }

  .route_arrow {
    width: 28px;
    height: 12px;
    margin: 0 4px;
    display: none;
  }

  .form_item:has(.input_item.detail)::before, .form_item:has(.input_item.customer)::before {
    font-size: 20px;
  }

  .double_text_input_wrapper {
    gap: 40px;
  }

  .input_wrap.half:has(.input_item.datepicker)::before {
    display: none;
  }
}
