/* 合格証明書の申し込み（apps/apply/certificate）の見た目
   - 見本 iken-site/design/apply-form/sample.html の色と形を引き継ぐ
   - スマホの幅を先に考え、広い画面では中央に 640px まで
   - 外のフォントは読まない（CSP を狭く保つため。端末の日本語フォントを使う） */
:root {
  --bg: #f7f6f2;
  --paper: #ffffff;
  --ink: #1e2320;
  --muted: #5b625d;
  --line: #d9dcd6;
  --line-strong: #b9beb7;
  --green: #1f6b3a;
  --green-soft: #e7f0ea;
  --red: #b3261e;
  --red-soft: #fbeceb;
  --f-head: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
  --f-body: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151816; --paper: #1e2220; --ink: #e9ece8; --muted: #a9b0aa; --line: #343a36; --line-strong: #4a514c;
    --green: #6cc28b; --green-soft: #1f2e25; --red: #ff7a70; --red-soft: #3a1c1a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151816; --paper: #1e2220; --ink: #e9ece8; --muted: #a9b0aa; --line: #343a36; --line-strong: #4a514c;
  --green: #6cc28b; --green-soft: #1f2e25; --red: #ff7a70; --red-soft: #3a1c1a; color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.75; overflow-wrap: anywhere; }
a { color: var(--green); }
.wrap { max-width: 640px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 0 48px; }
.nowrap { white-space: nowrap; }
.ib { display: inline-block; }
[hidden] { display: none !important; }

header.site { padding-block: 20px 8px; }
.logo { display: block; width: min(260px, 72vw); height: auto; }
.mark { width: 40px; height: 40px; background: var(--green); color: #fff; display: grid; place-items: center; font-family: var(--f-head); font-weight: 700; border-radius: 6px; flex: none; font-size: 14px; }
.site-name { line-height: 1.3; min-width: 0; }
.site-name b { display: block; font-size: 15px; }
.site-name span { font-size: 12px; color: var(--muted); }

h1 { font-family: var(--f-head); font-size: clamp(22px, 5.6vw, 28px); line-height: 1.4; margin: 20px 0 8px; text-wrap: balance; }
.lead { color: var(--muted); margin: 0 0 16px; text-wrap: pretty; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 0 0 20px; font-size: 15px; }
.facts dt { color: var(--muted); white-space: nowrap; }
.facts dd { margin: 0; min-width: 0; }

.steps { list-style: none; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; font-size: 12px; text-align: center; }
.steps li { padding-top: 10px; border-top: 4px solid var(--line); color: var(--muted); }
.steps li.on { border-color: var(--green); color: var(--ink); font-weight: 700; }

form, .panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 20px 16px; display: grid; gap: 18px; min-width: 0; }
.group-title { font-family: var(--f-head); font-size: 17px; margin: 6px 0 -6px; padding-top: 14px; border-top: 1px solid var(--line); }
.group-title:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > label, .field > legend { font-weight: 700; font-size: 15px; padding: 0; }
.req { color: var(--red); font-size: 12px; font-weight: 700; margin-left: 6px; white-space: nowrap; }
.opt { color: var(--muted); font-size: 12px; margin-left: 6px; font-weight: 400; white-space: nowrap; }
.hint { color: var(--muted); font-size: 13px; }
.err { color: var(--red); font-size: 13px; font-weight: 700; }
input[type=text], input[type=email], input[type=tel], input[type=date], select, textarea {
  font: inherit; font-size: 16px; width: 100%; max-width: 100%; padding: 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); color: var(--ink); min-height: 48px; }
textarea { min-height: 6.5em; resize: vertical; }
select { min-height: calc(1lh + 26px); }
.short { max-width: 14em; }
/* iPhone の Safari は日付の欄に自前の幅を持たせ、width:100% を守らずにはみ出す（11/20 社長のスマホで実際に起きた）。見た目の部品を外して幅を守らせる */
input[type=date] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; text-align: left; line-height: 1.4; }
input[type=date]::-webkit-date-and-time-value { text-align: left; margin: 0; }
input[type=date]::-webkit-datetime-edit { padding: 0; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--red); background: var(--red-soft); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 8px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label { font-weight: 400; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); cursor: pointer; }
.choices input { width: 20px; height: 20px; margin: 0; accent-color: var(--green); flex: none; }
.choices label:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.two .short { max-width: none; }
@media (max-width: 520px) { .two { grid-template-columns: minmax(0, 1fr); } }
.agree { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.agree:has(input[aria-invalid="true"]) { outline: 2px solid var(--red); outline-offset: 4px; border-radius: 6px; background: var(--red-soft); }
fieldset.is-invalid .choices label { border-color: var(--red); background: var(--red-soft); }
.agree input { margin-top: 5px; width: 20px; height: 20px; flex: none; accent-color: var(--green); }

.total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; font-size: 15px; }
.total b { font-size: 22px; font-variant-numeric: tabular-nums; }
.total small { display: block; color: var(--muted); font-size: 13px; }

.btn { font: inherit; font-weight: 700; font-size: 16px; padding: 14px; border-radius: 10px; border: 0; background: var(--green); color: #fff; cursor: pointer; width: 100%; min-height: 48px; }
.btn.ghost { background: transparent; color: var(--green); border: 1px solid var(--green); }
.btn[disabled] { opacity: .6; cursor: wait; }
.row { display: grid; gap: 10px; }

.errors { background: var(--red-soft); border: 1px solid var(--red); color: var(--red); border-radius: 10px; padding: 12px 16px; }
.errors strong { display: block; }
.errors ul { margin: 6px 0 0; padding-left: 1.2em; }

.check { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 8px 12px; font-size: 15px; margin: 0; }
.check dt { color: var(--muted); }
.check dd { margin: 0; min-width: 0; overflow-wrap: anywhere; white-space: pre-line; }
@media (max-width: 420px) { .check { grid-template-columns: minmax(0, 1fr); gap: 0; } .check dd { margin-bottom: 10px; } }
.stripe { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 14px; font-size: 14px; color: var(--muted); }
.notice { margin: 0; padding: 12px 14px; border-left: 4px solid var(--green); background: var(--green-soft); font-size: 15px; }
.notice.warn { border-color: var(--red); background: var(--red-soft); color: var(--red); font-weight: 700; }

.done-mark { width: 56px; height: 56px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-size: 28px; margin: 0 auto; }
.center { text-align: center; }
.address { font-style: normal; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; text-align: left; }
footer { color: var(--muted); font-size: 12px; margin-top: 24px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
/* done.html の余白（CSP で style 属性が使えないため） */
.mt0{margin-top:0}.m0{margin:0}.mt16{margin-top:16px}.mt20{margin-top:20px}
/* 写真を送る欄 */
input[type=file] { font: inherit; font-size: 15px; max-width: 100%; }

/* 個人情報の取り扱い（フォームの中に出す・2026-11-20 社長「リンクにすると離脱する人もいる」） */
.privacy { margin: 0; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.privacy-title { margin: 0 0 6px; font-weight: 700; }
.privacy ul { margin: 0; padding-left: 1.4em; display: grid; gap: 4px; }
.privacy .nw { white-space: nowrap; }

/* 郵便番号から住所の候補（共通の部品 /common/zipfill.js が出すボタン）。スマホで押しやすい大きさにそろえる */
.zipfill-cand {
  width: 100%; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--bg); color: var(--ink);
  font: inherit; font-size: 15px; line-height: 1.4; cursor: pointer;
  overflow-wrap: anywhere;
}
.zipfill-cand:hover, .zipfill-cand:focus-visible { border-color: var(--green); background: var(--green-soft); }

/* フォームの上の説明（社長 11/21「フォーム自体の上部にしっかり説明文や主旨を説明して下部のフォームにそのままつながる」「レイアウト美しく」）
   頭の画像は 11/20 の SNS 用の背景（Higgsfield）。左の空いた所に見出しを重ねる */
.hero { position: relative; margin: 16px 0 14px; border-radius: 14px; overflow: hidden; background: #efe6d6; }
.hero-img { display: block; width: 100%; height: auto; aspect-ratio: 1280 / 716; object-fit: cover; }
.hero-text { position: absolute; inset: 0 auto 0 0; width: 52%; display: flex; flex-direction: column; justify-content: center; padding: 0 0 0 clamp(14px, 4.5vw, 30px); color: #2b2a22; }
.hero-kicker { margin: 0 0 4px; font-size: clamp(11px, 2.8vw, 13px); letter-spacing: .08em; color: #6b5d3f; }
.hero h1 { margin: 0; font-size: clamp(19px, 5.2vw, 30px); line-height: 1.35; color: #2b2a22; }
.keyfacts { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 8px; }
.keyfacts li { background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; min-width: 0; }
.kf-label { font-size: 12px; color: var(--muted); }
.kf-value { font-family: var(--f-head); font-size: 18px; font-weight: 700; line-height: 1.35; }
.kf-note { font-size: 13px; color: var(--muted); }
@media (max-width: 479px) {
  /* スマホの幅では1列に並べ、見出しと値を横に並べて短くする */
  .keyfacts { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .keyfacts li { grid-template-columns: 5.5em minmax(0, 1fr); column-gap: 10px; align-items: baseline; border-top-width: 1px; border-left: 4px solid var(--green); padding: 8px 12px; }
  .kf-label { grid-row: span 2; }
  .kf-value { font-size: 16px; }
}
.guide-jump { margin: 0 0 16px; }
.guide-jump .btn, .guide-go .btn { display: block; text-align: center; text-decoration: none; min-height: 44px; padding: 10px 14px; font-size: 15px; }
.guide { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px 16px; margin: 0 0 24px; font-size: 15px; }
.guide p { margin: 0 0 12px; text-wrap: pretty; }
.guide-title { font-family: var(--f-head); font-size: 17px; margin: 16px 0 8px; padding-top: 14px; border-top: 1px solid var(--line); text-wrap: balance; }
.guide > .guide-sec:first-child > .guide-title { border-top: 0; padding-top: 6px; }
.about { display: grid; grid-template-columns: minmax(0, 1fr) clamp(86px, 24vw, 120px); gap: 12px; align-items: start; }
.sample { margin: 0; text-align: center; }
.sample img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.sample figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.guide-list { margin: 0 0 12px; padding-left: 1.4em; display: grid; gap: 6px; }
.guide-flow { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; counter-reset: flow; }
.guide-flow li { counter-increment: flow; display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 10px; align-items: start; }
.guide-flow li::before { content: counter(flow); grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 14px; }
.guide-flow li > strong { font-size: 15px; }
.guide-flow li > span { color: var(--ink); font-size: 14px; }
.guide-go { margin: 16px 0 0; }
.form-head { font-family: var(--f-head); font-size: clamp(19px, 4.8vw, 22px); margin: 8px 0 12px; scroll-margin-top: 12px; text-wrap: balance; }
.form-head:focus { outline: none; }
#canceled-note:not([hidden]) { margin: 0 0 16px; }

/* 広い画面（社長 11/21「PCの画面にたいしてフォームが真ん中によりすぎ…幅が狭くて不格好」）
   1024px 以上: 外の枠を 1100px に、頭の画像は枠いっぱい、説明は2列、入力の部分は読みやすい 760px で中央。スマホとタブレットは今のまま */
@media (min-width: 1024px) {
  .wrap { max-width: 1100px; }
  #step-input > *:not(.hero):not(.keyfacts):not(.guide):not(.lead):not(.guide-jump),
  #step-confirm, .wrap > footer { max-width: 760px; margin-left: auto; margin-right: auto; }
  .hero { margin-top: 20px; }
  .hero-img { aspect-ratio: auto; height: 380px; object-position: right center; }
  .hero-text { width: 50%; padding-left: 48px; }
  .hero-kicker { font-size: 15px; }
  .hero h1 { font-size: 38px; }
  .lead { font-size: 17px; max-width: 46em; margin-bottom: 20px; }
  .keyfacts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
  .keyfacts li { padding: 16px 20px; }
  .kf-value { font-size: 22px; }
  .kf-note { font-size: 14px; }
  .guide-jump { max-width: 760px; margin-left: auto; margin-right: auto; }
  .guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 44px; padding: 8px 32px 28px; font-size: 16px; }
  .guide-wide, .guide-go { grid-column: 1 / -1; }
  .guide-sec { min-width: 0; }
  .guide-wide .guide-title { border-top: 0; }
  .about { grid-template-columns: minmax(0, 1fr) 104px; gap: 28px; }
  .guide-go { max-width: 760px; width: 100%; justify-self: center; margin-top: 24px; }
  .form-head { font-size: 24px; margin-top: 16px; }
}
