/* ===== 色・書体 ===== */
:root {
  --beige: #f8e4c3;
  --navy: #12577f;
  --aqua: #2e8fa6;
  --text: #1b2b36;
  --sub: #3d4f5b;
  --white: #fff;
  --line: #7f95a3;      /* 入力欄の枠（白地に対して 3:1 以上） */
  --placeholder: #66767f;
  --accent: #b3441c;    /* 必須・注意（白地に対して 4.5:1 以上） */
  --info-bg: #e6f2f8;
  --error-bg: #fbeee8;

  --font-body: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Hiragino Sans', sans-serif;
  --font-hand: 'Caveat', cursive;
  --font-ticket: 'Oswald', 'Zen Maru Gothic', sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--beige);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: 0.04em;
}

img {
  max-width: 100%;
  display: block;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--navy);
}

:focus-visible {
  outline: 3px solid var(--aqua);
  outline-offset: 3px;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  overflow-x: clip;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hand {
  font-family: var(--font-hand);
  font-weight: 500;
  color: var(--aqua);
  line-height: 1.1;
  letter-spacing: 0;
}

/* ===== 招待状：トップ ===== */
.hero {
  position: relative;
  aspect-ratio: 780 / 1170;
  background: url('../assets/hero.jpg') center top / cover no-repeat;
  color: var(--white);
  text-align: center;
}

/* 砂浜から地のベージュへなじませる */
.hero::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 14%;
  background: linear-gradient(to bottom, rgba(248, 228, 195, 0), var(--beige));
  pointer-events: none;
}

.hero__inner {
  position: absolute;
  inset: 0;
  padding-top: 36%;
  z-index: 1;
  text-shadow: 0 1px 10px rgba(10, 60, 100, 0.45);
}

.hero__title {
  margin: 0;
  font-family: var(--font-hand);
  font-weight: 500;
  font-size: 48px;
  line-height: 1.1;
  letter-spacing: 0;
}

.hero__names {
  margin: 14px 0 0;
  font-size: 27px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.06em;
}

.hero__amp {
  font-weight: 500;
  margin: 0 0.15em;
}

.hero__date {
  margin: 14px 0 0;
  font-family: var(--font-ticket);
  font-weight: 500;
  font-size: 30px;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.hero__date small {
  font-size: 17px;
  margin-left: 0.4em;
  letter-spacing: 0.1em;
}

.hero__venue {
  display: inline-block;
  margin-top: 18px;
  padding: 6px 22px;
  border-radius: 999px;
  background: var(--white);
  color: var(--navy);
  font-size: 15px;
  font-weight: 700;
  text-shadow: none;
}

/* ===== 招待状：本文 ===== */
.greeting {
  padding: 8px 24px 0;
  text-align: center;
}

.greeting__title {
  margin: 0 0 12px;
  font-size: 34px;
}

.greeting p {
  margin: 0;
  line-height: 2.1;
}

.wave {
  width: 66%;
  max-width: 300px;
  height: auto;
  margin: 44px auto;
}

/* チケット風カード */
.ticket {
  position: relative;
  margin: 0 20px;
  padding: 28px 24px 20px;
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 16px;
}

.ticket__top {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-ticket);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--sub);
}

.ticket__title {
  margin: 16px 0 18px;
  font-family: var(--font-ticket);
  font-weight: 600;
  font-size: 36px;
  line-height: 1.08;
  letter-spacing: 0.02em;
  color: var(--navy);
}

.ticket__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  margin: 0;
}

.ticket__grid div {
  min-width: 0;
}

.ticket dt {
  font-family: var(--font-ticket);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--sub);
  line-height: 1.4;
}

.ticket dd {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

/* ミシン目 */
.ticket__perf {
  position: relative;
  margin: 22px -24px 16px;
  border-top: 2px dashed #9fb3c0;
}

.ticket__perf::before,
.ticket__perf::after {
  content: '';
  position: absolute;
  top: -12px;
  width: 22px;
  height: 22px;
  border: 2px solid var(--navy);
  border-radius: 50%;
  background: var(--beige);
}

.ticket__perf::before {
  left: -13px;
  clip-path: inset(0 0 0 50%);
}

.ticket__perf::after {
  right: -13px;
  clip-path: inset(0 50% 0 0);
}

.ticket__bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.ticket__bottom div:last-child {
  text-align: right;
}

/* 会場・食事・幹事 */
.info {
  padding: 48px 24px 0;
}

.info__section + .info__section {
  margin-top: 40px;
}

.info__heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
}

.info__name {
  margin: 0 0 6px;
  font-size: 16px;
}

.info__text {
  margin: 0;
  font-size: 14px;
  color: var(--sub);
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 8px;
  font-weight: 500;
  text-underline-offset: 4px;
}

.notice {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  padding: 16px 18px;
  background: var(--white);
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.9;
}

.notice .icon {
  color: var(--accent);
  margin-top: 3px;
}

.notice p {
  margin: 0;
}

/* 回答への誘導 */
.cta {
  padding: 0 24px 64px;
  text-align: center;
}

.cta__text {
  margin: 0 0 24px;
  font-size: 15px;
}

.cta__deadline {
  font-weight: 700;
}

.see-you {
  margin: 32px 0 0;
  font-size: 34px;
}

/* ===== ボタン ===== */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 58px;
  padding: 12px 24px;
  border: 2px solid var(--navy);
  border-radius: 999px;
  background: var(--navy);
  color: var(--white);
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, opacity 0.15s;
}

.btn:hover {
  background: #0d4566;
}

.btn--outline {
  display: inline-flex;
  width: auto;
  min-height: 48px;
  padding: 8px 28px;
  border-color: var(--line);
  background: var(--white);
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
}

.btn--outline:hover {
  background: #f2f6f8;
}

/* 必須項目がそろうまでは薄く表示（押すと足りない項目を案内する） */
.btn[aria-disabled='true'] {
  opacity: 0.45;
}

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* ===== 出欠フォーム ===== */
.rsvp-header {
  padding: 56px 24px 32px;
  text-align: center;
}

.rsvp-header__en {
  margin: 0;
  font-size: 40px;
}

.rsvp-header h1 {
  margin: 4px 0 6px;
  font-size: 26px;
  font-weight: 700;
}

.rsvp-header__deadline {
  margin: 0;
  font-size: 14px;
  color: var(--sub);
}

.card {
  margin: 0 20px;
  padding: 28px 22px 32px;
  background: var(--white);
  border-radius: 20px;
}

.field {
  margin: 0 0 28px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field__label {
  display: block;
  margin: 0 0 10px;
  padding: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
}

.req {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
}

.opt {
  font-weight: 700;
}

/* ボタン型の二択（中身はラジオボタン） */
.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.choice {
  position: relative;
}

.choice input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 8px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.choices--pill .choice span {
  border-radius: 999px;
}

.choice input:checked + span {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
  font-weight: 700;
}

.choice input:focus-visible + span {
  outline: 3px solid var(--aqua);
  outline-offset: 3px;
}

.input,
.select,
.textarea {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 12px 18px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* 16px 未満だと iPhone で拡大されてしまう */
  letter-spacing: 0.04em;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--placeholder);
}

.textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.7;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 48px;
  background: var(--white)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b2b36' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    right 16px center / 20px no-repeat;
}

.field__hint {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--sub);
  line-height: 1.7;
}

.field__error {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.6;
}

[aria-invalid='true'],
.choices.is-invalid .choice span {
  border-color: var(--accent);
}

/* 一緒に来る方（同伴者ごとの入力欄） */
.companion {
  margin: 16px 0 0;
  padding: 16px 16px 4px;
  border: 0;
  border-radius: 16px;
  background: #fbf3e4;
  min-width: 0;
}

.companion__title {
  float: left; /* legend を枠の内側に置く */
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}

.companion__field {
  clear: both;
  margin-bottom: 16px;
}

/* お食事についてのお願い */
.food-box {
  margin: 0 0 28px;
  padding: 20px 20px 10px;
  background: var(--info-bg);
  border-radius: 16px;
}

.food-box__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
}

.food-box__title .icon {
  color: var(--accent);
}

.food-box__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.9;
}

.check {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  margin-top: 6px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.check input {
  width: 26px;
  height: 26px;
  margin: 0;
  accent-color: var(--navy);
  flex: none;
  cursor: pointer;
}

.food-box.is-invalid {
  outline: 2px solid var(--accent);
}

/* ハニーポット（人間には見えない入力欄） */
.hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.alert {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--error-bg);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.7;
}

.alert:empty {
  display: none;
}

.submit-hint {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--sub);
  text-align: center;
}

.back {
  padding: 40px 24px 64px;
  text-align: center;
}

/* 完了画面 */
.thanks {
  padding: 56px 24px 52px;
  text-align: center;
}

.thanks__en {
  margin: 0;
  font-size: 52px;
}

.thanks h2 {
  margin: 14px 0 18px;
  font-size: 21px;
  font-weight: 700;
}

.thanks h2:focus {
  outline: none;
}

.thanks__text {
  margin: 0 0 28px;
  color: var(--sub);
  line-height: 2;
}

.thanks__note {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--sub);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
