/*
 * Base styles of the embedded HubSpot forms (.hubspot-form).
 *
 * Takes away the site-wide rules of normalize.css and style.css that the
 * form markup matches, and gives every input the same plain start. The
 * layout and the colours are set by the CSS of each page.
 *
 * style.css has `.error { border: 1px solid #f00 !important }`, which matches
 * an input with an error, so a rule for another error border needs
 * !important too.
 */

.hubspot-form {
  /* Height kept free while the form loads, so the content below does not
     move. */
  --hubspot-form-min-height: 0;

  /* Space between the fields of a row, such as 姓 and 名. */
  --hubspot-form-column-gap: 20px;

  min-height: var(--hubspot-form-min-height);
}

/* A fieldset is a row of fields. normalize.css gives it a border. */
.hubspot-form .hs-form fieldset {
  display: flex;
  gap: var(--hubspot-form-column-gap);
  margin: 0;
  padding: 0;
  border: 0;
}

.hubspot-form .hs-form .hs-form-field {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
}

/* style.css makes every label a white 20px inline block with an empty ::after
   (`label`, `label + label`, `label > span`), so the labels cannot be seen. */
.hubspot-form .hs-form label {
  display: block;
  margin: 0;
  color: inherit;
  font-size: inherit;
}

.hubspot-form .hs-form label::after {
  content: none;
}

.hubspot-form .hs-form label > span {
  display: inline;
  overflow: visible;
}

/* style.css styles `input[type="text"]` and textarea only (with a smaller
   font on mobile), so an email or tel input would get the border and font of
   the browser. Every input starts from the same plain box. */
.hubspot-form .hs-form .hs-input:not([type='checkbox'], [type='radio']) {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 10px 15px;
  border: 1px solid #ccc;
  border-radius: 0;
  background-color: #fff;
  box-shadow: none;
  color: #000;
  font-family: inherit;
  font-size: inherit;
  appearance: none;
}

.hubspot-form .hs-form textarea.hs-input {
  resize: vertical;
}

/* Checkbox and radio lists, and the consent checkbox. */
.hubspot-form .hs-form .inputs-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* style.css draws the checkbox and the radio button (a 20px box with a check)
   and floats them in their label, which does not fit `<label><input><span>`.
   Keep the box, without the float. */
.hubspot-form .hs-form .inputs-list label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hubspot-form .hs-form .inputs-list input {
  float: none;
  flex-shrink: 0;
  margin: 0;
}

/* No required mark (*) after the consent text. */
.hubspot-form .hs-form .hs-form-booleancheckbox-display .hs-form-required {
  display: none;
}

/* The list of messages under a field. */
.hubspot-form .hs-form .hs-error-msgs {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The summary of the errors under the form. Each field shows its own
   message instead. */
.hubspot-form .hs-form .hs_error_rollup {
  display: none;
}

/* The reCAPTCHA badge. The notice under the form says the same as text. */
.hubspot-form .hs-form .hs_recaptcha {
  position: absolute;
  margin: 0;
  padding: 0;
  visibility: hidden;
}

/* The button is an <input>, which does not inherit the font of the page by
   default. */
.hubspot-form .hs-form .hs-button {
  font-family: inherit;
  line-height: inherit;
  white-space: normal;
  cursor: pointer;
  appearance: none;
}
