/* Form embed (Figma PC 357:1156 / SP 357:3224)
   Scoped by `.embed-form` to avoid leaking into the parent page. */

.embed-form :where(*, *::before, *::after) {
  box-sizing: border-box;
}

.embed-form {
  --form-label: #002854;
  --form-required: #e9314b;
  --form-text: #002854;
  --form-body: #1d1d1d;
  --form-border: #ccd4dd;
  --form-accent: #f18e2c;
  --form-submit: #ff6300;
  --form-field-h: 44px;
  --form-placeholder: color-mix(in srgb, var(--form-text) 40%, transparent);
}

.embed-form form.form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 0;
  width: 100%;
  font-family: 'Noto Sans JP', var(--font-sans);
  color: var(--form-body);
  background: transparent;
}

@media (min-width: 768px) {

.embed-form form.form {
    gap: 24px;
}
  }

.embed-form form.form > :not(p.errors):not(.pardot-recaptcha-wrapper) {
  width: 100%;
  max-width: 480px;
}

.embed-form form.form p.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  width: 100%;
}

.embed-form form.form p.form-field.hidden,
.embed-form form.form p.form-field.pd-hidden,
.embed-form form.form p.form-field.pd-captcha {
  display: none !important;
}

.embed-form form.form div[id^='error_for_'] {
  display: none !important;
}

/* Validation errors (Pardot: p.errors / p.error.no-label / p.form-field.error) */

.embed-form form.form > p.errors {
  width: 100%;
  margin: 0;
  padding: 12px 16px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--form-required) 8%, #fff);
  color: var(--form-required);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.8;
  text-align: left;
  word-break: break-word;
}

@media (min-width: 768px) {

.embed-form form.form > p.errors {
    font-size: 15px;
}
  }

.embed-form form.form p.error.no-label {
  width: 100%;
  margin: -8px 0 0;
  padding: 0;
  color: var(--form-required);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  text-align: left;
  word-break: break-word;
}

@media (min-width: 768px) {

.embed-form form.form p.error.no-label {
    margin-top: -12px;
    margin-left: calc(140px + 16px);
    max-width: 324px;
    font-size: 14px;
}
  }

.embed-form form.form p.form-field.pd-checkbox + p.error.no-label {
  margin-top: -4px;
  margin-left: 0;
  max-width: none;
  text-align: center;
}

.embed-form form.form p.form-field.error input[type='text'],
.embed-form form.form p.form-field.error input[type='email'],
.embed-form form.form p.form-field.error input[type='tel'],
.embed-form form.form p.form-field.error select {
  border-color: var(--form-required);
}

.embed-form form.form p.form-field.pd-checkbox.error input[type='checkbox'] {
  border-color: var(--form-required);
}

@media (min-width: 768px) {
  .embed-form form.form p.form-field:not(.pd-checkbox) {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    min-height: var(--form-field-h);
  }
}

.embed-form form.form label.field-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.8;
  color: var(--form-label);
  word-break: break-word;
}

@media (min-width: 768px) {

.embed-form form.form label.field-label {
    flex-wrap: nowrap;
    flex: 0 0 150px;
    width: 150px;
    min-height: var(--form-field-h);
    font-size: 15px;
}
  }

.embed-form form.form p.form-field.required:not(.pd-checkbox) > label.field-label::after {
  content: '*';
  color: var(--form-required);
  font-weight: 700;
  line-height: 1.8;
}

.embed-form form.form p.form-field.ExpectedDate > label.field-label {
  align-items: flex-start;
}

@media (min-width: 768px) {
  .embed-form form.form p.form-field.ExpectedDate > label.field-label {
    align-items: flex-start;
    justify-content: center;
  }
}

.embed-form form.form input[type='text'],
.embed-form form.form input[type='email'],
.embed-form form.form input[type='tel'],
.embed-form form.form select {
  width: 100%;
  height: var(--form-field-h);
  padding: 8px 16px;
  border: 1px solid var(--form-border);
  border-radius: 3px;
  background: #fff;
  color: var(--form-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.8;
  outline: none;
  appearance: none;
}

@media (min-width: 768px) {

.embed-form form.form input[type='text'],
.embed-form form.form input[type='email'],
.embed-form form.form input[type='tel'],
.embed-form form.form select {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 324px;
}
  }

.embed-form form.form input[type='text']::placeholder,
.embed-form form.form input[type='email']::placeholder,
.embed-form form.form input[type='tel']::placeholder,
.embed-form form.form input[type='text']::-webkit-input-placeholder,
.embed-form form.form input[type='email']::-webkit-input-placeholder,
.embed-form form.form input[type='tel']::-webkit-input-placeholder {
  color: var(--form-placeholder);
  font-weight: 400;
  line-height: 1.8;
}

.embed-form form.form input[type='text']::-moz-placeholder,
.embed-form form.form input[type='email']::-moz-placeholder,
.embed-form form.form input[type='tel']::-moz-placeholder {
  color: var(--form-placeholder);
  font-weight: 400;
  line-height: 1.8;
  opacity: 1;
}

.embed-form form.form select {
  padding-right: 40px;
  background-image: url('/lp/totalagility_001/consultation/icon-select-chevron.svg');
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 13px 8px;
  cursor: pointer;
}

/* 「選択してください」表示中（pardot-form.js が value の有無で付け外しする） */
.embed-form form.form select.is-placeholder {
  color: var(--form-placeholder);
}

.embed-form form.form select option {
  color: var(--form-text);
}

.embed-form form.form input:focus,
.embed-form form.form select:focus {
  border-color: var(--form-label);
}

.embed-form form.form p.form-field.pd-checkbox {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
}

.embed-form form.form p.form-field.pd-checkbox > label.field-label {
  display: block;
  flex: none;
  width: 100%;
  min-height: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.8;
  color: var(--form-label);
  text-align: center;
  word-break: break-word;
}

.embed-form form.form p.form-field.pd-checkbox > label.field-label a {
  color: var(--form-accent);
  text-decoration: underline;
  text-underline-position: from-font;
}

.embed-form form.form p.form-field.pd-checkbox > label.field-label a:hover {
  opacity: 0.8;
}

.embed-form form.form p.form-field.pd-checkbox .value {
  display: flex;
  justify-content: center;
  margin: 0;
  width: 100%;
}

.embed-form form.form p.form-field.pd-checkbox .value > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.embed-form form.form p.form-field.pd-checkbox input[type='checkbox'] {
  flex-shrink: 0;
  width: 19.5px;
  height: 19.5px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--form-border);
  border-radius: 2.5px;
  background: #fff;
  cursor: pointer;
  appearance: none;
}

.embed-form form.form p.form-field.pd-checkbox input[type='checkbox']:checked {
  background-color: var(--form-label);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath fill='%23fff' d='M4.5 9.3 0 4.8l1.4-1.4 3.1 3.1 6.1-6.1L12 1.8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px 8px;
  border-color: var(--form-label);
}

.embed-form form.form p.form-field.pd-checkbox label.inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--form-label);
  cursor: pointer;
}

@media (min-width: 768px) {

.embed-form form.form p.form-field.pd-checkbox label.inline {
    font-size: 15px;
    line-height: 1.8;
}
  }

.embed-form form.form p.form-field.pd-checkbox.required label.inline::after {
  content: '*';
  color: var(--form-required);
  font-weight: 700;
  line-height: inherit;
}

.embed-form form.form p.submit {
  --cta-accent: #ff6300;
  --cta-slide-fill: #fff;
  --cta-hover-color: #1d1d1d;
  --cta-slide-skew: -18deg;
  --cta-slide-width: 165%;
  --cta-slide-height: 140%;
  --cta-slide-offset-x: -14%;
  --cta-slide-offset-y: -20%;

  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-self: center;
  justify-content: center;
  margin: 0;
  width: auto;
  max-width: 100%;
  border-radius: 500px;
}

.embed-form form.form p.submit::before {
  content: '';
  position: absolute;
  top: var(--cta-slide-offset-y);
  left: var(--cta-slide-offset-x);
  width: var(--cta-slide-width);
  height: var(--cta-slide-height);
  z-index: 0;
  background: var(--cta-slide-fill);
  transform: skewX(var(--cta-slide-skew)) scaleX(0);
  transform-origin: left center;
  transition: transform 0.2s ease-out;
  pointer-events: none;
}

.embed-form form.form p.submit input[type='submit'] {
  position: relative;
  z-index: 1;
  width: 247px;
  max-width: 100%;
  height: 48px;
  padding: 12px 16px;
  border: 2px solid var(--cta-accent);
  border-radius: 500px;
  background: var(--cta-accent);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.8;
  text-align: center;
  cursor: pointer;
  transition: color 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out;
}

@media (min-width: 768px) {

.embed-form form.form p.submit input[type='submit'] {
    width: 350px;
    height: 56px;
    font-size: 15px;
}
  }

@media (hover: hover) and (pointer: fine) {
  .embed-form form.form p.submit:hover::before,
  .embed-form form.form p.submit:focus-within::before {
    transform: skewX(var(--cta-slide-skew)) scaleX(1);
  }

  .embed-form form.form p.submit:hover input[type='submit'],
  .embed-form form.form p.submit:focus-within input[type='submit'] {
    color: var(--cta-hover-color);
    background: transparent;
  }
}

@media (hover: none), (pointer: coarse) {
  .embed-form form.form p.submit:active::before {
    transform: skewX(var(--cta-slide-skew)) scaleX(1);
    transition: none;
  }

  .embed-form form.form p.submit:active input[type='submit'] {
    color: var(--cta-hover-color);
    background: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .embed-form form.form p.submit::before {
    transition: none;
  }

  .embed-form form.form p.submit:hover::before,
  .embed-form form.form p.submit:focus-within::before,
  .embed-form form.form p.submit:active::before {
    transform: skewX(var(--cta-slide-skew)) scaleX(1);
  }
}

@media (max-width: 767px) {
  .embed-form form.form input[type='text'],
  .embed-form form.form input[type='email'],
  .embed-form form.form input[type='tel'],
  .embed-form form.form select {
    font-size: 16px;
  }

  .embed-form form.form input[type='text']::placeholder,
  .embed-form form.form input[type='email']::placeholder,
  .embed-form form.form input[type='tel']::placeholder,
  .embed-form form.form input[type='text']::-webkit-input-placeholder,
  .embed-form form.form input[type='email']::-webkit-input-placeholder,
  .embed-form form.form input[type='tel']::-webkit-input-placeholder,
  .embed-form form.form input[type='text']::-moz-placeholder,
  .embed-form form.form input[type='email']::-moz-placeholder,
  .embed-form form.form input[type='tel']::-moz-placeholder {
    font-size: 16px;
  }
}
