/* ============================================================================
 * front/styles.css ― お客様の承認画面
 * 設計の読み：取引先のご担当者が正式な書面を確認して承認する画面。信頼感と落ち着きを最優先、書面が主役。
 * ダイヤル：変化3／モーション3／密度5（ui-taste §1）。角丸は12pxに統一。テーマはライト固定。
 * ==========================================================================*/
:root {
  --navy: #10293c; --navy-2: #173a52; --teal: #0f7e9d; --teal-d: #0b6782; --cyan: #7fd7e2;
  --ink: #17232c; --sub: #52606b; --line: #d5dee3; --line-2: #e4eaee;
  --bg: #f3f6f7; --paper: #fdfefe; --tint: #eaf3f6;
  --ok: #0f7e9d; --warn-ink: #8a4b0f; --warn-bg: #fff4e5; --err-ink: #a3261c; --err-bg: #fdeeed;
  --r: 12px;
  --shadow: 0 1px 2px rgba(16, 41, 60, .05), 0 10px 28px -14px rgba(16, 41, 60, .18);
  --focus: 0 0 0 3px rgba(127, 215, 226, .85);
  /* 重なりの層（z-index を名前で持つ） */
  --z-bar: 20; --z-sticky: 30; --z-modal: 50;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Noto Sans JP", sans-serif; font-size: 15px; line-height: 1.8;
  line-break: strict; overflow-wrap: anywhere;
  min-height: 100dvh; display: flex; flex-direction: column;
}
.page { flex: 1 0 auto; width: 100%; }
a { color: var(--teal-d); }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.ic { flex: none; vertical-align: -0.2em; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--paper); padding: 8px 12px; border-radius: var(--r); z-index: var(--z-modal); }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }

/* ---- 上の帯 ---- */
.topbar { background: var(--paper); border-bottom: 1px solid var(--line-2); position: relative; z-index: var(--z-bar); }
.topbar-in { max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand img { display: block; height: 28px; width: auto; }
.secure { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sub); }
.secure .ic { color: var(--teal); }

/* ---- ページ ---- */
.page { max-width: 1200px; margin: 0 auto; padding: 28px 24px 96px; outline: none; }
.reveal { animation: rise .42s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 書面の見出し帯 */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 16px 32px; align-items: end; margin-bottom: 22px; }
.hero-kind { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 8px; font-size: 13px; color: var(--sub); }
.kind-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--tint); color: var(--navy); border-radius: var(--r); padding: 3px 12px; font-weight: 500; }
.hero h1 { margin: 0; font-size: clamp(24px, 3.4vw, 34px); line-height: 1.35; letter-spacing: .01em; color: var(--navy); font-weight: 700; }
.hero-to { margin: 6px 0 0; font-size: 16px; color: var(--ink); }
.hero-fig { text-align: right; }
.fig-label { display: block; font-size: 12.5px; color: var(--sub); }
.fig-num { display: block; font-size: clamp(26px, 3.6vw, 36px); font-weight: 700; color: var(--navy); line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.fig-num small { font-size: 14px; font-weight: 500; color: var(--sub); margin-left: 4px; }
.fig-num.fig-text { font-size: clamp(22px, 3vw, 28px); }
.who-note { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 14px; padding: 10px 12px; border-radius: var(--r); background: var(--tint); color: var(--navy); font-size: 13px; line-height: 1.7; }
.who-note .ic { color: var(--teal); margin-top: 2px; }
.due { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--sub); }
.due.soon { color: var(--warn-ink); }

/* 進み具合（手順は動詞・名詞で書く＝ui-taste §5.3） */
.steps { list-style: none; margin: 0 0 26px; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.steps li { position: relative; display: flex; align-items: center; gap: 10px; padding: 14px 18px; font-size: 14px; color: var(--sub); }
.steps li + li { border-left: 1px solid var(--line-2); }
.steps .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line); color: var(--sub); font-size: 12px; font-weight: 700; flex: none; background: var(--paper); transition: background .3s, border-color .3s, color .3s; }
.steps li.done { color: var(--ink); }
.steps li.done .dot { background: var(--teal); border-color: var(--teal); color: var(--paper); }
.steps li.now { color: var(--navy); font-weight: 700; background: linear-gradient(0deg, rgba(127, 215, 226, .16), rgba(127, 215, 226, .16)); }
.steps li.now .dot { border-color: var(--teal); color: var(--teal); box-shadow: 0 0 0 4px rgba(127, 215, 226, .45); }
.steps li.now::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--cyan); }

/* 本体：書面＋手続き */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 368px; gap: 28px; align-items: start; }
.panel { position: sticky; top: 20px; z-index: var(--z-sticky); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 24px; }
.panel h2 { margin: 0 0 6px; font-size: 18px; color: var(--navy); line-height: 1.4; }
.panel-lead { margin: 0 0 18px; font-size: 13.5px; color: var(--sub); line-height: 1.75; }
.field { margin-bottom: 14px; }
.field label, .field .lbl { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--ink); }
.req { display: inline-block; margin-left: 6px; font-size: 11px; color: var(--err-ink); font-weight: 700; }
.opt { display: inline-block; margin-left: 6px; font-size: 11px; color: var(--sub); font-weight: 400; }
.input { width: 100%; height: 46px; padding: 0 14px; border: 1px solid #b9c6ce; border-radius: var(--r); background: var(--paper); transition: border-color .15s, box-shadow .15s; }
.input:hover { border-color: #93a5b0; }
.input:focus { outline: none; border-color: var(--teal); box-shadow: var(--focus); }
.input[aria-invalid="true"] { border-color: var(--err-ink); }
.err { margin: 6px 0 0; font-size: 12.5px; color: var(--err-ink); display: flex; gap: 6px; align-items: flex-start; }
.fixed { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 14px; border: 1px dashed var(--line); border-radius: var(--r); background: #f7fafb; font-size: 14px; word-break: break-all; }
.fixed .ic { color: var(--sub); }

.readcheck { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--warn-bg); color: var(--warn-ink); font-size: 13px; margin-bottom: 12px; }
.readcheck.done { background: var(--tint); color: var(--navy); }
.readcheck .txt { display: flex; align-items: center; gap: 8px; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--teal-d); font-weight: 700; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.linkbtn:hover { text-decoration: underline; }

.consent { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; font-size: 13.5px; line-height: 1.7; margin-bottom: 14px; transition: border-color .15s, background .15s; }
.consent:hover { border-color: #93a5b0; }
.consent input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--teal); cursor: pointer; }
.consent.is-disabled { opacity: .55; cursor: not-allowed; }
.consent.is-disabled input { cursor: not-allowed; }
.consent.is-on { border-color: var(--teal); background: rgba(127, 215, 226, .12); }

.hashbox { border-radius: var(--r); background: #f7fafb; border: 1px solid var(--line-2); padding: 12px 14px; margin-bottom: 16px; font-size: 12.5px; }
.hash-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hash-t { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--navy); font-size: 13px; }
.hash-t .ic { color: var(--teal); }
.match { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ok); font-weight: 700; }
.match.bad { color: var(--err-ink); }
.hash-v { font-family: "Consolas", "SFMono-Regular", monospace; font-size: 12px; color: var(--sub); margin-top: 6px; word-break: break-all; }
.hash-s { color: var(--sub); margin: 6px 0 0; line-height: 1.7; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 22px; border-radius: var(--r); border: 1px solid transparent; font-weight: 700; font-size: 15px; cursor: pointer; transition: background .15s, border-color .15s, transform .08s, box-shadow .15s; text-decoration: none; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal); color: var(--paper); box-shadow: 0 1px 0 rgba(16, 41, 60, .12); }
.btn-primary:hover { background: var(--teal-d); }
.btn-primary[disabled] { background: #9fb4bd; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-ghost { background: var(--paper); color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: #93a5b0; }
.btn-block { width: 100%; }
.btn .spin { width: 18px; height: 18px; border: 2px solid rgba(253, 254, 254, .45); border-top-color: var(--paper); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fine { margin: 14px 0 0; font-size: 12px; color: var(--sub); line-height: 1.75; }

/* 結果（承認後・成立後） */
.done-mark { width: 56px; height: 56px; border-radius: 50%; background: var(--teal); color: var(--paper); display: grid; place-items: center; margin-bottom: 14px; }
.done-mark .ic path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw .5s .15s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done-mark.wait { background: var(--tint); color: var(--teal); }
.kv { margin: 16px 0; border-top: 1px solid var(--line-2); }
.kv div { display: grid; grid-template-columns: 6.5em 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.kv dt { color: var(--sub); } .kv dd { margin: 0; font-variant-numeric: tabular-nums; }
.next { background: var(--tint); border-radius: var(--r); padding: 14px 16px; font-size: 13.5px; line-height: 1.75; margin: 0 0 14px; }
.next b { color: var(--navy); }
.contact { font-size: 13px; color: var(--sub); line-height: 1.8; margin: 0; }
.contact a { font-weight: 500; }
.actions { display: grid; gap: 10px; margin-top: 16px; }

/* 全面のお知らせ（無効・期限切れ・取消・通信エラー） */
.notice { max-width: 620px; margin: 40px auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: clamp(24px, 5vw, 44px); }
.notice .mark { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--teal); margin-bottom: 16px; }
.notice .mark.warn { background: var(--warn-bg); color: var(--warn-ink); }
.notice h1 { margin: 0 0 10px; font-size: 22px; color: var(--navy); line-height: 1.45; }
.notice p { margin: 0 0 12px; font-size: 14.5px; }
.notice .ref { font-size: 13px; color: var(--sub); }
.notice .actions { grid-template-columns: auto; justify-content: start; }

/* 読み込み中（骨組み） */
.boot { padding-top: 4px; }
.sk { background: linear-gradient(90deg, #e7edf0 0%, #f1f5f7 40%, #e7edf0 80%); background-size: 200% 100%; border-radius: var(--r); animation: shimmer 1.4s ease-in-out infinite; }
.sk-title { height: 36px; width: min(420px, 70%); margin-bottom: 12px; }
.sk-line { height: 54px; margin-bottom: 26px; }
.sk-grid { display: grid; grid-template-columns: minmax(0, 1fr) 368px; gap: 28px; }
.sk-paper { height: 640px; } .sk-panel { height: 420px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* スマホの下の帯（手続きへ誘導） */
.mbar { display: none; }

/* 確認ダイアログ */
.modal { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: 20px; background: rgba(16, 41, 60, .45); }
.dialog { width: min(520px, 100%); background: var(--paper); border-radius: var(--r); box-shadow: 0 24px 60px -20px rgba(16, 41, 60, .5); padding: 26px; animation: rise .25s ease-out both; }
.dialog h2 { margin: 0 0 8px; font-size: 19px; color: var(--navy); }
.dialog p { margin: 0 0 12px; font-size: 14px; }
.quote { margin: 0 0 14px; padding: 12px 14px; border-left: 3px solid var(--teal); background: var(--tint); border-radius: 0 var(--r) var(--r) 0; font-size: 13.5px; }
.dialog .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

.foot { border-top: 1px solid var(--line-2); background: var(--paper); }
.foot-in { max-width: 1200px; margin: 0 auto; padding: 18px 24px; display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; font-size: 12.5px; color: var(--sub); }
.foot p { margin: 0; }
.noscript { text-align: center; padding: 24px; }

/* ---- 幅が狭いとき ---- */
@media (max-width: 1080px) {
  .layout, .sk-grid { grid-template-columns: minmax(0, 1fr); }
  .panel { position: static; }
  .sk-panel { display: none; }
}
@media (max-width: 767px) {
  body { font-size: 14.5px; }
  .topbar-in { padding: 0 16px; height: 56px; }
  .brand img { height: 24px; }
  .secure span { display: none; }
  .page { padding: 18px 16px 110px; }
  .hero { grid-template-columns: 1fr; align-items: start; }
  .hero-fig { text-align: left; }
  .steps { grid-auto-flow: column; grid-auto-columns: 1fr; }
  .steps li { flex-direction: column; gap: 6px; padding: 10px 4px; font-size: 11.5px; text-align: center; line-height: 1.4; }
  .panel { padding: 20px; }
  .mbar { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sticky); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(253, 254, 254, .96); border-top: 1px solid var(--line); backdrop-filter: blur(6px); }
  .mbar[hidden] { display: none !important; }
  .foot-in { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .done-mark .ic path { stroke-dashoffset: 0; }
}

/* ---- 印刷：画面ではなく書面だけを出す ---- */
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  .topbar, .foot, .steps, .panel, .mbar, .hero-fig .due, .skip, .modal { display: none !important; }
  .page { padding: 0; max-width: none; }
  .layout { display: block; }
  .eo-sheet { box-shadow: none; border: 0; padding: 0; page-break-after: always; }
  .eo-sheet:last-child { page-break-after: auto; }
}
