form {
  max-width: 1000px;
  margin: auto;
  /* padding: 50px 80px; */
  padding: 50px 35px;
}

@media screen and (max-width: 1024px) {
  form {
    padding: 50px 40px;
  }
}

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

.form_group {
  margin-bottom: 55px;
}

.form_item {
  display: flex;
  align-items: center;
}

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

.form_item:nth-child(odd)  {
  width: calc(380 / (1000 - 80 * 2) * 100%);
}

.form_item:nth-child(even) {
  width: calc(430 / (1000 - 80 * 2) * 100%);
}

.form_lead {
  margin-left: 100px;
  margin-bottom: 20px;
  gap: 7px;
}

@media screen and (max-width: 480px) {
  .form_lead {
    margin-left: 0;
  }
}

.form_lead .strong {
  font-weight: bold;
  background-color: #F60A0A;
  padding: 5px;
}

/* head_box */
.form_item:first-child .head_box {
  border-top: 1px solid var(--site_color1);
}

.form_item .head_box {
  flex: 0 0 28%;
  margin-right: 2%;
  /* width: 100px; */
  border-bottom: 1px solid var(--site_color1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  /* text-align: center; */
}

@media screen and (max-width: 480px) {
  .form_item .head_box {
    width: 100%;
    justify-content: flex-start;
    margin-bottom: 10px;
  }
}

.form_item .element_box {
  flex: 1;
}

/* 必須 */
.form_item .head_box p.must {
  padding: 6px 10px;
  background-color: var(--site_color1);
  border-radius: 10px;
  margin-left: 15px;
  white-space: nowrap;
  font-size: calc(12px + 2 * (100vw - 320px) / 1046);
  color: #ffffff;
}

/* エラー文 */
.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;
}

.total_price_label {
  display: block;
  margin-right: 20px;
}

.total_price_border {
  position: relative;
  z-index: 0;
}

.total_price_border::before {
  content: '';
  display: block;
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 100%;
  height: 21px;
  background-color: var(--yellow);
  z-index: -1;
}

.form_footer_txt_top {
  margin-bottom: 36px;
  text-align: center;
  line-height: 1.7;
  font-weight: 500;
}

.form_footer_txt {
  margin-top: 36px;
  text-align: center;
  line-height: 1.7;
}

/* submitボタン */
.submit_btn {
  width: 340px;
  padding: 1.464128843vw;
  background-color: var(--site_color1);
  text-align: center;
  display: block;
  border-radius: 5px;
  margin-left: auto;
  margin-right: auto;
  cursor: pointer;
  transition: all 0.5s;
  color: #ffffff;
}
@media screen and (max-width: 768px) {
  .submit_btn {
    margin-top: 60px;
    padding: 12px;
  }
}

.submit_btn:hover {
  opacity: 0.7;
}

/* テキストボックス用スタイル */
.input_item.text, .input_item.select, .input_item.number {
  width: 100%;
  padding: 7px 13px;
}

.contact_form_input:has(.select) {
  position: relative;
  z-index: 0;
}

.contact_form_input:has(.select)::after {
  content: '';
  display: block;
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%) rotate(45deg);
  width: 6px;
  height: 6px;
  border-bottom: 2px solid var(--white);
  border-right: 2px solid var(--white);
  z-index: 1;
}

.input_item.text.bg_main_color, .input_item.select.bg_main_color, .input_item.number.bg_main_color {
  background-color: var(--main_color);
  color: #ffffff;
}

.input_item.text.bg_gray, .input_item.select.bg_gray, .input_item.number.bg_gray{
  /* background-color: #cccccc; */
  background-color: #EEEEEE;
  color: #000;
  box-shadow: inset 0px 0px 5px rgba(0, 0, 0, 0.2);
}

.input_item.text.bg_gray::placeholder, .input_item.select.bg_gray::placeholder, .input_item.number.bg_gray::placeholder  {
  color: rgba(0, 0, 0, 0.5);
}

.input_item.half {
  width: 48%;
}
/* テキストエリア用スタイル */
.input_item.textarea {
  width: 100%;
  padding: 15px;
  background-color: #ecedf2;
  border-radius: 5px;
  height: 20vw;
  max-height: 270px;
  min-height: 160px;
}

.tax_in {
  padding-left: 2rem;
}

/* ====================================================================================================== */
/* レスポンシブ */
/* ====================================================================================================== */
@media screen and (max-width: 1024px) {
  form {
    padding-top: 60px;
    padding-bottom: 80px;
  }
}

@media screen and (max-width: 768px) {

  .head_box {
    width: 100%;
  }

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

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

  .element_box {
    width: 100%;
  }

  .input_item.text, .input_item.select, .input_item.number {
    padding: 12px;
  }

  .form_footer_wrapper {
    flex-direction: column;
    align-items: center;
  }

  .submit_btn {
    margin: 0 auto;
    margin-top: 40px;
  }

  .total_price {
    margin-bottom: 10px;
    text-align: center;
  }

  .tax_in {
    padding-left: 1rem;
  }

  .total_price_border::before {
    height: 10px;
    bottom: 0px;
  }
}

@media screen and (max-width: 480px) {
  .submit_btn {
    width: 80%;
  }

  .head_box .head br {
    display: none;
  }

  .total_price_border {
    width: fit-content;
  }
}


/* 2025/04/21追記 */
.form_group.first .form_item:nth-child(7) .element_box p.errors {
  text-align: center;
}
.form_group.first .form_item:nth-child(n+7)  {
  position: relative;
  width: 31.5%;
}
.form_group.first .form_item:nth-child(n+7) .element_box p.errors {
  position: absolute;
  width: 100%;
  top: 100%;
  left: 0;
  font-size: 13px;
}
.form_group.first .form_item:nth-child(n+7) .head_box {
  flex: 0 0 41%;
}
.form_group.first .form_item:nth-child(8) .head_box {
  flex: 0 0 44%;
}
.form_group.first .form_item:nth-child(n+7) .element_box {
  flex: 0 0 115px;
}
.form_group.second {
  flex: 0 0 50%;
}
.form_group.second .form_item {
  width: 100%;
}
.form_group.second .form_item .element_box {
  flex: 0 0 63%;
}
.form_group.second .form_item .head_box {
  margin-right: 2%;
  flex: 0 0 25%;
  justify-content: flex-end;
}
.form_group.second .form_item:last-child .element_box {
  flex: 0 0 45%;
}
.form_footer_wrapper .submit_btn_wrapper_txt {
  margin-top: 45px;
  text-align: center;
  line-height: 1.7;
}
.form_footer_wrapper .total_price {
  display: flex;
  align-items: center;
}

.form_flex {
  display: flex;
  align-items: center;
}
.form_footer_wrapper {
  flex: auto;
}

@media (max-width: 768px) {
  .form_group.second .form_item .head_box {
    flex: 0 0 20%;
  }
  .form_group.second .form_item .element_box {
    flex: auto;
  }
  .form_group.first .form_item:nth-child(n+7) {
    width: calc(380 / (1000 - 80 * 2) * 100%);
  }
  .form_group.first .form_item:nth-child(8) {
    width: calc(430 / (1000 - 80 * 2) * 100%);
  }
  .form_group.first .form_item:nth-child(n+7) .head_box {
    flex: initial;
  }
  .form_group.first .form_item:nth-child(n+7) .element_box {
    flex: 1;
  }
  .form_group.second .form_item:last-child .element_box {
    flex: 0 0 50%;
  }
  .form_footer_wrapper .submit_btn_wrapper_txt {
    margin-right: 0;
  }
  .form_footer_wrapper .total_price {
    margin-top: 20px;
  }
  .form_flex {
    display: block;
  }
  .form_footer_wrapper .total_price {
    margin: 0px 0 60px;
    justify-content: center;
  }
    .form_footer_txt_top {
    margin-top : 40px;
  }
}
@media (max-width: 480px) {
  .form_lead .strong {
    font-size: 12px;
  }
  .form_group.second .form_item .head_box {
    justify-content: flex-start;
  }
  .form_footer_wrapper .submit_btn_wrapper_txt {
    text-align: center;
  }
  .form_footer_wrapper .submit_btn_wrapper_txt .off768 {
    display: block;
  }
  .form_group.first .form_item:nth-child(7) {
    width: 100%;
  }
  .form_group.first .form_item:nth-child(8) {
    width: calc(380 / (1000 - 80 * 2) * 100%);
  }
  .form_group.first .form_item:nth-child(9) {
    width: calc(430 / (1000 - 80 * 2) * 100%);
  }
  .form_group.first {
    margin-bottom: 30px;
  }
  .form_group.first .form_item:nth-child(n+7) .element_box p.errors {
    font-size: 12px;
  }

  .floating {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 10;
  }
  .floating .wrapper {
    display: flex;
  }
  .floating .wrapper a {
    display: block;
    flex: 0 0 50%;
    font-weight: bold;
    text-align: center;
    padding: 10px 0;
    color: #ffffff;
  }
  .floating .wrapper a:first-child {
    background-color: #028502;
  }
  .floating .wrapper a:last-child {
    background-color: #ff851c;
  }
  body {
    padding-bottom: 43px;
  }
  .form_footer_wrapper .total_price {
    margin-bottom: 70px;
  }
  .form_group.first .form_item:nth-child(n+7) .element_box p.errors {
    position: initial;
  }
  .form_footer_wrapper .submit_btn_wrapper_txt {
    margin-top: -40px;
    margin-bottom: 35px;
  }
}