/* Sizes of the form */
#inquiry .form-inquiry__form .hubspot-form {
  --hubspot-form-min-height: 430px;
  --hubspot-form-column-gap: 8px;
}

@media (width <= 767px) {
  #inquiry .form-inquiry__form .hubspot-form {
    --hubspot-form-min-height: 464px;
    --hubspot-form-column-gap: 16px;
  }
}

/* The form is as wide as the card, up to 640px. */
#inquiry .form-inquiry__form {
  max-width: 640px;
  margin: 0 auto;
}

/* style.min.css draws every form in .form-inquiry as a white card. */
#inquiry .inquiry-wrapper .form-inquiry .form-inquiry__form .hs-form {
  max-width: none;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: none;
}

#inquiry .form-inquiry__form .branding {
  margin: 30px 0 0;
  color: #303030;
  font-size: 10px;
  text-align: center;
}

#inquiry .form-inquiry__form .branding a {
  color: #303030;
  text-decoration: underline;
}

/* ご相談事項 (message). The form is shared with /a-flow/, the only page whose
   old form had it, so it is hidden here to keep the old look. It is hidden
   only while it is optional: if it becomes required in HubSpot, it shows up
   again, so the form can still be sent. */
#inquiry .form-inquiry__form .hs-form fieldset:has(.hs_message):not(:has(.hs-form-required)) {
  display: none;
}

/* A field is a row: the label on the left, the input on the right. */
#inquiry .form-inquiry__form .hubspot-form .hs-form .hs-form-field {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  padding-bottom: 26px;
  font-size: 13px;
}

#inquiry .form-inquiry__form .hubspot-form .hs-form .hs-form-field:has(> .hs-error-msgs) {
  padding-bottom: 12px;
}

#inquiry .form-inquiry__form .hubspot-form .hs-form .hs-form-field > label {
  display: flex;
  flex: 0 0 110px;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  height: auto;
  min-height: 40px;
  color: #303030;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

/* 姓 and 名 share the space after their labels equally. */
#inquiry .form-inquiry__form .hubspot-form .hs-form .form-columns-2 .hs-form-field {
  flex: 1 1 110px;
}

#inquiry .form-inquiry__form .hubspot-form .hs-form .form-columns-2 .hs-form-field + .hs-form-field {
  flex-basis: 65px;
}

#inquiry .form-inquiry__form .hubspot-form .hs-form .form-columns-2 .hs-form-field + .hs-form-field > label {
  flex-basis: 65px;
}

#inquiry .form-inquiry__form .hubspot-form .hs-form .hs-form-field > .input {
  flex: 1 1 0;
  min-width: 0;
}

/* The help text comes before the input in the markup, but is shown under it. */
#inquiry .form-inquiry__form .hubspot-form .hs-form .hs-form-field > .hs-field-desc {
  order: 1;
  flex: 0 0 100%;
  margin: 2px 0 0;
  padding: 0 0 0 118px;
  color: #303030;
  font-size: 12px;
  line-height: 1.63;
}

/* The 必須 badge in place of the required mark (*). */
#inquiry .form-inquiry__form .hubspot-form .hs-form .hs-form-field > label .hs-form-required {
  flex-shrink: 0;
  padding: 6px 5px;
  border-radius: 8px;
  background: #2d6fe6;
  color: #fff;
  font-size: 0;
  white-space: nowrap;
}

#inquiry .form-inquiry__form .hubspot-form .hs-form .hs-form-field > label .hs-form-required::before {
  content: '必須';
  font-size: 12px;
  font-weight: 700;
}

#inquiry .form-inquiry__form .hubspot-form .hs-form .hs-input:not([type='checkbox'], [type='radio']) {
  height: 40px;
  padding: 5px 10px;
  border: 0;
  border-radius: 10px;
  background: #dfe9f2;
  font-size: 13px;
  outline: none;
  transition: 0.2s;
}

#inquiry .form-inquiry__form .hubspot-form .hs-form .hs-input:not([type='checkbox'], [type='radio']):hover {
  background: #e5f6ff;
}

#inquiry .form-inquiry__form .hubspot-form .hs-form .hs-input::placeholder {
  color: #99a9b0;
}

/* The error message comes after the input and the help text. The padding
   under the field is shortened by its height, so the layout does not move. */
#inquiry .form-inquiry__form .hubspot-form .hs-form .hs-error-msgs {
  order: 2;
  flex: 0 0 100%;
  padding: 2px 0 0 118px;
  color: #f95154;
  font-size: 10px;
  font-weight: 700;
  line-height: 12px;
}

#inquiry .form-inquiry__form .hubspot-form .hs-form .hs-fieldtype-booleancheckbox .hs-error-msgs {
  display: flex;
  padding-left: 0;
  justify-content: center;
}

#inquiry .form-inquiry__form .hubspot-form .hs-form .form-columns-2 .hs-form-field + .hs-form-field .hs-error-msgs {
  padding-left: 73px;
}

/* Consent checkbox */
#inquiry .form-inquiry__form .hubspot-form .hs-form .hs-fieldtype-booleancheckbox {
  padding-bottom: 16px;
}

#inquiry .form-inquiry__form .hubspot-form .hs-form .hs-fieldtype-booleancheckbox > .input {
  flex: 1 1 100%;
}

#inquiry .form-inquiry__form .hubspot-form .hs-form .hs-fieldtype-booleancheckbox:has(> .hs-error-msgs) {
  padding-bottom: 2px;
}

/* As high as the line of the old consent label, which has the space above the
   button. */
#inquiry .form-inquiry__form .hubspot-form .hs-form .hs-form-booleancheckbox-display {
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 25px;
  color: #2d6fe6;
  font-size: 14px;
  font-weight: 700;
}

#inquiry .form-inquiry__form .hubspot-form .hs-form .hs-form-booleancheckbox-display input {
  width: 20px;
  height: 20px;
  margin: 0 10px 0 0;
  border: 1px solid #99a9b0;
  border-radius: 2px;
  cursor: pointer;
}

#inquiry .form-inquiry__form .hubspot-form .hs-form .hs-form-booleancheckbox-display a {
  margin-right: 10px;
  color: #2d6fe6;
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  transition: 0.4s;
}

#inquiry .form-inquiry__form .hubspot-form .hs-form .hs-form-booleancheckbox-display a:hover {
  opacity: 0.6;
}

/* Submit button. It is an <input>, which has no content, so its icon is
   drawn on the element around it, left of the text. The padding on the left
   of the input keeps the space for the icon (28px) and the gap after it
   (8px), so the icon and the text are centred together.
   --button-text-width is the width of the text (8 characters), so it changes
   with the text. */
#inquiry .form-inquiry__form .hubspot-form .hs-form .hs_submit {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

#inquiry .form-inquiry__form .hubspot-form .hs-form .hs_submit .actions {
  --button-text-width: 192px;

  position: relative;
}

#inquiry .form-inquiry__form .hubspot-form .hs-form .hs_submit .actions::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 54px;
  width: 28px;
  height: 28px;
  margin-top: -14px;

  /* Font Awesome Free v7.1.0 circle-arrow-right, https://fontawesome.com/license/free */
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 640'%3E%3Cpath fill='%23303030' d='M320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576zM361 417C351.6 426.4 336.4 426.4 327.1 417C317.8 407.6 317.7 392.4 327.1 383.1L366.1 344.1L216 344.1C202.7 344.1 192 333.4 192 320.1C192 306.8 202.7 296.1 216 296.1L366.1 296.1L327.1 257.1C317.7 247.7 317.7 232.5 327.1 223.2C336.5 213.9 351.7 213.8 361 223.2L441 303.2C450.4 312.6 450.4 327.8 441 337.1L361 417.1z'/%3E%3C/svg%3E")
    no-repeat center / contain;
  pointer-events: none;
}

#inquiry .form-inquiry__form .hubspot-form .hs-form .hs-button {
  height: 68px;
  padding: 0 54px 0 90px;
  border: 0;
  border-radius: 32px;
  background: #ffcd55;
  color: #303030;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  transition: 0.4s;
}

#inquiry .form-inquiry__form .hubspot-form .hs-form .hs-button:hover {
  background: #ffc400;
}

@media (width <= 767px) {
  #inquiry .form-inquiry__form {
    padding: 0 12px;
  }

  /* Labels above the inputs, with the 必須 badge at the right end. */
  #inquiry .form-inquiry__form .hubspot-form .hs-form .hs-form-field,
  #inquiry .form-inquiry__form .hubspot-form .hs-form .form-columns-2 .hs-form-field,
  #inquiry .form-inquiry__form .hubspot-form .hs-form .form-columns-2 .hs-form-field + .hs-form-field {
    flex: 1 1 0;
    flex-flow: column nowrap;
    gap: 2px;
    padding-bottom: 18px;
  }

  #inquiry .form-inquiry__form .hubspot-form .hs-form .hs-form-field > label,
  #inquiry .form-inquiry__form .hubspot-form .hs-form .form-columns-2 .hs-form-field + .hs-form-field > label {
    flex: none;
    justify-content: space-between;
    min-height: 0;
    text-align: left;
  }

  /* Line breaks in labels (メール / アドレス) are for wide screens only. */
  #inquiry .form-inquiry__form .hubspot-form .hs-form .hs-form-field > label br {
    display: none;
  }

  #inquiry .form-inquiry__form .hubspot-form .hs-form .hs-form-field > .input {
    flex: none;
  }

  #inquiry .form-inquiry__form .hubspot-form .hs-form .hs-form-field > .hs-field-desc {
    flex: none;
    margin-top: 0;
    padding-left: 0;
    font-size: 8px;
  }

  #inquiry .form-inquiry__form .hubspot-form .hs-form .hs-input:not([type='checkbox'], [type='radio']) {
    height: 32px;
    border-radius: 8px;
  }

  #inquiry .form-inquiry__form .hubspot-form .hs-form .hs-error-msgs,
  #inquiry .form-inquiry__form .hubspot-form .hs-form .form-columns-2 .hs-form-field + .hs-form-field .hs-error-msgs {
    flex: none;
    padding-left: 0;
  }

  #inquiry .form-inquiry__form .hubspot-form .hs-form .hs-fieldtype-booleancheckbox {
    padding-bottom: 0;
  }

  #inquiry .form-inquiry__form .hubspot-form .hs-form .hs-form-booleancheckbox-display {
    min-height: 23px;
  }

  #inquiry .form-inquiry__form .hubspot-form .hs-form .hs_submit {
    margin-top: 32px;
  }

  #inquiry .form-inquiry__form .hubspot-form .hs-form .hs_submit .actions::before {
    left: 45px;
  }

  #inquiry .form-inquiry__form .hubspot-form .hs-form .hs-button {
    height: 64px;
    padding: 0 45px 0 81px;
    font-size: 20px;
  }
}
