:root {
  --blue: #1a5bd7;
  --blue-strong: #154ec1;
  --content-width: 1120px;
}

.contact-page-main {
  background:
    radial-gradient(circle at 84% 12%, rgba(222, 236, 255, 0.85) 0 16%, transparent 34%),
    linear-gradient(180deg, #f7fbff 0%, #fff 100%);
}

.subpage-hero.contact-page-hero {
  padding-top: clamp(26px, 3.2vw, 44px);
  padding-bottom: 24px;
}

.subpage-hero.contact-page-hero p {
  color: #5a7fb4;
  font-weight: 600;
}

.subpage-hero.contact-page-hero h1 {
  color: #213961;
  font-size: clamp(1.9rem, 2.55vw, 2.58rem);
  font-weight: 600;
}

.contact-page-section {
  width: min(100% - 48px, var(--content-width));
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(460px, 1fr);
  align-items: start;
  gap: clamp(34px, 5vw, 72px);
  margin: 0 auto;
  padding: 0 0 clamp(56px, 7vw, 96px);
}

.contact-page-copy {
  position: sticky;
  top: 24px;
  min-width: 0;
  padding-top: 18px;
}

.contact-page-copy .contact-label {
  display: inline-flex;
  min-height: auto;
  margin-bottom: 18px;
  padding: 0;
  border: 0;
  color: #5579ad;
  background: transparent;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.contact-page-copy h2 {
  margin: 0 0 18px;
  color: #213961;
  font-size: clamp(1.48rem, 1.88vw, 1.96rem);
  line-height: 1.42;
  font-weight: 600;
}

.contact-page-copy p:not(.contact-label) {
  margin: 0;
  color: #526984;
  font-size: clamp(1rem, 1.1vw, 1.16rem);
  line-height: 1.8;
  font-weight: 400;
}

.contact-reasons {
  display: grid;
  gap: 13px;
  margin: 26px 0;
  padding: 0;
  list-style: none;
}

.contact-reasons li {
  position: relative;
  padding-left: 34px;
  color: #3a506f;
  font-size: clamp(1rem, 1.08vw, 1.12rem);
  line-height: 1.65;
  font-weight: 500;
}

.contact-reasons li::before {
  content: "";
  position: absolute;
  top: 0.28em;
  left: 0;
  width: 20px;
  height: 20px;
  border: 1.5px solid #5aa9c8;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
}

.contact-reasons li::after {
  content: "";
  position: absolute;
  top: 0.63em;
  left: 6px;
  width: 8px;
  height: 4px;
  border-bottom: 1.8px solid #5aa9c8;
  border-left: 1.8px solid #5aa9c8;
  transform: rotate(-45deg);
}

.contact-page-copy .contact-response-note {
  color: #455c79;
  font-weight: 500;
}

.contact-panel {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.contact-form {
  display: grid;
  gap: 18px;
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid rgba(202, 218, 240, 0.95);
  border-radius: 8px;
  color: #334968;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 48px rgba(7, 27, 87, 0.12);
}

.contact-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.contact-form label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.contact-form label span {
  color: #3a5274;
  font-size: 0.9rem;
  line-height: 1.5;
  font-weight: 600;
}

.contact-form label span::after {
  content: "必須";
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 8px;
  padding: 0 7px;
  border-radius: 999px;
  color: #1f56b8;
  background: #eaf3ff;
  font-size: 0.68rem;
  line-height: 1;
  font-weight: 600;
}

.contact-form label.optional span::after {
  content: "任意";
  color: #687997;
  background: #f0f4fa;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(170, 195, 230, 0.92);
  border-radius: 8px;
  color: #314967;
  background: #fff;
  font: inherit;
  font-size: 1rem;
  line-height: 1.6;
  outline: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.contact-form input,
.contact-form select {
  min-height: 50px;
  padding: 0 14px;
}

.contact-form textarea {
  resize: vertical;
  min-height: 146px;
  padding: 13px 14px;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #93a0b6;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: var(--blue);
  background: #fbfdff;
  box-shadow: 0 0 0 4px rgba(26, 91, 215, 0.14);
}

.contact-form input[aria-invalid="true"],
.contact-form select[aria-invalid="true"],
.contact-form textarea[aria-invalid="true"] {
  border-color: #d44545;
  box-shadow: 0 0 0 4px rgba(212, 69, 69, 0.12);
}

.field-error {
  display: none;
  color: #c73636;
  font-size: 0.88rem;
  line-height: 1.5;
  font-weight: 600;
}

.field-error.is-visible {
  display: block;
}

.submit-button {
  width: 100%;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 22px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #2c6ad7 0%, #2255b6 100%);
  box-shadow: 0 14px 24px rgba(18, 63, 158, 0.2);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
}

.submit-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(18, 63, 158, 0.26);
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.privacy-note,
.form-status {
  margin: 0;
  color: #536987;
  font-size: 0.9rem;
  line-height: 1.7;
  font-weight: 400;
}

.form-consent {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(202, 218, 240, 0.8);
  border-radius: 8px;
  background: #f8fbff;
}

.form-consent p {
  margin: 0;
  color: #5a6e89;
  font-size: 0.88rem;
  line-height: 1.7;
  font-weight: 400;
}

.consent-check {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: #3b5273;
  font-size: 0.92rem;
  line-height: 1.65;
}

.consent-check input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 5px 0 0;
  padding: 0;
  accent-color: var(--blue);
}

.consent-check span {
  min-width: 0;
  font-weight: 400;
}

.consent-check span::after {
  content: none;
}

.privacy-note a,
.consent-check a {
  color: var(--blue-strong);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.form-status {
  min-height: 1.4em;
  color: #526984;
  font-weight: 600;
  text-align: center;
}

.form-status.is-error {
  color: #c73636;
}

.form-status.is-pending {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #526984;
}

.form-status.is-pending::before {
  content: "";
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  border: 2px solid #d0daf0;
  border-top-color: #1a5bd7;
  border-radius: 50%;
  animation: sf-spin 0.75s linear infinite;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.confirm-page,
.thanks-page {
  width: min(100% - 48px, 980px);
  margin: 0 auto;
  padding: clamp(42px, 5vw, 68px) 0 clamp(58px, 7vw, 96px);
}

.contact-confirm,
.thanks-panel {
  padding: clamp(34px, 5vw, 64px);
  border: 1px solid rgba(202, 218, 240, 0.72);
  border-radius: 8px;
  color: #334968;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 42px rgba(7, 27, 87, 0.08);
}

.contact-confirm.is-empty .confirm-list,
.contact-confirm.is-empty .confirm-actions .submit-button {
  display: none;
}

.contact-confirm.is-empty .confirm-actions {
  margin-top: 22px;
}

.contact-form-head {
  margin-bottom: 24px;
}

.contact-form-head p:first-child,
.thanks-kicker {
  margin: 0 0 10px;
  color: #5a7fb4;
  font-size: 0.86rem;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.contact-form-head h1 {
  margin: 0 0 12px;
  color: #213961;
  font-size: clamp(1.72rem, 2.35vw, 2.26rem);
  line-height: 1.42;
  font-weight: 600;
}

.contact-form-head p:last-child {
  margin: 0;
  color: #526984;
  font-size: 1rem;
  line-height: 1.8;
  font-weight: 400;
}

.confirm-list {
  display: grid;
  margin: 0 0 24px;
  border-top: 1px solid rgba(202, 218, 240, 0.85);
}

.confirm-list div {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(202, 218, 240, 0.85);
}

.confirm-list dt {
  color: #3b5273;
  font-size: 0.92rem;
  font-weight: 600;
}

.confirm-list dd {
  min-width: 0;
  margin: 0;
  color: #334968;
  line-height: 1.75;
  font-weight: 400;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.confirm-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
}

.secondary-button {
  min-width: 160px;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border: 1px solid rgba(170, 195, 230, 0.92);
  border-radius: 8px;
  color: var(--blue-strong);
  background: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.confirm-actions .submit-button {
  width: min(100%, 320px);
  justify-content: center;
}

.thanks-copy {
  max-width: 760px;
  margin: 0 auto;
  min-width: 0;
  text-align: center;
}

.thanks-copy h1 {
  margin: 0 0 18px;
  color: #213961;
  font-size: clamp(1.92rem, 2.35vw, 2.42rem);
  line-height: 1.42;
  font-weight: 600;
}

.thanks-copy p:not(.thanks-kicker) {
  max-width: 38em;
  margin: 0 auto;
  color: #526984;
  font-size: clamp(0.98rem, 1.04vw, 1.08rem);
  line-height: 1.9;
}

@media (max-width: 900px) {
  .contact-page-section {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .contact-page-copy {
    position: static;
  }
}

@media (max-width: 620px) {
  .contact-form-grid {
    grid-template-columns: 1fr;
  }

  .contact-form {
    padding: 22px;
  }

  .contact-form input,
  .contact-form select {
    min-height: 54px;
  }

  .submit-button {
    min-height: 62px;
    padding-right: 18px;
    padding-left: 20px;
  }

  .confirm-page,
  .thanks-page {
    width: calc(100% - 40px);
    padding: 38px 0;
  }

  .confirm-list div {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 16px 0;
  }

  .confirm-actions {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 12px;
  }

  .confirm-actions .submit-button {
    width: min(100%, 260px);
  }

  .confirm-actions .secondary-button {
    width: auto;
    min-width: 0;
    min-height: auto;
    padding: 8px 4px;
    border: 0;
    color: #526984;
    background: transparent;
  }

  .thanks-copy h1 {
    font-size: clamp(1.58rem, 6.6vw, 2rem);
  }

  .contact-page-section {
    width: calc(100% - 40px);
    gap: 24px;
    padding-bottom: 48px;
  }

  .contact-page-copy {
    order: 2;
    text-align: left;
    padding-top: 0;
  }

  .contact-page-panel {
    order: 1;
  }

  .contact-reasons {
    gap: 10px;
    margin: 20px 0;
  }

  .contact-reasons li {
    padding-left: 30px;
    font-size: clamp(1rem, 4vw, 1.08rem);
  }
}
