/* Sizes of the form */
.inquiry-form .hubspot-form {
  --hubspot-form-min-height: 753px;
  --hubspot-form-column-gap: 10px;
}

/* The 必須 badge of 会社名 wraps to a second line. */
@media (width <= 480px) {
  .inquiry-form .hubspot-form {
    --hubspot-form-min-height: 781px;
  }
}

/* A field is a label over its input. */
.inquiry-form .hubspot-form .hs-form .hs-form-field {
  padding-bottom: 24px;
  color: #2d2d2d;
  font-size: 14px;
}

.inquiry-form .hubspot-form .hs-form .hs-form-field > label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

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

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

.inquiry-form .hubspot-form .hs-form .hs-input:not([type='checkbox'], [type='radio']) {
  padding: 11px 12px;
  border: 1px solid #dfdfdf;
  border-radius: 8px;
  color: #2d2d2d;
  font-size: 14px;
  line-height: normal;
}

.inquiry-form .hubspot-form .hs-form .hs-input::placeholder {
  color: #757575;
}

.inquiry-form .hubspot-form .hs-form textarea.hs-input {
  height: 104px;
  resize: none;
}

.inquiry-form .hubspot-form .hs-form .hs-input.error:not([type='checkbox'], [type='radio']) {
  border-color: #f00 !important;
}

/* The error message takes the space under the field, so a message of one line
   does not move the fields below. */
.inquiry-form .hubspot-form .hs-form .hs-form-field:has(> .hs-error-msgs) {
  padding-bottom: 7px;
}

.inquiry-form .hubspot-form .hs-form .hs-error-msgs {
  margin-top: 3px;
  color: #d34931;
  font-size: 12px;
  line-height: 14px;
}

.inquiry-form .hubspot-form .hs-form .hs-error-msgs label {
  display: block;
  margin: 0 0 3px;
  color: inherit;
}

/* Checkbox list in a row. */
.inquiry-form .hubspot-form .hs-form .hs-fieldtype-checkbox .inputs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.inquiry-form .hubspot-form .hs-form .inputs-list label {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

/* The box of a checkbox, drawn here instead of the one of the browser. */
.inquiry-form .hubspot-form .hs-form .inputs-list input {
  position: relative;
  width: 16px;
  height: 16px;
  border: 1px solid #cad8de;
  background: #fff no-repeat center / 10px 10px;
  appearance: none;
}

.inquiry-form .hubspot-form .hs-form .inputs-list input[type='checkbox'] {
  border-radius: 4px;
}

.inquiry-form .hubspot-form .hs-form .inputs-list input::before,
.inquiry-form .hubspot-form .hs-form .inputs-list input::after {
  content: none;
}

.inquiry-form .hubspot-form .hs-form .inputs-list input[type='checkbox']:checked {
  border-color: #e94200;
  background-color: #e94200;
  background-image: url('../images/form/check.svg');
}

/* The notice about reCAPTCHA under the button. */
.inquiry-form .branding {
  margin-top: 16px;
  color: #616161;
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.inquiry-form .branding a {
  color: inherit;
  text-decoration: underline;
}

/* Consent checkbox: centred, with the links underlined. */
.inquiry-form .hubspot-form .hs-form .hs-fieldtype-booleancheckbox .inputs-list label {
  justify-content: center;
  font-weight: 700;
}

.inquiry-form .hubspot-form .hs-form .hs-fieldtype-booleancheckbox .hs-error-msgs {
  text-align: center;
}

.inquiry-form .hubspot-form .hs-form .hs-fieldtype-booleancheckbox a {
  color: #2d2d2d;
  text-decoration: underline;
}

/* Submit button */
.inquiry-form .hubspot-form .hs-form .hs-button {
  width: 100%;
  padding: 16px;
  border: 0;
  border-radius: 8px;
  background-image: linear-gradient(90deg, #ff2a29 0%, #ff4d00 36.5%, #ff5c00 72.5%, #ff6b00 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: normal;
  transition: opacity 0.3s;
}

.inquiry-form .hubspot-form .hs-form .hs-button:hover {
  opacity: 0.8;
}

/* The 任意 badge after the label of a field that is not required. */
.inquiry-form .hubspot-form .hs-form .hs-form-field > label:not(:has(.hs-form-required))::after {
  content: '任意';
  flex-shrink: 0;
  padding: 1px 8px;
  border-radius: 2px;
  background: #f6f6f6;
  color: #2d2d2d;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
}

/* The help text comes before the input in the markup. It is shown on the
   label line, between the label text and the 必須 badge: the label stops
   being a box, so its two spans and the help text are ordered as items of the
   field. The label still works as the label of the input. */
.inquiry-form .hubspot-form .hs-form .hs-form-field:has(> .hs-field-desc) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 8px;
}

.inquiry-form .hubspot-form .hs-form .hs-form-field:has(> .hs-field-desc) > label {
  display: contents;
}

.inquiry-form .hubspot-form .hs-form .hs-form-field:has(> .hs-field-desc) > label > span {
  margin-bottom: 8px;
}

.inquiry-form .hubspot-form .hs-form .hs-form-field:has(> .hs-field-desc) > .hs-field-desc {
  order: 1;
  margin: 0 0 8px;
  color: #616161;
  font-size: 12px;
  line-height: 20px;
}

.inquiry-form .hubspot-form .hs-form .hs-form-field:has(> .hs-field-desc) > label > .hs-form-required {
  order: 2;
}

.inquiry-form .hubspot-form .hs-form .hs-form-field:has(> .hs-field-desc) > .input,
.inquiry-form .hubspot-form .hs-form .hs-form-field:has(> .hs-field-desc) > .hs-error-msgs {
  order: 3;
  flex: 0 0 100%;
}
