:root {
  --navy: #171828;
  --wine: #892636;
  --red: #9a2837;
  --gold: #c89a46;
  --ivory: #f5efe4;
  --white: #fffdf9;
  --ink: #27242d;
  --muted: #6c666c;
  --line: #d8d0c4;
  --error: #a51f32;
  --sans: "Noto Sans JP", "Yu Gothic", "YuGothic", sans-serif;
  --serif: "Shippori Mincho", "Yu Mincho", "YuMincho", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--ivory);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--wine);
  text-underline-offset: 0.2em;
}

button,
input,
select,
textarea {
  font: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 14px;
  transform: translateY(-160%);
  background: var(--white);
  color: var(--navy);
}

.skip-link:focus {
  transform: none;
}

.site-header {
  color: var(--white);
  background: var(--navy);
  border-bottom: 1px solid rgba(200, 154, 70, 0.5);
}

.site-header__inner {
  width: min(calc(100% - 40px), 1040px);
  min-height: 74px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-family: var(--serif);
  font-weight: 600;
  text-decoration: none;
}

.site-brand__mark {
  width: 30px;
  height: 30px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-family: Georgia, serif;
}

.back-link {
  color: var(--white);
  font-size: 14px;
}

main {
  width: min(calc(100% - 40px), 920px);
  margin: 0 auto;
  padding-bottom: 100px;
}

.page-heading {
  padding: 70px 20px 42px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--wine);
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.page-heading h1,
.status-card h1 {
  margin: 0;
  color: var(--navy);
  font-family: var(--serif);
  font-size: clamp(31px, 5vw, 48px);
  line-height: 1.4;
  letter-spacing: 0.04em;
}

.page-heading > p:last-child {
  margin: 18px 0 0;
  color: var(--muted);
}

.sp-only {
  display: none;
}

.steps {
  margin: 0 auto 38px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  list-style: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.steps li {
  position: relative;
  padding-top: 36px;
  border-top: 2px solid var(--line);
}

.steps span {
  position: absolute;
  top: -15px;
  left: calc(50% - 15px);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--ivory);
}

.steps .is-current {
  border-color: var(--wine);
  color: var(--wine);
}

.steps .is-current span {
  border-color: var(--wine);
  background: var(--wine);
  color: var(--white);
}

.application-form,
.confirmation {
  display: grid;
  gap: 28px;
}

.form-section,
.confirm-section {
  padding: 42px 48px 48px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  border-radius: 4px;
  background: var(--white);
  box-shadow: 0 12px 32px rgba(23, 24, 40, 0.07);
}

.form-section__heading {
  margin-bottom: 34px;
  display: flex;
  align-items: baseline;
  gap: 15px;
  border-bottom: 1px solid var(--line);
}

.form-section__heading p {
  margin: 0;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 700;
}

.form-section__heading h2,
.confirm-section h2 {
  margin: 0 0 15px;
  color: var(--navy);
  font-family: var(--serif);
  font-size: 29px;
  line-height: 1.4;
}

.field,
.field-group,
.choice-field,
.consent-block {
  margin: 30px 0 0;
}

.form-section__heading + .field,
.form-section__heading + .field-group,
.form-section__heading + .choice-field,
.form-section__heading + .information-box,
.form-section__heading + .minor-note {
  margin-top: 0;
}

.field label,
.field-group legend,
.choice-field legend {
  display: block;
  color: var(--navy);
  font-weight: 700;
}

.field-group,
.choice-field {
  padding: 0;
  border: 0;
}

.required,
.optional {
  margin-left: 7px;
  padding: 2px 7px 3px;
  border-radius: 2px;
  font-size: 11px;
  line-height: 1;
  vertical-align: 0.1em;
}

.required {
  background: var(--wine);
  color: var(--white);
}

.optional {
  border: 1px solid var(--line);
  color: var(--muted);
}

.help {
  margin: 5px 0 9px;
  color: var(--muted);
  font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
  width: 100%;
  min-height: 50px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #aaa3a2;
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(200, 154, 70, 0.5);
  outline-offset: 2px;
  border-color: var(--wine);
}

[aria-invalid="true"] input,
[aria-invalid="true"] select,
[aria-invalid="true"] textarea,
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--error);
  background: #fff8f8;
}

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

.field--short {
  max-width: 340px;
}

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

.field--postal,
.address-grid .field:last-child {
  grid-column: 1 / -1;
}

.field--postal {
  max-width: 520px;
}

.inline-control {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.inline-control input {
  min-width: 0;
}

.sub-button {
  margin-top: 8px;
  padding: 0 18px;
  border: 1px solid var(--navy);
  border-radius: 3px;
  background: var(--white);
  color: var(--navy);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.choice-grid {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.choice-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-grid label,
.check-list label,
.consent-check {
  min-height: 52px;
  padding: 12px 15px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
}

input[type="radio"],
input[type="checkbox"] {
  width: 21px;
  height: 21px;
  margin: 2px 0 0;
  flex: 0 0 auto;
  accent-color: var(--wine);
}

.check-list {
  display: grid;
  gap: 10px;
}

.information-box,
.minor-note,
.line-alert {
  padding: 20px 24px;
  border-left: 4px solid var(--gold);
  background: #f7f1e7;
}

.information-box p,
.minor-note p,
.line-alert p {
  margin: 5px 0;
}

.information-box--plain {
  margin-top: 24px;
  border-left-color: var(--navy);
  background: #f1f1f4;
}

.change-alert {
  margin-top: 38px;
  padding: 24px;
  border: 2px solid var(--red);
  background: #fff7ed;
}

.change-alert p {
  margin: 7px 0 0;
}

.change-alert__label {
  margin-top: 0 !important;
  color: var(--red);
  font-weight: 700;
}

.conditional-field[hidden] {
  display: none;
}

.minor-note h3,
.consent-block h3 {
  margin: 0 0 8px;
  color: var(--navy);
  font-family: var(--serif);
  font-size: 21px;
}

.consent-block {
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.consent-block p {
  margin: 8px 0;
  font-size: 14px;
}

.consent-check {
  margin-top: 15px;
  border-color: var(--gold);
  font-weight: 600;
}

.field-error {
  margin: 7px 0 0;
  color: var(--error);
  font-size: 14px;
  font-weight: 700;
}

.error-summary {
  padding: 24px 28px;
  border: 2px solid var(--error);
  background: #fff4f4;
  color: var(--error);
}

.error-summary h2,
.error-summary p {
  margin: 0;
}

.error-summary h2 {
  font-size: 20px;
}

.error-summary p {
  margin-top: 7px;
}

.honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.form-actions,
.confirm-actions {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 16px;
}

.primary-button,
.secondary-button {
  min-height: 56px;
  padding: 14px 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  border: 1px solid var(--wine);
  background: var(--wine);
  color: var(--white);
}

.primary-button:hover {
  background: #74202e;
}

.secondary-button {
  border: 1px solid var(--navy);
  background: transparent;
  color: var(--navy);
}

.site-footer {
  padding: 32px 20px;
  color: rgba(255, 253, 249, 0.8);
  background: var(--navy);
  font-size: 13px;
  text-align: center;
}

.site-footer p {
  margin: 3px;
}

.site-footer a {
  color: var(--white);
}

.line-alert {
  width: min(100%, 760px);
  margin: 0 auto 28px;
  border: 2px solid var(--red);
  background: #fff4ea;
}

.line-alert strong {
  color: var(--red);
}

.confirm-section h2 {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.confirm-list {
  margin: 0;
}

.confirm-list > div {
  padding: 18px 0;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.confirm-list > div:last-child {
  border-bottom: 0;
}

.confirm-list dt {
  color: var(--muted);
  font-weight: 600;
}

.confirm-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.confirm-line {
  display: block;
}

.confirmed-consents {
  margin: 18px 0 0;
  padding-left: 1.4em;
}

.confirm-actions form {
  display: contents;
}

.submit-note {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.status-page {
  min-height: 100vh;
  padding: 48px 20px;
  display: grid;
  place-items: center;
  background: var(--navy);
}

.status-card {
  width: min(100%, 700px);
  padding: 58px 54px;
  border-top: 5px solid var(--gold);
  background: var(--white);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  text-align: center;
}

.complete-mark {
  width: 58px;
  height: 58px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  border: 2px solid var(--gold);
  border-radius: 50%;
  color: var(--wine);
  font-size: 30px;
  font-weight: 700;
}

.status-message {
  margin: 28px 0;
  padding: 20px;
  background: var(--ivory);
}

.status-message p {
  margin: 6px 0;
}

.receipt,
.contact-line {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 768px) {
  .site-header__inner {
    width: min(calc(100% - 28px), 1040px);
  }

  main {
    width: min(calc(100% - 28px), 920px);
    padding-bottom: 72px;
  }

  .page-heading {
    padding: 52px 8px 38px;
  }

  .form-section,
  .confirm-section {
    padding: 34px 30px 38px;
  }

  .field-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .confirm-list > div {
    grid-template-columns: 170px minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }

  .site-header__inner {
    min-height: 64px;
  }

  .site-brand {
    font-size: 13px;
  }

  .site-brand__mark {
    width: 27px;
    height: 27px;
  }

  .back-link {
    font-size: 12px;
  }

  main {
    width: min(calc(100% - 20px), 920px);
  }

  .sp-only {
    display: initial;
  }

  .page-heading {
    padding: 44px 4px 36px;
  }

  .page-heading h1 {
    font-size: 29px;
  }

  .steps {
    margin-bottom: 30px;
  }

  .steps li {
    font-size: 12px;
  }

  .form-section,
  .confirm-section {
    padding: 28px 18px 32px;
  }

  .form-section__heading {
    margin-bottom: 26px;
  }

  .form-section__heading h2,
  .confirm-section h2 {
    font-size: 24px;
  }

  .address-grid,
  .choice-grid--two {
    grid-template-columns: 1fr;
  }

  .field--postal,
  .address-grid .field:last-child {
    grid-column: auto;
  }

  .inline-control {
    flex-direction: column;
    gap: 0;
  }

  .sub-button {
    min-height: 48px;
  }

  .information-box,
  .minor-note,
  .line-alert,
  .change-alert {
    padding: 18px;
  }

  .confirm-list > div {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .confirm-actions {
    flex-direction: column-reverse;
  }

  .confirm-actions > *,
  .confirm-actions .primary-button,
  .confirm-actions .secondary-button {
    width: 100%;
  }

  .status-page {
    padding: 20px 10px;
  }

  .status-card {
    padding: 42px 20px;
  }

  .status-card h1 {
    font-size: 27px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
