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

:root {
  --bg:       #ffffff;
  --surface:  #ffffff;
  --soft:     #f7f8fa;
  --border:   #e5e7eb;
  --text:     #1f2328;
  --muted:    #59636e;
  --accent:   #e8590c;
  --accent-d: #c2410c;
  --danger:   #b42318;
  --ok:       #1a7f37;
  --radius:   10px;
}

body {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  padding: 40px 16px 80px;
  min-height: 100vh;
}

a { color: var(--accent-d); }

.wrapper { max-width: 720px; margin: 0 auto; }

/* ── ヘッダー ── */
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--accent-d);
  background: #fff4ec;
  border: 1px solid #fdd8bf;
  border-radius: 999px;
  padding: 2px 12px;
  margin-bottom: 14px;
}

.title {
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 800;
  letter-spacing: -.01em;
  margin-bottom: 12px;
}

.subtitle {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 20px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  font-size: 14px;
}
.facts div {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  background: var(--soft);
}
.facts span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.divider { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

/* ── 契約書 ── */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.side-link { font-size: 13px; }

.section-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: 10px;
}

.contract-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  max-height: 380px;
  overflow-y: auto;
  background: var(--surface);
  font-size: 13.5px;
  line-height: 1.85;
  color: #333;
  margin-bottom: 8px;
}
.contract-box:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.contract-box::-webkit-scrollbar { width: 6px; }
.contract-box::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 3px; }
.contract-box::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

.contract-box h3 {
  font-size: 13.5px;
  font-weight: 700;
  margin: 18px 0 4px;
  color: var(--text);
}
.contract-box p { margin-bottom: 6px; }
.contract-box ol { padding-left: 1.6em; margin-bottom: 6px; }
.contract-box li { margin-bottom: 3px; }
.contract-box ol.items { list-style: none; counter-reset: it; padding-left: 2.4em; }
.contract-box ol.items > li { counter-increment: it; position: relative; }
.contract-box ol.items > li::before { content: "(" counter(it) ")"; position: absolute; left: -2.4em; }
.contract-foot {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid #ddd;
  font-size: 12px;
  color: #888;
}

.scroll-hint {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}
.scroll-hint.done { color: var(--ok); font-weight: 600; }

.penalty-note {
  background: #fff6f5;
  border: 1px solid #f5c2bd;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--danger);
  font-weight: 600;
  margin-bottom: 28px;
  line-height: 1.75;
}

/* ── フォーム ── */
.form-group { margin-bottom: 18px; }

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
label .req { color: var(--danger); margin-left: 3px; }

input[type="text"],
input[type="email"] {
  width: 100%;
  border: 1px solid #cfd4da;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
  background: var(--surface);
  color: var(--text);
}
input[type="text"]:focus,
input[type="email"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #fde3d2; }

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

.agree-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
  cursor: pointer;
  font-weight: 400;
}
.agree-wrap.is-locked { opacity: .55; cursor: not-allowed; }
.agree-wrap input[type="checkbox"] {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--accent);
}
.agree-wrap.is-locked input[type="checkbox"] { cursor: not-allowed; }
.agree-wrap .agree-text { font-size: 13px; line-height: 1.75; color: var(--muted); }
.agree-wrap .agree-text strong { color: var(--text); font-size: 14px; }

.btn-submit {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn-submit:hover:not(:disabled) { background: var(--accent-d); }
.btn-submit:active:not(:disabled) { transform: scale(.99); }
.btn-submit:disabled { opacity: .45; cursor: not-allowed; }

#error-msg {
  display: none;
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: #fff6f5;
  border: 1px solid #f5c2bd;
  border-radius: 8px;
}

.note-small { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.7; }
.note-small.center { text-align: center; }

/* ── 申請完了 ── */
#success-card {
  display: none;
  border: 1px solid #b7e1c2;
  background: #f1faf3;
  border-radius: var(--radius);
  padding: 26px 22px;
  text-align: center;
  margin-top: 8px;
}
#success-card h2 { font-size: 20px; font-weight: 800; margin-bottom: 14px; color: var(--ok); }

.receipt {
  margin: 0 auto 20px;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  max-width: 100%;
}
.receipt th, .receipt td { padding: 7px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.receipt th { background: var(--soft); white-space: nowrap; font-weight: 600; }
.receipt td { word-break: break-all; }
.receipt tr:last-child th, .receipt tr:last-child td { border-bottom: none; }

.btn-download {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 700;
  transition: background .15s;
}
.btn-download:hover { background: var(--accent-d); }

/* ── はじめかた ── */
.steps { list-style: none; counter-reset: s; margin-bottom: 20px; }
.steps li {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px 12px 54px;
  margin: 10px 0;
  font-size: 15px;
}
.steps li::before {
  counter-increment: s;
  content: counter(s);
  position: absolute;
  left: 14px;
  top: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps li p { font-size: 13.5px; color: var(--muted); margin-top: 4px; }

.tip {
  border-left: 4px solid var(--accent);
  background: #fffaf6;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 12px 0 28px;
  font-size: 13.5px;
  line-height: 1.8;
}

.plain { font-size: 14px; margin-bottom: 10px; }

table.cost { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.cost th, table.cost td { border-bottom: 1px solid var(--border); padding: 8px; text-align: left; vertical-align: top; }
table.cost th { background: var(--soft); }

code {
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 12.5px;
  background: #f0f1f3;
  padding: 1px 6px;
  border-radius: 4px;
  word-break: break-all;
}

.footer {
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: #9aa1a9;
  text-align: center;
}

@media (max-width: 560px) {
  body { padding-top: 28px; }
  .contract-box { padding: 16px 14px; max-height: 60vh; }
  .receipt th { white-space: normal; }
  table.cost { font-size: 12.5px; }
}

/* ── 大事な点・同意の確認事項 ── */
.penalty-note .pn-head { font-weight: 800; margin-bottom: 4px; }
.penalty-note ul { padding-left: 1.2em; margin-bottom: 8px; }
.penalty-note li { margin-bottom: 4px; }
.penalty-note .pn-ok { color: var(--ok); }
.agree-wrap .agree-list { display: block; margin-top: 4px; }
.agree-wrap .agree-list span { display: block; padding-left: 1em; text-indent: -1em; margin-bottom: 2px; }
