/* Sizes of the form */
.home-mv__form .hubspot-form {
  --hubspot-form-min-height: 363px;
  --hubspot-form-column-gap: 0;
}

@media (width <= 1199px) {
  .home-mv__form .hubspot-form {
    --hubspot-form-min-height: 505px;
    --hubspot-form-column-gap: 8px;
  }
}

/* The purple card around the heading, the form and the reCAPTCHA notice. */
.home-mv__form-card {
  margin: 0 auto;
  padding: 26px 15px;
  border-radius: 10px;
  background: #d6c4f7;
}

/* home.min.css draws every form in .home-mv__form as a card. */
.home-mv__form .hubspot-form .hs-form {
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: none;
}

/* A field is a row: the label on the left, the input on the right. */
.home-mv__form .hubspot-form .hs-form .hs-form-field {
  display: flex;
  flex-wrap: wrap;
  padding-bottom: 16px;
  font-size: 13px;
}

.home-mv__form .hubspot-form .hs-form .hs-form-field > label {
  display: flex;
  flex: 0 0 100px;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
  height: 40px;
  padding-right: 10px;
  color: #2d2d2d;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-align: right;
}

/* The error message takes the space under the input (or its help text), so
   a message of one line does not move the fields below. A longer one, such as
   under 姓 and 名, wraps and pushes them down. */
.home-mv__form .hubspot-form .hs-form .hs-form-field:has(> .hs-error-msgs) {
  padding-bottom: 0;
}

/* 姓 and 名 share the space after their labels equally. */
.home-mv__form .hubspot-form .hs-form .form-columns-2 .hs-form-field {
  flex: 1 1 100px;
}

.home-mv__form .hubspot-form .hs-form .form-columns-2 .hs-form-field + .hs-form-field {
  flex-basis: 65px;
}

.home-mv__form .hubspot-form .hs-form .form-columns-2 .hs-form-field + .hs-form-field > label {
  flex-basis: 65px;
}

.home-mv__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. */
.home-mv__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 100px;
  color: #2d2d2d;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.63;
}

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

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

.home-mv__form .hubspot-form .hs-form .hs-input:not([type='checkbox'], [type='radio']) {
  height: 40px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #dfe9f2;
  font-size: 13px;
  outline: none;
}

.home-mv__form .hubspot-form .hs-form .hs-input::placeholder {
  color: #92a1a8;
}

.home-mv__form .hubspot-form .hs-form .hs-input.error:not([type='checkbox'], [type='radio']) {
  border-color: #c24b3f !important;
  background: #ffe8e9;
}

.home-mv__form .hubspot-form .hs-form .hs-error-msgs {
  order: 2;
  flex: 0 0 100%;
  min-width: 0;
  margin-top: 2px;
  padding-left: 100px;
  color: #c24b3f;
  font-size: 10px;
  font-weight: 700;
  line-height: 14px;
}

.home-mv__form .hubspot-form .hs-form .hs-fieldtype-booleancheckbox .hs-error-msgs {
  padding-left: 0;
}

.home-mv__form .hubspot-form .hs-form .form-columns-2 .hs-form-field + .hs-form-field .hs-error-msgs {
  padding-left: 65px;
}

/* Consent checkbox */
.home-mv__form .hubspot-form .hs-form .hs-fieldtype-booleancheckbox {
  padding-bottom: 18px;
  padding-left: 100px;
}

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

/* The checkbox has no label beside it, so it takes the whole row, and its
   error message goes to the next row. */
.home-mv__form .hubspot-form .hs-form .hs-fieldtype-booleancheckbox > .input {
  flex-basis: 100%;
}

.home-mv__form .hubspot-form .hs-form .hs-form-booleancheckbox-display {
  gap: 0;
  color: #2c6ee6;
  font-size: 16px;
  font-weight: 700;
}

.home-mv__form .hubspot-form .hs-form .hs-form-booleancheckbox-display input {
  position: relative;
  width: 20px;
  height: 20px;
  margin: -3px 10px 0 0;
  border: 1px solid #ccc;
  background-color: #fff;
  box-shadow: none;
  outline: none;
  appearance: none;
}

.home-mv__form .hubspot-form .hs-form .hs-form-booleancheckbox-display input::after {
  content: '';
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 9px;
  margin-top: -7px;
  margin-left: -3px;
  border-right: 2px solid #2c6ee6;
  border-bottom: 2px solid #2c6ee6;
  transform: rotate(45deg);
}

.home-mv__form .hubspot-form .hs-form .hs-form-booleancheckbox-display input:checked::after {
  display: block;
}

.home-mv__form .hubspot-form .hs-form .hs-form-booleancheckbox-display a {
  margin-right: 8px;
  color: #2c6ee6;
  text-decoration: underline;
}

/* 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 (20px) 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. */
.home-mv__form .hubspot-form .hs-form .hs_submit {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.home-mv__form .hubspot-form .hs-form .hs_submit .actions {
  --button-text-width: 160px;

  position: relative;
  min-width: 350px;
}

.home-mv__form .hubspot-form .hs-form .hs_submit .actions::before {
  content: '';
  position: absolute;
  top: 50%;
  left: calc(50% - (28px + var(--button-text-width)) / 2);
  width: 20px;
  height: 20px;
  margin-top: -10px;

  /* 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='%232c6ee6' 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;
}

.home-mv__form .hubspot-form .hs-form .hs-button {
  width: 100%;
  padding: 16px 16px 16px 44px;
  border: 0;
  border-radius: 40px;
  background: #ffcd55;
  color: #2d2d2d;
  font-size: 20px;
  font-weight: 700;
  transition: 0.3s;
}

.home-mv__form .hubspot-form .hs-form .hs-button:hover {
  background: #f5bd38;
}

/* Labels above the inputs */
@media (width <= 1199px) {
  .home-mv__form-card {
    padding: 24px 12px;
  }

  /* home.min.css sets the margin with !important. */
  .home-mv__form-card .home-mv__form__title {
    margin-bottom: 10px !important;
    font-size: 18px;
  }

  .home-mv__form .hubspot-form .hs-form .hs-form-field,
  .home-mv__form .hubspot-form .hs-form .form-columns-2 .hs-form-field,
  .home-mv__form .hubspot-form .hs-form .form-columns-2 .hs-form-field + .hs-form-field {
    flex: 1 1 0;
    flex-direction: column;
  }

  .home-mv__form .hubspot-form .hs-form .hs-form-field > label,
  .home-mv__form .hubspot-form .hs-form .form-columns-2 .hs-form-field + .hs-form-field > label {
    flex: none;
    justify-content: space-between;
    height: auto;
    margin-bottom: 5px;
    text-align: left;
  }

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

  .home-mv__form .hubspot-form .hs-form .hs-form-field > label .hs-form-required {
    padding: 6px 5px;
  }

  /* 姓 and 名 have a smaller badge. */
  .home-mv__form .hubspot-form .hs-form .form-columns-2 .hs-form-field > label .hs-form-required::before {
    font-size: 10px;
  }

  .home-mv__form .hubspot-form .hs-form .hs-form-field > .input {
    flex: none;
  }

  .home-mv__form .hubspot-form .hs-form .hs-form-field > .hs-field-desc {
    flex: none;
    padding-left: 0;
  }

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

  .home-mv__form .hubspot-form .hs-form .hs-fieldtype-booleancheckbox > .input {
    flex: none;
  }

  .home-mv__form .hubspot-form .hs-form .hs-fieldtype-booleancheckbox {
    padding: 5px 0 41px;
  }

  .home-mv__form .hubspot-form .hs-form .hs-fieldtype-booleancheckbox:has(> .hs-error-msgs) {
    padding-bottom: 25px;
  }

  .home-mv__form .hubspot-form .hs-form .hs_submit .actions {
    flex: 1;
    min-width: 0;
  }

  .home-mv__form .hubspot-form .hs-form .hs-button {
    padding-right: 20px;
    padding-left: 48px;
  }
}
