.contact-modal[hidden] {
  display: none;
}

.contact-modal__content[hidden],
.contact-modal__result[hidden] {
  display: none;
}

.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 24px;
  font-family: "Noto Sans JP", sans-serif;
}

.contact-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 19, 48, 0.76);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.contact-modal__dialog {
  position: relative;
  width: min(720px, 100%);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(110, 127, 243, 0.22), transparent 42%),
    #fff;
  color: #1a1a2e;
  box-shadow: 0 28px 80px rgba(6, 12, 38, 0.34);
}

.contact-modal__content {
  padding: 42px 46px 46px;
}

.contact-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #1e2350;
  color: #fff;
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.contact-modal__close:hover {
  transform: rotate(6deg);
  background: #4a5fd4;
}

.contact-modal__eyebrow {
  margin: 0 0 10px;
  color: #4a5fd4;
  font-family: "Roboto", sans-serif;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.28em;
}

.contact-modal__title {
  margin: 0 52px 10px 0;
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.04em;
}

.contact-modal__lead {
  margin: 0 0 28px;
  color: #5b6472;
  font-size: 14px;
  line-height: 1.9;
}

.contact-modal__form {
  display: grid;
  gap: 18px;
}

.contact-modal__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.contact-modal__field {
  display: grid;
  gap: 8px;
}

.contact-modal__field > span {
  color: #2f3848;
  font-size: 13px;
  font-weight: 700;
}

.contact-modal__required {
  margin-left: 5px;
  color: #4a5fd4;
  font-size: 10px;
  letter-spacing: 0.05em;
}

.contact-modal__field input,
.contact-modal__field textarea {
  width: 100%;
  border: 1px solid #d4d9e2;
  border-radius: 10px;
  background: rgba(247, 248, 252, 0.9);
  color: #1a1a2e;
  font: inherit;
  font-size: 16px;
  line-height: 1.6;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.contact-modal__field input {
  min-height: 50px;
  padding: 10px 14px;
}

.contact-modal__field textarea {
  min-height: 150px;
  padding: 12px 14px;
  resize: vertical;
}

.contact-modal__field input:focus,
.contact-modal__field textarea:focus {
  border-color: #5b63df;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(91, 99, 223, 0.14);
}

.contact-modal__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-modal__status {
  min-height: 1.6em;
  margin: -2px 0 0;
  color: #b42318;
  font-size: 13px;
  line-height: 1.6;
}

.contact-modal__submit {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 22px;
  min-height: 54px;
  padding: 12px 20px 12px 26px;
  border: 0;
  border-radius: 7px;
  background: linear-gradient(135deg, #3d4e81, #6e7ff3);
  color: #fff;
  font-family: "Roboto", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(91, 95, 214, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.contact-modal__submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(91, 95, 214, 0.38);
}

.contact-modal__submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.contact-modal__arrow {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-size: 16px;
}

.contact-modal__result {
  display: grid;
  min-height: 360px;
  place-items: center;
  padding: 54px 46px;
  text-align: center;
}

.contact-modal__result-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3d4e81, #6e7ff3);
  color: #fff;
  font-size: 32px;
}

.contact-modal__result-title {
  margin: 0 0 14px;
  font-size: 28px;
  line-height: 1.5;
}

.contact-modal__result-body {
  margin: 0;
  color: #5b6472;
  font-size: 14px;
  line-height: 1.9;
}

html.contact-modal-open,
body.contact-modal-open {
  overflow: hidden;
}

/* JavaScriptが無効な場合に表示される送信結果ページ */
.contact-page {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(135deg, #eef1f8, #fff);
  color: #1a1a2e;
  font-family: "Noto Sans JP", sans-serif;
}

.contact-page .contact-main {
  display: grid;
  min-height: calc(100vh - 100px);
  place-items: center;
  padding: 130px 24px 70px;
}

.contact-page .contact-result {
  width: min(680px, 100%);
  padding: 48px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(30, 35, 80, 0.14);
  text-align: center;
}

.contact-page .contact-result__eyebrow {
  color: #4a5fd4;
  font-family: "Roboto", sans-serif;
  font-weight: 900;
  letter-spacing: 0.22em;
}

.contact-page .contact-result__title {
  margin: 12px 0;
  font-size: clamp(28px, 5vw, 42px);
}

.contact-page .contact-result__body,
.contact-page .contact-result__errors {
  margin: 0 0 24px;
  color: #5b6472;
  line-height: 1.9;
}

.contact-page .contact-result__errors {
  text-align: left;
}

@media (max-width: 640px) {
  .contact-modal {
    padding: 10px;
  }

  .contact-modal__dialog {
    max-height: calc(100dvh - 20px);
    border-radius: 16px;
  }

  .contact-modal__content {
    padding: 34px 20px 26px;
  }

  .contact-modal__close {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
  }

  .contact-modal__title {
    margin-right: 42px;
    font-size: 30px;
  }

  .contact-modal__lead {
    margin-bottom: 22px;
    font-size: 13px;
  }

  .contact-modal__grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .contact-modal__submit {
    width: 100%;
    justify-content: space-between;
  }

  .contact-modal__result {
    min-height: 320px;
    padding: 46px 24px;
  }

  .contact-page .contact-result {
    padding: 36px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-modal__close,
  .contact-modal__submit,
  .profile-link {
    transition: none;
  }
}
