/* ETC申込フォーム — 高齢・低ITリテラシー層を想定し、文字・タップ領域を大きく取る */
:root {
  --ink: #1a1a1a;
  --ink-sub: #555;
  --line: #c9cdd4;
  --accent: #0b5cab;
  --accent-dark: #084a8c;
  --bg: #f4f6f8;
  --card: #fff;
  --err: #c0271c;
  --ok: #1a7a3c;
  --pad-top: env(safe-area-inset-top, 0px);
  --pad-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: var(--pad-top) 0 calc(var(--pad-bottom) + 40px);
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 18px;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; }
[hidden] { display: none !important; }

/* --- ヘッダー --- */
.hd {
  background: var(--accent);
  color: #fff;
  padding: 24px 20px 20px;
}
.hd h1 { margin: 0; font-size: 26px; line-height: 1.4; letter-spacing: .02em; }
.hd-sub { margin: 12px 0 0; font-size: 16px; line-height: 1.6; opacity: .95; }

/* --- 質問ブロック --- */
form { padding: 0 16px; }

.q {
  background: var(--card);
  border-radius: 12px;
  padding: 20px 18px;
  margin: 16px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.q-label {
  display: block;
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 4px;
}
.q-label-gap { margin-top: 26px; }
.q-help {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--ink-sub);
  line-height: 1.6;
}
.sub-label {
  display: block;
  font-size: 15px;
  color: var(--ink-sub);
  margin: 14px 0 6px;
}
.req {
  display: inline-block;
  vertical-align: 3px;
  background: var(--err);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 4px;
  margin-left: 6px;
}

/* --- 入力欄 --- */
input[type="text"], input[type="tel"], input[type="date"], input[type="number"] {
  width: 100%;
  font-size: 18px;         /* iOSの自動ズーム防止のため16px以上 */
  font-family: inherit;
  padding: 14px 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 54px;
}
input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11,92,171,.18);
}
input.is-err { border-color: var(--err); background: #fff6f5; }
::placeholder { color: #a8adb5; }

.zip-status { margin: 8px 0 0; font-size: 15px; min-height: 1.7em; }
.zip-status.ok { color: var(--ok); }
.zip-status.ng { color: var(--err); }
.zip-status.load { color: var(--ink-sub); }

.q-intro {
  margin: 0 0 18px;
  padding: 12px 14px;
  background: #eaf2fb;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.7;
}
.subblock {
  margin-top: 10px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}

/* --- 選択肢（ラジオを大きなカードに） --- */
.choice { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.choice-item input { position: absolute; opacity: 0; width: 0; height: 0; }
.choice-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 72px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.choice-main { font-size: 18px; font-weight: 700; }
.choice-sub { font-size: 13px; color: var(--ink-sub); line-height: 1.4; margin-top: 2px; }
.choice-item input:checked + .choice-box {
  border-color: var(--accent);
  background: #eaf2fb;
  box-shadow: inset 0 0 0 1px var(--accent);
}
.choice-item input:focus-visible + .choice-box { box-shadow: 0 0 0 3px rgba(11,92,171,.35); }
.choice.is-err .choice-box { border-color: var(--err); }

/* --- 同意チェック（行全体をタップ領域に） --- */
.agree {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.agree input { flex: none; width: 28px; height: 28px; margin: 0; accent-color: var(--accent); }
.agree-text { font-weight: 700; line-height: 1.5; }
.agree:has(input:checked) { border-color: var(--accent); background: #eaf2fb; }
.agree-note { margin: 10px 0 0; font-size: 15px; color: var(--ink-sub); line-height: 1.6; }
.agree-note a { color: var(--accent); }
.agree.is-err { border-color: var(--err); background: #fff6f5; }

/* --- 写真 --- */
.photo-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.photo-list:empty { display: none; }
.photo-item { position: relative; border-radius: 8px; overflow: hidden; border: 2px solid var(--line); background: #000; }
.photo-item img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.photo-no {
  position: absolute; left: 6px; top: 6px;
  background: rgba(0,0,0,.65); color: #fff;
  font-size: 13px; padding: 2px 8px; border-radius: 10px;
}
.photo-del {
  position: absolute; right: 6px; top: 6px;
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.65); color: #fff;
  font-size: 20px; line-height: 1; cursor: pointer;
}

.btn-camera {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 64px;
  font-size: 19px; font-weight: 700; font-family: inherit;
  color: #fff; background: var(--accent);
  border: none; border-radius: 10px; cursor: pointer;
}
.btn-camera:active { background: var(--accent-dark); }
.cam-icon { font-size: 24px; }

.btn-sub {
  display: block; width: 100%; min-height: 52px; margin-top: 10px;
  font-size: 16px; font-family: inherit;
  color: var(--accent); background: #fff;
  border: 2px solid var(--line); border-radius: 10px; cursor: pointer;
}
.photo-err {
  margin: 12px 0 0; padding: 12px 14px;
  background: #fff6f5; border: 2px solid var(--err); border-radius: 10px;
  color: var(--err); font-size: 16px; line-height: 1.7; white-space: pre-line;
}
.photo-note { margin: 10px 0 0; font-size: 13px; color: var(--ink-sub); line-height: 1.6; }

/* --- 送信 --- */
.btn-submit {
  display: block; width: 100%; min-height: 70px;
  margin: 26px 0 0;
  font-size: 22px; font-weight: 700; font-family: inherit;
  color: #fff; background: var(--ok);
  border: none; border-radius: 12px; cursor: pointer;
}
.btn-submit:active { background: #15632f; }
.btn-submit:disabled { background: #9aa0a6; cursor: default; }

.err-box {
  margin: 20px 0 0; padding: 14px 16px;
  background: #fff6f5; border: 2px solid var(--err); border-radius: 10px;
  color: var(--err); font-size: 16px; line-height: 1.7; white-space: pre-line;
}
.foot-note { margin: 16px 0 0; font-size: 14px; color: var(--ink-sub); text-align: center; }

/* --- 撮影画面 --- */
.cam { position: fixed; inset: 0; background: #000; z-index: 50; }
.cam video { width: 100%; height: 100%; object-fit: cover; }
.cam-guide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.cam-frame {
  width: 86%; aspect-ratio: 1.4 / 1;
  border: 3px solid #fff;
  border-radius: 6px;
  box-shadow: 0 0 0 100vmax rgba(0,0,0,.45);
  position: relative;
}
.cam-frame-text {
  position: absolute; left: 0; right: 0; bottom: -44px;
  text-align: center; color: #fff; font-size: 16px;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
}
.cam-bar {
  position: absolute; left: 0; right: 0;
  bottom: calc(var(--pad-bottom) + 24px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}
.cam-shutter {
  width: 78px; height: 78px; border-radius: 50%;
  background: #fff; border: 5px solid rgba(255,255,255,.45);
  cursor: pointer; padding: 0;
}
.cam-cancel, .cam-spacer { width: 88px; }
.cam-cancel {
  background: none; border: none; color: #fff;
  font-size: 17px; font-family: inherit; text-align: left; cursor: pointer;
}

/* --- 送信中オーバーレイ --- */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.overlay-card {
  background: #fff; border-radius: 14px;
  padding: 32px 24px; text-align: center;
  width: 100%; max-width: 340px;
}
.overlay-text { margin: 18px 0 0; font-size: 19px; line-height: 1.7; white-space: pre-line; }
.overlay-card.done .overlay-text { font-weight: 700; }
.spinner {
  width: 48px; height: 48px; margin: 0 auto;
  border: 5px solid #dfe3e8; border-top-color: var(--accent);
  border-radius: 50%; animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.overlay-card .btn-sub { margin-top: 22px; }

/* --- 画面が広い端末 --- */
@media (min-width: 560px) {
  .hd, form { max-width: 560px; margin-left: auto; margin-right: auto; }
  .hd { border-radius: 0 0 14px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 3s; }
}
