/* ===== HubSpot Form EFO (.cform) — minimal ===== */
/* Ported from the training page's form design (`body.page-training .cform`).
   Selectors that design does not cover — the select arrow, radio groups, the
   EFO group break and the reduced-motion fallback — are carried over from the
   previous version so those field types keep their styling.
   `body[class]` prefixes only appear where HubSpot's injected stylesheet needs
   to be outranked; the box metrics use !important for the same reason. */
/* The training page drops the card frame because its form sits on a dark panel.
   Here the card can land on a pure-white section, so it keeps a hairline. */
body[class] .cform {
  /* This page's one red elsewhere is --cta-red (#BF012D); --accent defaults
     to #DB0032 for other uses, so it's redefined in this scope to keep the
     form's red on #BF012D too. */
  --accent: #BF012D;
  --form-placeholder-color: #767676;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  padding: 40px;
  background: var(--white);
  box-shadow: none;
}

.cform .hs-form,
.cform form.hs-form {
  font-family: inherit;
  max-width: none;
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
}

.cform .hs-form fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  max-width: none;
}

.cform .hs-form-field {
  position: relative;
  margin: 0 0 16px;
}

.cform .hs-form-field > label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
  font-size: var(--type-caption);
  font-weight: 500;
  color: var(--ink);
}

.cform .hs-form-field > label .hs-form-required {
  order: 0;
  font-size: 0;
  line-height: 0;
  color: transparent;
  margin: 0;
}

.cform .hs-form-field > label .hs-form-required::before {
  content: "必須";
  display: inline-block;
  font-style: normal;
  font-weight: 500;
  font-size: var(--type-micro);
  line-height: 1.4;
  color: var(--white);
  background: var(--accent);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  margin-left: 0;
}

body[class] .cform .hs-input:not([type="checkbox"]):not([type="radio"]),
body[class] .cform select.hs-input,
body[class] .cform textarea.hs-input {
  width: 100%;
  font-family: inherit;
  font-size: var(--type-small);
  font-weight: 400;
  /* HubSpot's injected stylesheet sets padding/min-height with higher
     specificity, so the box metrics need !important to land. */
  min-height: 44px !important;
  padding: 8px 14px !important;
  border: var(--border-width) solid transparent;
  border-radius: 4px;
  background: #F3F3F3;
  color: var(--ink);
  resize: vertical;
}

/* The field rule above matches textareas through its own `.hs-input:not(…)`
   branch, so every override below has to repeat that :not() pair to outrank
   it — otherwise the 44px min-height wins. */
body[class] .cform textarea.hs-input:not([type="checkbox"]):not([type="radio"]) {
  min-height: 96px !important;
}

/* Phone number: three boxes joined by hyphens, which is what Japanese forms
   lead people to expect. HubSpot's own input stays in the DOM (it owns the
   value, the name and the validation) — shrunk and transparent rather than
   display:none, which would make the browser refuse to report a constraint
   error on a required control it cannot focus. Selected by name rather than by
   an added class: HubSpot re-renders this input from React on every value
   change, which wipes any className we put on it. */
body[class] .cform .efo-phone-parts ~ input[name="phone"] {
  position: absolute;
  width: 1px !important;
  min-height: 1px !important;
  padding: 0 !important;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
body[class] .cform .efo-phone-parts {
  display: flex;
  align-items: center;
  gap: 8px;
}
body[class] .cform .efo-phone-parts .efo-phone-part { width: 100%; }
body[class] .cform .efo-phone-sep { flex: none; color: #9f9f9f; }

.cform .hs-input::placeholder,
.cform textarea.hs-input::placeholder {
  color: var(--form-placeholder-color, #767676);
  opacity: 1;
}

.cform .hs-input:focus,
.cform select.hs-input:focus,
.cform textarea.hs-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Carried over: the native select arrow is replaced with an inline SVG. */
body[class] .cform .hs-fieldtype-select select.hs-input:not([type="checkbox"]):not([type="radio"]) {
  appearance: none;
  padding-right: 36px !important;
  cursor: pointer;
  background-color: #F3F3F3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23999' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

body[class] .cform .hs-form-field.has-error .hs-input:not([type="checkbox"]):not([type="radio"]),
body[class] .cform .hs-input.is-invalid:not([type="checkbox"]):not([type="radio"]) {
  border-color: var(--accent);
}

/* Error text floats as a tooltip above the input instead of pushing the
   following fields down. The legal-consent error stays inline. */
.cform .hs-form-field > .hs-error-msgs {
  position: absolute;
  top: -2px;
  right: 0;
  z-index: 3;
  max-width: 100%;
  margin: 0;
  padding: 4px 10px;
  list-style: none;
  border-radius: var(--radius-xs);
  background: var(--accent);
  box-shadow: 0 4px 12px rgba(var(--site-black-rgb), 0.14);
  pointer-events: none;
}

.cform .hs-form-field > .hs-error-msgs::before {
  content: "";
  position: absolute;
  top: 100%;
  right: 16px;
  border: 5px solid transparent;
  border-top-color: var(--accent);
}

.cform .hs-form-field > .hs-error-msgs label.hs-error-msg {
  display: block;
  font-size: var(--type-micro);
  line-height: 1.45;
  color: var(--white);
}

.cform .legal-consent-container .hs-error-msgs {
  position: static;
  margin: 4px 0 0;
  padding: 0;
  background: none;
  box-shadow: none;
}

.cform .legal-consent-container .hs-error-msgs::before {
  display: none;
}

.cform .legal-consent-container .hs-error-msgs label {
  font-size: 11px;
  line-height: 1.45;
  color: var(--accent);
}

/* Carried over: radio groups are not used on the training page. */

.cform .hs-form-radio,
.cform .hs-form-radio-display {
  margin: 0;
}

.cform .hs-form-radio > label,
.cform .hs-form-radio-display > label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: auto;
  margin: 0;
  padding: 5px 0;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: var(--type-caption);
  line-height: 1.45;
  color: var(--ink);
  cursor: pointer;
  transition: none;
}

.cform .hs-form-radio input[type="radio"],
.cform .hs-form-radio-display input[type="radio"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
  flex-shrink: 0;
}

/* The two-column row is kept for these pages: the training page forces one
   column because its form sits in a narrow hero panel. */
.cform fieldset.form-columns-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
}

.cform fieldset.form-columns-2 .hs-form-field {
  margin-bottom: 16px;
}

/* Carried over: inserted by hubspot-form-efo.js. */
.cform .efo-group-break {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.cform .hs_submit,
.cform .hs-submit {
  margin-top: 6px;
}

body[class] .cform .hs-button,
body[class] .cform input[type="submit"].hs-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--btn-gap);
  width: 100%;
  min-height: 52px;
  margin: 0;
  font-family: var(--site-font-body);
  font-size: var(--btn-font-size);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  cursor: pointer;
  background: var(--accent) !important;
  color: var(--white) !important;
  padding: var(--btn-padding-y) var(--btn-padding-x);
  border-radius: var(--radius-pill);
  border: var(--border-width) solid var(--accent) !important;
  transition: opacity 0.15s;
}

.cform .hs-button:hover,
.cform input[type="submit"].hs-button:hover {
  opacity: 0.78;
}

.cform .hs-button:active,
.cform input[type="submit"].hs-button:active {
  transform: none;
}

/* Submit feedback. HubSpot renders the button as <input type="submit">, which
   can't hold an icon, so the spinner / check sits on the .actions wrapper and
   the label swaps through the input's value (see hubspot-form-efo.js). */
.cform .hs_submit .actions {
  position: relative;
}

.cform .hs_submit .actions.is-submitting .hs-button,
.cform .hs_submit .actions.is-submitted .hs-button {
  pointer-events: none;
}

.cform .hs_submit .actions.is-submitting .hs-button {
  opacity: 0.82;
}

.cform .hs_submit .actions.is-submitting::before,
.cform .hs_submit .actions.is-submitted::before {
  content: "";
  position: absolute;
  top: 50%;
  left: var(--btn-padding-x);
  z-index: 1;
  pointer-events: none;
}

.cform .hs_submit .actions.is-submitting::before {
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: cform-submit-spin 0.7s linear infinite;
}

.cform .hs_submit .actions.is-submitted::before {
  width: 16px;
  height: 9px;
  margin-top: -7px;
  border-left: 2px solid var(--white);
  border-bottom: 2px solid var(--white);
  transform: rotate(-45deg);
}

@keyframes cform-submit-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cform .hs_submit .actions.is-submitting::before {
    animation: none;
  }
}

.cform .legal-consent-container,
.cform .hs-richtext {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  text-align: left;
}

.cform .legal-consent-container .hs-form-booleancheckbox-display > label,
.cform label.hs-form-booleancheckbox-display {
  display: flex !important;
  align-items: flex-start;
  gap: 8px !important;
  margin: 0;
  font-size: var(--type-caption);
  color: var(--ink);
  cursor: pointer;
}

/* Carried over: HubSpot wraps the consent checkbox in a <ul>. */
.cform .hs-fieldtype-booleancheckbox .inputs-list,
.cform .hs-fieldtype-booleancheckbox .inputs-list > li.hs-form-booleancheckbox {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cform label.hs-form-booleancheckbox-display > span,
.cform .legal-consent-container .hs-richtext p,
.cform .hs-richtext p {
  font-size: var(--type-caption);
  line-height: 1.5;
  margin-left: 0 !important;
  padding-left: 0 !important;
}

.cform .legal-consent-container .hs-richtext a,
.cform .hs-richtext a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

/* Carried over: keyboard focus stays visible on the consent links. */
.cform .legal-consent-container .hs-richtext a:focus-visible,
.cform .hs-richtext a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body[class] .cform .legal-consent-container input[type="checkbox"],
body[class] .cform .hs-form-booleancheckbox-display input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px;
  min-height: 16px !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  position: static !important;
  flex-shrink: 0;
  accent-color: var(--accent);
}

body[class] .cform .hs-recaptcha,
body[class] .cform .hs-recaptcha * {
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  filter: none !important;
  -webkit-filter: none !important;
}

.cform .submitted-message {
  padding: 20px 0;
  font-size: var(--type-small);
  line-height: 1.65;
  color: var(--ink);
  text-align: center;
}

@media (max-width: 1024px) {body[class] .cform {
    padding: 32px 24px;
  }
}

@media (max-width: 768px) {body[class] .cform {
    padding: 24px 20px;
  }
}

@media (max-width: 640px) {.cform fieldset.form-columns-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .cform fieldset.form-columns-2 .hs-form-field {
    margin-bottom: 16px;
  }

  .cform fieldset.form-columns-2 .hs-form-field:last-child {
    margin-bottom: 0;
  }
}

/* Carried over. */
@media (prefers-reduced-motion: reduce) {.cform .hs-button,
  .cform input[type="submit"].hs-button {
    transition: none;
  }
}
