:root {
  --ink: #1d2b36;
  --sub: #5d6d7a;
  --line: #cdd8e0;
  --bg: #eef4f7;
  --card: #fff;
  --sea: #0a7ea4;
  --sea-dark: #075d7a;
  --sea-pale: #e3f3f9;
  --sand: #fff6e0;
  --sand-line: #e8c56a;
  --err: #c62828;
  --err-pale: #fdecec;
  --ok: #2e7d32;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: min(3.4vmin, 14px);
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--sea); }
.page { max-width: 640px; margin: 0 auto; background: var(--card); min-height: 100vh; }
.content { padding: 16px 16px 40px; }

/* 大会ロゴ(白い帯の中央に表示) */
.brand { background: #fff; text-align: center; padding: 16px 16px 8px; }
.brand img { display: block; width: 100%; max-width: 360px; height: auto; margin: 0 auto; }

/* ヒーロー(キービジュアル画像が決まったら assets/hero.jpg を置き、background-image を差し替える) */
.hero {
  position: relative;
  padding: 36px 16px 28px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(4, 60, 90, .15), rgba(4, 60, 90, .55)),
    linear-gradient(160deg, #3cc3d6 0%, #0a7ea4 55%, #06506e 100%);
  border-radius: 1em;
  margin: 1em;
}
.hero .eyebrow { font-size: 12px; letter-spacing: .12em; opacity: .9; }
.hero h1 { font-size: 22px; line-height: 1.4; margin: 6px 0 8px; }
.hero h1 > span { display: block; }
.hero h1 .edition { font-size: 15px; font-weight: normal; opacity: .95; margin-top: 2px; }
.hero h1 .form-name { margin-top: 6px; }
.hero .meta { font-size: 13px; opacity: .95; }

.steps { display: flex; gap: 4px; margin: 16px 0; padding: 0; list-style: none; }
.steps li {
  flex: 1; text-align: center; font-size: .9em; padding: 6px 0;
  background: var(--bg); color: var(--sub); border-radius: 4px;
}
.steps li.on { background: var(--sea); color: #fff; font-weight: bold; }

.info {
  border-left: 4px solid var(--sea);
  background: var(--sea-pale);
  padding: 10px 12px;
  font-size: 1em;
  margin: 10px 0;
  border-radius: 0 6px 6px 0;
}
.info.warn { border-left-color: var(--sand-line); background: var(--sand); }
.info.alert { border-left-color: var(--err); background: var(--err-pale); color: var(--err); }
.info p { margin: 0 0 4px; }
.info p:last-child { margin-bottom: 0; }

.sec {
  font-size: 17px; margin: 48px 0 12px; padding-bottom: 6px;
  border-bottom: 2px solid var(--sea);
  scroll-margin-top: 12px;
}
.sec .no { color: var(--sea); margin-right: 4px; }

.field { margin: 28px 0; }
.field > .label, .field > label.label {
  display: block; font-size: 1em; font-weight: bold; margin-bottom: 8px;
}
.req, .opt {
  display: inline-block; font-size: .8em; font-weight: normal; line-height: 1.6;
  padding: 0 6px; margin-left: 6px; border-radius: 3px; vertical-align: 1px;
}
.req { background: var(--err); color: #fff; }
.opt { background: #dfe6eb; color: var(--sub); }
.hint { font-size: .9em; color: var(--sub); margin: 6px 0 0; }

input[type=text], input[type=email], input[type=tel], select, textarea {
  width: 100%;
  font-size: 16px; /* iOSの自動ズーム防止 */
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--sub) 50%), linear-gradient(135deg, var(--sub) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--sea); outline-offset: 0; border-color: var(--sea); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.zip-row { display: flex; gap: 8px; }
.zip-row input { flex: 1; min-width: 0; }
.zip-btn {
  flex: none; padding: 0 16px; font-size: 16px; font-weight: bold; font-family: inherit;
  background: #fff; color: var(--sea); border: 1px solid var(--sea); border-radius: 6px; cursor: pointer;
}
.zip-btn:hover { background: var(--sea-pale); }
.zip-btn[disabled] { opacity: .6; cursor: wait; }
.zip-msg { font-size: .95em; margin: 4px 0 0; min-height: 0; }
.zip-msg:empty { display: none; }
.zip-msg.error { color: var(--err); }
.zip-row + .zip-msg + select, .zip-row + select { margin-top: 10px; }
select + input { margin-top: 10px; }
.row + .row, .row + input, input + input, .row + select { margin-top: 10px; }
.stack > * + * { margin-top: 10px; }

.has-error input, .has-error select, .has-error textarea, .has-error .choice { border-color: var(--err); }
.error-msg { color: var(--err); font-size: .95em; margin: 4px 0 0; }
.error-msg::before { content: "! "; font-weight: bold; }

/* ラジオ・チェックボックスのカード */
.choice {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 14px; margin: 10px 0; background: #fff; cursor: pointer;
}
/* ブラウザ標準の描画(Safari等のフォーカスリングを含む)を使わず自前で描く */
.choice input {
  appearance: none; -webkit-appearance: none;
  margin: 3px 0 0; width: 20px; height: 20px; flex: none;
  border: 2px solid #8a9aa6; background: #fff; cursor: pointer;
  display: grid; place-content: center;
}
.choice input[type=radio] { border-radius: 50%; }
.choice input[type=checkbox] { border-radius: 4px; }
.choice input:checked { border-color: var(--sea); }
.choice input[type=radio]:checked::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--sea);
}
.choice input[type=checkbox]:checked { background: var(--sea); }
.choice input[type=checkbox]:checked::before {
  content: ""; width: 5px; height: 10px; margin-top: -2px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.choice input:disabled { background: #eef1f3; cursor: not-allowed; }
.choice b { display: block; font-size: 1.05em; }
.choice small { display: block; font-size: .9em; color: var(--sub); line-height: 1.6; margin-top: 2px; }
.choice input:focus { outline: none; }
/* キーボード操作時のみ、カード全体でフォーカス位置を示す */
.choice:has(input:focus-visible) { box-shadow: 0 0 0 2px var(--sea); }
.choice:has(input:checked) { border-color: var(--sea); background: var(--sea-pale); }
.choice.rec { border-width: 2px; }
.choice.disabled { opacity: .5; cursor: not-allowed; }
.badge {
  display: inline-block; font-size: .8em; font-weight: bold;
  background: var(--sand-line); color: #5a4200;
  padding: 0 8px; margin-left: 6px; border-radius: 10px; vertical-align: 2px;
}

/* 条件表示ブロック */
.cond {
  border-left: 3px solid var(--sea);
  margin: 4px 0 12px 12px;
  padding: 2px 0 2px 12px;
}
[hidden] { display: none !important; }

.total {
  display: flex; justify-content: space-between; align-items: baseline;
  background: var(--sea-pale); border-radius: 8px; padding: 12px 14px; margin: 10px 0;
}
.total strong { font-size: 22px; color: var(--sea-dark); }

.agree-box {
  border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px;
  max-height: 220px; overflow-y: auto; font-size: .95em; background: #fafcfd;
}
.agree-box ul { margin: 0; padding-left: 1.2em; }
.agree-box li { margin-bottom: 4px; }

.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 52px; margin: 20px 0 6px;
  font-size: 16px; font-weight: bold; font-family: inherit;
  background: var(--sea); color: #fff; border: none; border-radius: 8px;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--sea-dark); }
.btn.secondary { background: #fff; color: var(--sea); border: 1px solid var(--sea); }
.btn.line { background: #06c755; }
.btn[disabled] { background: #b7c3cb; color: #fff; cursor: not-allowed; }
.submit-hint {
  font-size: .95em; color: var(--err); background: var(--err-pale);
  border-radius: 8px; padding: 10px 14px; margin: 0 0 8px;
}
.submit-hint p { margin: 0 0 4px; font-weight: bold; }
.submit-hint ul { margin: 0; padding-left: 1.2em; }
.submit-hint li { margin: 2px 0; }
.submit-hint a { color: var(--err); font-weight: bold; }
.note-center { font-size: .9em; color: var(--sub); text-align: center; margin: 0; }

.error-summary {
  border: 2px solid var(--err); background: var(--err-pale); color: var(--err);
  border-radius: 8px; padding: 12px 14px; margin: 16px 0; font-size: 1em;
}
.error-summary ul { margin: 6px 0 0; padding-left: 1.2em; }

/* 確認画面 */
.summary { margin: 0 0 8px; }
.summary h2 { font-size: 15px; margin: 24px 0 6px; padding-bottom: 4px; border-bottom: 2px solid var(--sea); }
.summary dl { margin: 0; display: grid; grid-template-columns: 9em 1fr; }
.summary dt, .summary dd { padding: 8px 4px; border-bottom: 1px solid #edf1f4; font-size: 1em; }
.summary dt { color: var(--sub); }
.summary dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 420px) {
  .summary dl { grid-template-columns: 1fr; }
  .summary dt { border-bottom: none; padding-bottom: 0; font-size: .9em; }
}

/* 完了画面 */
.done-mark {
  width: 64px; height: 64px; margin: 24px auto 8px; border-radius: 50%;
  background: var(--sea); color: #fff; font-size: 34px;
  display: flex; align-items: center; justify-content: center;
}
.done-title { text-align: center; font-size: 20px; margin: 0 0 16px; }
.entry-no {
  text-align: center; border: 2px dashed var(--sea); border-radius: 10px; padding: 14px; margin: 12px 0;
}
.entry-no span { display: block; font-size: .9em; color: var(--sub); }
.entry-no strong { font-size: 28px; letter-spacing: .06em; color: var(--sea-dark); }

/* カード決済(Square Web Payments SDK) */
.card-pay { border: 2px solid var(--sea); border-radius: 10px; padding: 16px; margin: 24px 0 8px; }
.card-pay-title { font-size: 16px; margin: 0 0 8px; }
.card-container { min-height: 90px; margin: 12px 0 4px; }
.card-pay-error {
  color: var(--err); background: var(--err-pale); border-radius: 6px;
  padding: 8px 12px; margin: 8px 0 0; font-size: .95em;
}

footer.site { text-align: center; font-size: .9em; color: var(--sub); padding: 24px 16px 32px; }

/* テストモード(Squareのsandbox)で受付中の表示 */
.test-mode {
  background: #fff3d6;
  color: #8a6100;
  border: 1px solid #e8c56a;
  border-radius: 8px;
  margin: 1em 1em 0;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: bold;
  text-align: center;
}
