:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #1b2430;
  --muted: #5d6b7e;
  --line: #d6dde7;
  --brand: #0f3d63;
  --brand-ink: #ffffff;
  --accent: #1a7f6b;
  --danger: #c0392b;
  --warn-bg: #fff4d6;
  --warn-ink: #6b4a00;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
[hidden] { display: none !important; }

.banner { padding: 8px 16px; font-size: 13px; text-align: center; }
.banner.demo { background: #e8f0fa; color: var(--brand); }
.banner.warn { background: var(--warn-bg); color: var(--warn-ink); display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }

.banner.info { background: #e6f4ee; color: #14573f; display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; }
.banner.info .link { color: #14573f; font-size: 13px; }

.top { background: var(--brand); color: var(--brand-ink); padding: 18px 0 14px; }
.brand-text { display: block; margin: 0 0 12px; font-size: 14px; letter-spacing: .18em; opacity: .85; }
.logo { display: block; width: 190px; max-width: 60%; height: auto; margin: 0 0 12px; }
.top h1 { margin: 2px 0 12px; font-size: 18px; line-height: 1.5; font-weight: 700; word-break: auto-phrase; }
.progress { height: 6px; background: rgba(255, 255, 255, .25); border-radius: 3px; overflow: hidden; }
#progress-bar { height: 100%; width: 0; background: #7fd8c3; transition: width .3s ease; }
.progress-text { margin: 6px 0 0; font-size: 12px; min-height: 18px; opacity: .9; }

html { scroll-padding-bottom: 120px; }
main.wrap { padding-top: 16px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
#stage { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 18px 8px; }
.step-title { margin: 0 0 14px; font-size: 20px; color: var(--brand); }
.intro { margin-bottom: 18px; font-size: 15px; }
.intro h3 { margin: 18px 0 6px; font-size: 15px; color: var(--brand); }
.intro ol, .intro ul { padding-left: 1.3em; margin: 6px 0; }
.intro li { margin: 6px 0; }
.intro small { color: var(--muted); }
.note { background: #f0f4f9; border-left: 3px solid var(--brand); padding: 8px 12px; font-size: 14px; color: var(--muted); border-radius: 4px; }

.lead { margin: -6px 0 18px; color: var(--muted); font-size: 14px; }

/* ご用意いただくもの */
.prep { margin: 18px 0 20px; padding: 18px 16px 8px; background: #faf8f2; border: 2px solid #e9e2cb; border-radius: 12px; }
.prep-head { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.prep-no { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 8px; background: #1c2745; color: #fff; font-weight: 700; letter-spacing: .06em; border-radius: 4px; }
.intro .prep-head h3 { margin: 0; font-size: 18px; letter-spacing: .12em; color: #1c2745; }
.intro .prep-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 6px 20px; }
.intro .prep-grid li { display: flex; gap: 12px; margin: 0; padding: 8px 0 10px; }
.prep-n { flex: none; display: grid; place-items: center; width: 30px; height: 30px; margin-top: 2px; background: #c9a85c; color: #fff; font-weight: 700; font-size: 14px; border-radius: 50%; }
.prep-grid b { display: block; font-size: 15px; color: #1c2745; line-height: 1.5; }
.prep-grid p { margin: 2px 0 0; font-size: 13px; line-height: 1.65; color: #4b5565; }
.prep-grid small { display: block; margin-top: 2px; font-size: 12px; color: #8a8f99; }

/* 補足ブロック */
.note-block { margin: 6px 0 20px; }
.note-block.section { padding: 10px 0 0; border-top: 2px solid var(--line); }
.note-block h3 { margin: 6px 0 8px; font-size: 16px; color: var(--brand); line-height: 1.5; }
.note-block p { margin: 6px 0; font-size: 14px; color: var(--muted); }
.note-block ul { margin: 6px 0 0; padding-left: 1.3em; font-size: 14px; color: var(--muted); }
.note-block.warn { padding: 10px 14px; background: var(--warn-bg); color: var(--warn-ink); border-radius: 8px; font-size: 14px; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inwrap { display: flex; align-items: stretch; gap: 8px; }
.inwrap input { flex: 1; min-width: 0; }
.affix { display: flex; align-items: center; color: var(--muted); font-size: 14px; white-space: nowrap; }

.field { margin: 0 0 22px; }
.lbl { display: block; font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.req, .opt { display: inline-block; margin-left: 8px; padding: 0 6px; font-size: 11px; font-weight: 600; border-radius: 3px; vertical-align: 1px; }
.req { background: #fde8e5; color: var(--danger); }
.opt { background: #eceff3; color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); margin-bottom: 6px; line-height: 1.6; }
.hint a { color: var(--brand); }
.hint ul { margin: 4px 0 0; padding-left: 1.2em; }
.hint li { margin: 4px 0; }

input[type=text], input[type=email], input[type=tel], input[type=date], select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid #b9c4d2;
  border-radius: 8px;
  appearance: none;
  -webkit-appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, #5d6b7e 50%), linear-gradient(135deg, #5d6b7e 50%, transparent 50%);
  background-position: calc(100% - 20px) 20px, calc(100% - 14px) 20px;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(26, 127, 107, .3); border-color: var(--accent); }
.has-error input[type=text], .has-error input[type=email], .has-error input[type=tel], .has-error input[type=date], .has-error select, .has-error textarea { border-color: var(--danger); background: #fff8f7; }
.err { color: var(--danger); font-size: 13px; margin-top: 4px; min-height: 0; }
.err:empty { display: none; }

.radios { display: flex; flex-wrap: wrap; gap: 8px; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.radio, .check { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 14px; border: 1px solid #b9c4d2; border-radius: 8px; background: #fff; cursor: pointer; }
.check { border-color: var(--line); background: #f8fafc; }
.radio:has(input:checked), .check:has(input:checked) { border-color: var(--accent); background: #eaf6f3; }
.radio input, .check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }

.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file { display: flex; flex-direction: column; gap: 10px; }
.file-preview { display: flex; align-items: center; gap: 12px; }
.file-preview:empty { display: none; }
.file-preview img, .file-preview .pdf { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #eef1f5; display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.file-preview .meta { flex: 1; min-width: 0; font-size: 13px; }
.fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsize { color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; font: inherit; font-weight: 700; border-radius: 10px; border: 1px solid transparent; cursor: pointer; }
.btn.primary { background: var(--brand); color: var(--brand-ink); flex: 1; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.ghost { background: #fff; color: var(--brand); border-color: var(--brand); }
.link { background: none; border: 0; padding: 4px; color: var(--brand); text-decoration: underline; font: inherit; font-size: 14px; cursor: pointer; }

.nav { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 10px; margin: 28px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.submit-error { background: #fdecea; color: var(--danger); border-radius: 8px; padding: 12px 14px; font-size: 14px; margin: 14px 0 0; }

.summary { margin-bottom: 16px; }
.sum-sec { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
.sum-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: #f1f5f9; }
.sum-head h3 { margin: 0; font-size: 14px; }
.sum-sec dl { margin: 0; padding: 4px 12px 8px; }
.sum-sec .row { display: flex; flex-direction: column; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.sum-sec .row:last-child { border-bottom: 0; }
.sum-sec dt { font-size: 12px; color: var(--muted); }
.sum-sec dd { margin: 0; font-size: 15px; word-break: break-all; white-space: pre-wrap; }

.done { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 20px; text-align: center; }
.done-icon { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 30px; display: grid; place-items: center; }
.done h2 { margin: 0 0 8px; color: var(--brand); }
.done .no b { font-size: 22px; letter-spacing: .04em; }
.done .mailed { font-size: 14px; color: var(--muted); }
.done-body { text-align: left; margin: 20px 0 8px; font-size: 14px; color: #4b5565; }
.done-body p { margin: 0 0 14px; }
.done-body .sender { padding: 10px 14px; background: #f0f4f9; border-radius: 8px; color: var(--ink); }
.done-body .sender b { font-size: 15px; word-break: break-all; }
.btn.cta { margin: 6px auto 4px; background: #1a7f9b; color: #fff; border-radius: 999px; text-decoration: none; padding: 0 28px; }
/* お申込みの流れ */
.flow { margin-top: 32px; text-align: left; }
.flow .prep-head h3 { margin: 0; font-size: 18px; letter-spacing: .08em; color: #1c2745; }
.flow-group { display: grid; grid-template-columns: 72px 1fr; gap: 8px; margin-bottom: 12px; }
.flow-time { position: relative; display: grid; place-items: center; min-height: 100%; background: #e7eefc; }
.flow-time::before { content: ""; position: absolute; top: 16px; bottom: 16px; left: 50%; width: 3px; margin-left: -1.5px; background: #2f6ba6; }
.ah { position: absolute; left: 50%; margin-left: -8px; width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; }
.ah.up { top: 4px; border-bottom: 14px solid #2f6ba6; }
.ah.down { bottom: 4px; border-top: 14px solid #2f6ba6; }
.flow-time-label { position: relative; z-index: 1; padding: 4px 2px; background: #fff; font-size: 11px; white-space: nowrap; font-weight: 700; line-height: 1.4; text-align: center; color: #1c2745; }
.flow-time-label small { display: block; font-size: 9px; font-weight: 400; color: #6b7280; white-space: normal; }
.flow-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.flow-step { display: flex; gap: 10px; padding: 10px; background: #fff; border: 2px solid #ece7d8; border-radius: 6px; }
.flow-step.is-customer { background: #fbf5e4; border-color: #dcc486; }
.step-badge { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 46px; padding: 6px 0 4px; background: #c9a85c; color: #fff; border-radius: 3px; }
.step-badge b { font-size: 18px; line-height: 1.2; }
.step-badge span { font-size: 9px; letter-spacing: .08em; }
.step-badge em { margin-top: 2px; padding: 1px 3px; background: #1c2745; font-size: 8px; font-style: normal; line-height: 1.4; white-space: nowrap; border-radius: 2px; }
.step-body { min-width: 0; }
.step-body h4 { margin: 0 0 3px; font-size: 13px; line-height: 1.5; color: #1c2745; }
.step-desc, .step-note { margin: 0; font-size: 11.5px; line-height: 1.65; color: #4b5565; }
.step-desc b { color: #b8893a; font-weight: 700; }
.step-note { margin-top: 2px; color: #8a8f99; }
.step-link { display: inline-block; margin-top: 4px; font-size: 11.5px; font-weight: 700; color: #1d6fd6; }

.overlay { position: fixed; inset: 0; background: rgba(20, 30, 45, .55); display: grid; place-items: center; z-index: 10; }
.overlay-box { background: #fff; border-radius: 12px; padding: 24px 28px; text-align: center; max-width: 300px; }
.spinner { width: 36px; height: 36px; margin: 0 auto 12px; border: 4px solid #dfe6ee; border-top-color: var(--brand); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 720px) {
  #stage { padding: 28px 28px 12px; }
  .nav { margin: 28px 0 0; border: 1px solid var(--line); border-radius: 12px; }
  .intro .prep-grid { grid-template-columns: 1fr 1fr; }
  .sum-sec .row { flex-direction: row; gap: 16px; }
  .sum-sec dt { width: 42%; flex: none; }
}
@media (prefers-reduced-motion: reduce) { #progress-bar, .spinner { transition: none; animation: none; } }
