.contact-thanks-button-wrap{
  margin-block-start: 0 !important;
}

.contact-font-akazuki-pop {
  font-family:
    "Akazuki POP",
    "Hiragino Kaku Gothic ProN",
    "Hiragino Sans",
    "Yu Gothic",
    "Meiryo",
    sans-serif;
}

.wp-site-blocks{
  padding: 0 !important;
}
.contact-page {
  min-height: 100vh;
  background: #fff;
  color: #222222;
  font-family:
    "Hiragino Kaku Gothic ProN",
    "Hiragino Sans",
    "Yu Gothic",
    "Meiryo",
    sans-serif;
}

.contact-page__header {
  background: #e60000;
}

.contact-page__header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 28px;
}

.contact-page__brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.02em;
}

.contact-page__brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.contact-page__brand-image {
  display: block;
  width: auto;
  height: 44px;
  max-width: 180px;
  object-fit: contain;
}

.contact-page__brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 3px solid #ffffff;
  border-radius: 999px;
  font-size: 28px;
  line-height: 1;
}

.contact-page__brand-text {
  line-height: 1;
}

.contact-form-section {
  padding: 66px 24px 120px;
}

.contact-form-section__inner {
  width: min(100%, 630px);
  margin: 0 auto;
}

.contact-form-section__title {
  margin: 0 0 38px;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.contact-form {
  width: min(100%, 628px);
}

.contact-form__group {
  margin-bottom: 24px;
}

.contact-form__group--checkbox {
  margin-top: 34px;
  margin-bottom: 30px;
  display: flex;
  justify-content: center;
}

.contact-form__label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
  color: rgb(0, 0, 0);
  text-align: left;
  letter-spacing: 0;
}

.contact-form__required-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 26px;
  border: 1px solid #ff0000;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  color: #ff0000;
  background: transparent;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
}

.contact-form__control {
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 0;
  background: #ebebeb;
  color: #222222;
  font: inherit;
  font-size: 14px;
  line-height: 1.6;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.contact-form__control--textarea {
  resize: vertical;
}

.contact-form__control:focus {
  outline: none;
  border-color: #444444;
  background: #f0f0f0;
}

.contact-form__group.is-error .contact-form__control,
.contact-form__checkbox[aria-invalid="true"] {
  border-color: #ff0000;
  background: #f7f0f0;
  border-width: 2px;
}

.contact-form__error {
  margin: 8px 0 0;
  color: #ff0000;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.contact-form__policy {
  margin-top: 28px;
}

.contact-form__policy-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.7;
  letter-spacing: 0.04em;
}

.contact-form__policy-box {
  height: 190.56px;
  overflow-y: auto;
  box-sizing: border-box;
  border: 1px solid #333333;
  background: #ffffff;
  padding: 38px 22px 11px;
}

.contact-form__policy-box::after {
  content: "";
  display: block;
  height: 11px;
}

.contact-form__policy-section + .contact-form__policy-section {
  margin-top: 28px;
}

.contact-form__policy-heading {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.7;
}

.contact-form__policy-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: 0.02em;
}

.contact-form__checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.contact-form__checkbox-text {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  color: rgb(0, 0, 0);
  text-align: left;
  letter-spacing: 0;
}

.contact-form__checkbox {
  width: 28px;
  height: 28px;
  margin: 0;
  appearance: none;
  border: 1px solid transparent;
  background: #ebebeb;
  position: relative;
}

.contact-form__checkbox:checked::after {
  content: "";
  position: absolute;
  inset: 5px 9px 7px 9px;
  border-right: 2px solid #e60000;
  border-bottom: 2px solid #e60000;
  transform: rotate(45deg);
}

.contact-form__global-error {
  margin: 0 0 22px;
  color: #ff0000;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
  letter-spacing: 0.02em;
}

.contact-form__actions {
  display: grid;
  grid-template-columns: 159px 202px 159px;
  align-items: center;
  column-gap: 28px;
}

.contact-form__back-button,
.contact-thanks-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 159px;
  height: 50px;
  padding: 0;
  border-radius: 999px;
  text-decoration: none;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
  letter-spacing: 0;
  white-space: nowrap;
}

.contact-form__back-button {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  border: 2px solid #d91107;
  background: rgb(255, 255, 255);
  color: #d91107;
}

.contact-form__submit-button {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  min-width: 202px;
  min-height: 48px;
  padding: 10px 24px;
  border: 0;
  background: #000000;
  color: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.contact-form__submit-button:disabled {
  opacity: 0.7;
  cursor: progress;
}

.contact-complete {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 148px 24px 80px;
}

.contact-complete__inner {
  width: min(100%, 900px);
  text-align: center;
}

.contact-complete__title {
  margin: 0;
  font-size: clamp(34px, 3vw, 40px);
  font-weight: 400;
  letter-spacing: 0.06em;
}

.contact-complete__divider {
  width: 176px;
  height: 1px;
  margin: 44px auto 66px;
  background: #8d8d8d;
}

.contact-complete__text {
  margin: 0;
  font-size: 14px;
  line-height: 2;
  letter-spacing: 0.04em;
}

.contact-complete__text + .contact-complete__text {
  margin-top: 2px;
}

.contact-thanks-button-wrap {
  display: flex;
  width: 100%;
}

.contact-thanks-button-wrap--center {
  justify-content: center;
}

.contact-thanks-button-wrap--left {
  justify-content: flex-start;
}

.contact-thanks-button {
  background: #ff0000;
  color: #ffffff;
  border: 0;
}

@media (max-width: 900px) {
  .contact-form-section__inner {
    margin-left: auto;
    margin-right: auto;
  }

  .contact-form__actions {
    grid-template-columns: 159px 202px 159px;
    column-gap: 20px;
  }
}

@media (max-width: 640px) {
  .contact-page__header-inner {
    padding-left: 18px;
    padding-right: 18px;
  }

  .contact-page__brand {
    font-size: 18px;
  }

  .contact-page__brand-mark {
    width: 38px;
    height: 38px;
    font-size: 22px;
  }

  .contact-page__brand-image {
    height: 38px;
    max-width: 150px;
  }

  .contact-form-section {
    padding-left: 16px;
    padding-right: 16px;
  }

  .contact-form__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .contact-form__back-button,
  .contact-form__submit-button,
  .contact-thanks-button {
    width: 100%;
    min-width: 0;
  }

  .contact-complete {
    padding-top: 96px;
  }
}

/* Contact Form 7 markup support for the current contact page template */
body.page-template-contact .wp-site-blocks > main {
  width: min(100%, 678px);
  margin: var(--wp--preset--spacing--50) auto 0;
  padding: 0 24px 120px;
  box-sizing: border-box;
}

body.page-template-contact .wpcf7 {
  margin: 0;
}

body.page-template-contact .wpcf7-form {
  margin: 0;
}

body.page-template-contact .form-title-text {
  margin: 0 0 38px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.6;
}

body.page-template-contact .form-contact {
  width: 100%;
}

body.page-template-contact .form-field {
  margin-bottom: 24px;
}

body.page-template-contact .form-field > p,
body.page-template-contact .form-button-wrapper > p {
  margin: 0;
}

body.page-template-contact .form-field br,
body.page-template-contact .form-button-wrapper br {
  display: none;
}

body.page-template-contact .form-input-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
  color: #000000;
  letter-spacing: 0;
}

body.page-template-contact .form-input-label--required {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid #ff0000;
  color: #ff0000;
  background: transparent;
  font-size: 15px;
  line-height: 1.2;
  box-sizing: border-box;
}

body.page-template-contact .form-input-content {
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 0;
  background: #ebebeb;
  color: #222222;
  font: inherit;
  font-size: 14px;
  line-height: 1.6;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

body.page-template-contact textarea.form-input-content {
  min-height: 160px;
  resize: vertical;
}

body.page-template-contact .form-input-content:focus {
  outline: none;
  border-color: #444444;
  background: #f0f0f0;
}

body.page-template-contact .wpcf7-not-valid .form-input-content,
body.page-template-contact .form-input-content.wpcf7-not-valid,
body.page-template-contact .wpcf7-acceptance input[aria-invalid="true"] {
  border-color: #ff0000;
  background: #f7f0f0;
  border-width: 2px;
}

body.page-template-contact .wpcf7-not-valid-tip {
  display: block;
  margin-top: 8px;
  color: #ff0000;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

body.page-template-contact .wpcf7-acceptance {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 28px 0 30px;
}

body.page-template-contact .wpcf7-list-item {
  margin: 0;
}

body.page-template-contact .wpcf7-acceptance label {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

body.page-template-contact .wpcf7-acceptance input[type="checkbox"] {
  width: 28px;
  height: 28px;
  margin: 0;
  appearance: none;
  border: 1px solid transparent;
  background: #ebebeb;
  position: relative;
}

body.page-template-contact .wpcf7-acceptance input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  inset: 5px 9px 7px 9px;
  border-right: 2px solid #e60000;
  border-bottom: 2px solid #e60000;
  transform: rotate(45deg);
}

body.page-template-contact .wpcf7-list-item-label {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  color: #000000;
  letter-spacing: 0;
}

body.page-template-contact .form-button-wrapper {
  margin-top: 12px;
}

body.page-template-contact .form-button-wrapper > p {
  display: grid;
  grid-template-columns: 159px 202px 159px;
  align-items: center;
  column-gap: 28px;
}

body.page-template-contact .form-input-back-button {
  grid-column: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-sizing: border-box;
  width: 159px;
  height: 50px;
  border: 2px solid #d91107;
  border-radius: 999px;
  background: #ffffff;
  color: #d91107;
  text-decoration: none;
  font-size: 16px;
  line-height: 1.2;
  white-space: nowrap;
}

body.page-template-contact .form-input-back-button svg {
  flex: 0 0 auto;
}

body.page-template-contact .form-input-submit-button {
  grid-column: 2;
  justify-self: center;
  min-width: 202px;
  min-height: 48px;
  padding: 10px 24px;
  border: 0;
  background: #d91107;
  color: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
}

body.page-template-contact .wpcf7-spinner {
  display: none;
}

body.page-template-contact .wpcf7-response-output {
  margin: 20px 0 0;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.6;
}

body.cf7-confirm-modal-open {
  overflow: hidden;
}

#cf7-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.56);
  box-sizing: border-box;
}

#cf7-confirm-modal.is-open {
  display: flex;
}

#cf7-confirm-modal .modal-inner {
  width: min(100%, 640px);
  max-height: min(100vh - 48px, 720px);
  overflow-y: auto;
  padding: 32px 24px 24px;
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  box-sizing: border-box;
}

#cf7-confirm-modal .modal-inner h2 {
  margin: 0 0 24px;
  font-size: 24px;
  line-height: 1.4;
  text-align: center;
}

#cf7-confirm-modal .modal-inner p{
  text-align: center;
}

#cf7-confirm-content {
  display: grid;
  gap: 16px;
}

.cf7-confirm-modal__row {
  padding-bottom: 16px;
  border-bottom: 1px solid #d9d9d9;
}

.cf7-confirm-modal__label,
.cf7-confirm-modal__value {
  margin: 0;
  text-align: left !important;
}

.cf7-confirm-modal__label {
  margin-bottom: 8px;
  font-weight: 700;
  color: #111111;
}

.cf7-confirm-modal__value {
  line-height: 1.8;
  word-break: break-word;
}

#cf7-confirm-modal button {
  width: 100%;
  min-height: 48px;
  margin-top: 16px;
  padding: 12px 20px;
  border: 0;
  font: inherit;
  cursor: pointer;
}

#cf7-modal-submit {
  margin-top: 24px;
  background: #d91107;
  color: #ffffff;
  width: 100%;
}

#cf7-modal-close {
  background: #f2f2f2;
  color: #111111;
}

@media (max-width: 640px) {
  body.page-template-contact .wp-site-blocks > main {
    padding-left: 16px;
    padding-right: 16px;
  }

  body.page-template-contact .form-button-wrapper > p {
    display: flex;
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 32px;
  }

  body.page-template-contact .form-input-back-button,
  body.page-template-contact .form-input-submit-button {
    width: 100%;
    min-width: 0;
  }

  #cf7-confirm-modal {
    padding: 16px;
  }

  #cf7-confirm-modal .modal-inner {
    max-height: calc(100vh - 32px);
    padding: 24px 16px 16px;
  }

  #cf7-confirm-modal .modal-inner h2 {
    font-size: 20px;
  }
}

/* プライバシー同意未チェック時（テーマ functions.php のインライン JS が付与） */
.wpcf7-acceptance.hayashi-acceptance-missing,
.wpcf7-form-control-wrap.hayashi-acceptance-missing {
  outline: 2px solid rgb(217, 17, 7);
  outline-offset: 4px;
  border-radius: 4px;
}

p.hayashi-privacy-acceptance-error {
  margin: 0.5em 0 0;
  font-size: 14px;
  font-weight: 600;
  color: rgb(217, 17, 7);
}
