/* FunnelWorks セルフ診断 — 色・書体は funnel-works.co.jp の tokens.css に合わせる */
:root {
  --paper: #FAF7F1;
  --paper-warm: #F1EADD;
  --accent-soft: #E4F5F0;
  --mint: #48C7AF;
  --deep: #0E7A66;
  --coral: #FF6247;
  --ink: #23262A;
  --ink-strong: #241F19;
  --muted: #776F64;
  --on-accent: #0E241F;
  --white: #FFFFFF;
  --line: #E3DACB;
  --warn: #C98A12;
  --bad: #D2452E;
  --serif: "Shippori Mincho B1", "Hiragino Mincho ProN", serif;
  --sans: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  --label: "Space Grotesk", "Noto Sans JP", sans-serif;
  --r-sm: 8px; --r: 16px; --r-lg: 20px; --r-pill: 999px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.8;
}
a { color: var(--deep); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 800; line-height: 1.4; margin: 0 0 .5em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.eyebrow { font-family: var(--label); font-weight: 700; letter-spacing: .14em; font-size: 12px; color: var(--deep); margin: 0 0 8px; }
.error { color: var(--bad); font-size: 14px; white-space: pre-line; }

.bar { display: flex; align-items: center; gap: 16px; padding: 16px clamp(16px, 4vw, 48px); border-bottom: 1px solid var(--line); }
.brand { font-family: var(--label); font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
.bar-note { font-size: 13px; color: var(--muted); }

main { max-width: 1120px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px) 64px; }
.step { display: none; }
.step.is-active { display: block; animation: fade .35s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 700 16px/1 var(--sans); padding: 16px 26px; border-radius: var(--r-pill);
  border: 2px solid transparent; cursor: pointer; text-decoration: none; transition: transform .15s var(--ease), opacity .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .35; cursor: default; transform: none; }
.btn-cta { background: var(--coral); color: var(--white); }
.btn-main { background: var(--deep); color: var(--white); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }

/* ---------- start ---------- */
.hero { padding: clamp(40px, 8vw, 88px) 0 40px; max-width: 760px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); }
.lead { font-size: 17px; max-width: 40em; }
.url-form { display: flex; gap: 10px; margin: 28px 0 10px; flex-wrap: wrap; }
.url-form input {
  flex: 1 1 280px; min-width: 0; font: 500 18px var(--sans); padding: 15px 20px;
  border: 2px solid var(--ink); border-radius: var(--r-pill); background: var(--white); color: var(--ink);
}
.url-form input:focus { outline: 3px solid var(--mint); outline-offset: 2px; }
.promise { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 0; margin: 14px 0 0; list-style: none; font-size: 14px; color: var(--muted); }
.promise li::before { content: "✓ "; color: var(--deep); font-weight: 700; }

.areas-preview { border-top: 1px solid var(--line); padding-top: 32px; }
.areas-preview ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.areas-preview li { background: var(--white); border-radius: var(--r); padding: 18px 20px; font-weight: 700; }
.areas-preview li span { font-family: var(--label); color: var(--mint); margin-right: 10px; }
.areas-preview small { display: block; font-weight: 400; color: var(--muted); font-size: 14px; margin-top: 2px; }

/* ---------- questions ---------- */
.q-head { padding: 32px 0 8px; }
.checking { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); margin: 0 0 14px; }
.checking.done { color: var(--deep); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--mint); animation: pulse 1.2s infinite; }
.checking.done .dot { animation: none; background: var(--deep); }
@keyframes pulse { 50% { opacity: .25; } }
.progress { height: 6px; background: var(--paper-warm); border-radius: 3px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--deep); transition: width .3s var(--ease); }
.q-box { background: var(--white); border-radius: var(--r-lg); padding: clamp(24px, 4vw, 40px); margin: 20px 0; min-height: 320px; }
.q-num { font-family: var(--label); color: var(--deep); font-weight: 700; font-size: 14px; }
.q-title { font-size: clamp(21px, 3vw, 26px); margin: 6px 0 4px; }
.q-hint { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; }
.opt span {
  display: block; padding: 14px 18px; border: 2px solid var(--line); border-radius: var(--r); cursor: pointer;
  font-weight: 500; transition: border-color .15s, background .15s;
}
.opt input:checked + span { border-color: var(--deep); background: var(--accent-soft); }
.opt input:focus-visible + span { outline: 3px solid var(--mint); outline-offset: 2px; }
.q-nav { display: flex; justify-content: space-between; gap: 12px; }

/* ---------- wait ---------- */
.wait { text-align: center; padding: 96px 0; }
.spinner { width: 48px; height: 48px; margin: 0 auto 24px; border: 4px solid var(--paper-warm); border-top-color: var(--deep); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- result ---------- */
.result-head { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 40px 0 24px; flex-wrap: wrap; }
.result-head h2 { font-size: clamp(22px, 3.4vw, 30px); word-break: break-all; }
.total { position: relative; width: 150px; text-align: center; }
.total svg { width: 150px; height: 150px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--paper-warm); stroke-width: 10; }
.ring { fill: none; stroke: var(--deep); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset 1.2s var(--ease); }
.total-num { position: absolute; top: 0; left: 0; width: 150px; height: 150px; display: flex; align-items: center; justify-content: center; font-family: var(--label); font-weight: 700; font-size: 44px; }
.total-num small { font-size: 15px; color: var(--muted); margin-left: 2px; }
.rank { margin: 6px 0 0; font-weight: 700; font-size: 15px; }

.area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.area { background: var(--white); border-radius: var(--r); padding: 18px 20px; }
.area-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.area-name { font-weight: 700; }
.area-name span { font-family: var(--label); color: var(--mint); margin-right: 8px; }
.area-score { font-family: var(--label); font-weight: 700; font-size: 24px; white-space: nowrap; }
.area-score small { font-size: 13px; color: var(--muted); }
.bar-track { height: 8px; background: var(--paper-warm); border-radius: 4px; margin: 10px 0 8px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; border-radius: 4px; transition: width 1s var(--ease); }
.area-note { font-size: 14px; color: var(--muted); margin: 0; }
.lv-good { background: var(--deep); } .lv-mid { background: var(--warn); } .lv-bad { background: var(--bad); }
.area.is-na .area-score { color: var(--muted); font-size: 16px; }

.block { margin-top: 48px; }
.block h3 { font-size: clamp(21px, 3vw, 24px); }
.findings { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
.finding { background: var(--white); border-radius: var(--r); padding: 20px 22px; border-left: 6px solid var(--bad); }
.finding.p2 { border-left-color: var(--warn); }
.finding h4 { font-family: var(--sans); font-weight: 700; font-size: 17px; margin: 0 0 4px; }
.finding p { margin: 0; font-size: 15.5px; }
.finding .tagline { font-family: var(--label); font-size: 12px; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.finding.is-good { border-left-color: var(--deep); }

.locked-wrap { position: relative; }
.detail { display: grid; gap: 20px; }
.detail-area h4 { font-size: 18px; margin: 0 0 8px; }
.checks { list-style: none; padding: 0; margin: 0; background: var(--white); border-radius: var(--r); }
.checks li { display: grid; grid-template-columns: 28px 1fr; gap: 4px 10px; padding: 14px 18px; border-top: 1px solid var(--paper-warm); font-size: 15.5px; }
.checks li:first-child { border-top: 0; }
.mark { font-weight: 700; text-align: center; }
.mark.ok { color: var(--deep); } .mark.warn { color: var(--warn); } .mark.ng { color: var(--bad); } .mark.na { color: var(--muted); }
.check-fix { grid-column: 2; color: var(--muted); font-size: 15px; }
.locked .detail { filter: blur(6px); pointer-events: none; user-select: none; max-height: 640px; overflow: hidden; }
.locked-wrap.locked { min-height: 740px; }
.gate { display: none; }
.locked .gate { display: flex; position: absolute; inset: 90px 0 0; align-items: flex-start; justify-content: center; padding: 24px 0; }
.gate-card { background: var(--white); border-radius: var(--r-lg); padding: 28px; width: min(480px, 100%); box-shadow: 0 18px 50px rgba(36,31,25,.18); }
.gate-card h4 { font-size: 21px; }
.gate-card p { font-size: 15px; margin: 0 0 14px; }
#lead-form { display: grid; gap: 12px; }
#lead-form label { display: grid; gap: 4px; font-size: 14px; font-weight: 700; }
#lead-form input:not([type=checkbox]) { font: 16px var(--sans); padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm); }
#lead-form input:focus { outline: 3px solid var(--mint); outline-offset: 1px; }
#lead-form .check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
#lead-form .check input { margin-top: 6px; }
.hp { position: absolute; left: -9999px; }
.fine { font-size: 13px !important; color: var(--muted); margin: 0 !important; }

.next { background: var(--ink-strong); color: var(--paper); border-radius: var(--r-lg); padding: clamp(24px, 4vw, 44px); }
.next .eyebrow { color: var(--mint); }
.next-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin: 24px 0; }
.next-card { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: var(--r); padding: 22px; }
.next-card h4 { color: var(--white); font-size: 19px; }
.next-card p { font-size: 15px; }
.next .btn-ghost { color: var(--paper); border-color: var(--paper); }
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }

.foot { text-align: center; font-size: 13px; color: var(--muted); padding: 24px 16px 40px; }

@media (max-width: 560px) {
  .url-form .btn { width: 100%; }
  .q-nav .btn { flex: 1; }
  .total { margin: 0 auto; }
  .locked .gate { inset: 60px 0 0; }
}

@media print {
  .bar, .foot, .gate, .actions-row, .next-grid .btn { display: none !important; }
  body { background: #fff; }
  .area, .finding, .checks { break-inside: avoid; }
  .next { background: #fff; color: var(--ink); border: 1px solid var(--line); }
}

/* ---------- 点数の見方 ---------- */
.total-label { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.total-num { top: 26px; }
.counts { margin: -8px 0 20px; font-size: 15px; line-height: 1.9; }
.counts br { display: none; }
b.ok, .cnt.ok { color: var(--deep); } b.warn, .cnt.warn { color: var(--warn); } b.ng, .cnt.ng { color: var(--bad); }
.area-desc { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.area-note { display: flex; gap: 14px; font-weight: 700; }
.na-note { font-weight: 400; }
.howto { margin-top: 16px; background: var(--white); border-radius: var(--r); padding: 4px 22px; }
.howto summary { cursor: pointer; font-weight: 700; padding: 14px 0; color: var(--deep); }
.howto-body { padding-bottom: 18px; font-size: 15.5px; }
.howto-body p { margin: 0 0 10px; }
.howto-body ul { margin: 0 0 14px; padding-left: 1.2em; }
.scale { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.scale li { border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 8px 12px; font-size: 14.5px; }
.scale li b { display: block; font-family: var(--label); }
.scale li.is-here { border-color: var(--deep); background: var(--accent-soft); }
.scale li.is-here b::after { content: "　← あなたのサイト"; font-family: var(--sans); color: var(--deep); font-size: 13px; }
.imp { margin-left: 8px; color: var(--warn); font-size: 12px; letter-spacing: 1px; white-space: nowrap; }
.src { margin-left: 8px; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 1px 8px; white-space: nowrap; }
@media (max-width: 560px) { .counts br { display: inline; } }

/* ---------- 分野ごとの判定基準 ---------- */
.area { display: flex; flex-direction: column; }
.area-more {
  margin-top: 0; align-self: stretch; display: flex; align-items: center; justify-content: center; gap: 6px;
  font: 700 14.5px var(--sans); color: var(--deep); background: var(--accent-soft);
  border: 1.5px solid transparent; border-radius: var(--r-pill); padding: 9px 16px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.area-more:hover { border-color: var(--deep); }
.area-more:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; }
.area.is-na .area-more { background: var(--paper-warm); color: var(--muted); }
#r-areas { scroll-margin-top: 16px; }
.rule-back { margin: 0; padding: 4px 20px 16px; text-align: right; }
.rule-back button { font: 500 14px var(--sans); color: var(--deep); background: none; border: 0; cursor: pointer; padding: 4px 0; }
.rules { margin-top: 32px; }
.rule-area { background: var(--white); border-radius: var(--r); margin: 0 0 10px; scroll-margin-top: 16px; }
.rule-area > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 16px 20px; font-weight: 700; font-size: 17px; }
.rule-area > summary::-webkit-details-marker { display: none; }
.rule-area > summary::before { content: "＋"; color: var(--deep); font-family: var(--label); }
.rule-area[open] > summary::before { content: "－"; }
.rule-area summary small { font-weight: 400; font-size: 14px; color: var(--muted); }
.rule-no { font-family: var(--label); color: var(--mint); }
.rule-sum { margin-left: auto; font-family: var(--label); }
.rule-list { list-style: none; margin: 0; padding: 0 20px 8px; }
.rule-list > li { border-top: 1px solid var(--paper-warm); padding: 14px 0; }
.rule-head { display: flex; gap: 10px; margin: 0; font-weight: 700; font-size: 15.5px; }
.rule-meta { margin: 2px 0 8px 28px; display: flex; flex-wrap: wrap; gap: 6px; }
.rule-meta .imp, .rule-meta .src { margin-left: 0; }
.rule-crit { margin: 0 0 0 28px; display: grid; gap: 2px; font-size: 15px; }
.rule-crit > div { display: grid; grid-template-columns: 52px 1fr; gap: 8px; padding: 5px 10px; border-radius: var(--r-sm); }
.rule-crit dt { font-weight: 700; text-align: center; }
.rule-crit dt.ok { color: var(--deep); } .rule-crit dt.warn { color: var(--warn); } .rule-crit dt.ng { color: var(--bad); } .rule-crit dt.na { color: var(--muted); font-size: 13px; }
.rule-crit dd { margin: 0; }
.rule-crit .is-current { background: var(--accent-soft); font-weight: 500; }
.rule-crit em { font-style: normal; color: var(--deep); font-size: 13px; margin-left: 8px; white-space: nowrap; }
@media (max-width: 560px) {
  .rule-meta, .rule-crit { margin-left: 0; }
  .rule-crit > div { grid-template-columns: 40px 1fr; }
}
@media print { .rule-area { break-inside: avoid; } .area-more, .rule-back { display: none !important; } }
.area .area-note { margin-bottom: 12px; }

/* ---------- 「詳しく見る」でカード内に展開 ---------- */
.area-grid { align-items: start; }
.area-more .arrow { display: inline-block; transition: transform .2s var(--ease); }
.area-more[aria-expanded="true"] .arrow { transform: rotate(180deg); }
.area.is-open { box-shadow: 0 0 0 2px var(--deep) inset; }
.area-panel { margin-top: 14px; border-top: 1px solid var(--paper-warm); animation: fade .25s var(--ease); }
.panel-lead { margin: 12px 0 0; font-size: 13.5px; color: var(--muted); }
.area-panel .rule-list { padding: 0; }
.area-panel .rule-meta, .area-panel .rule-crit { margin-left: 0; }
.area-panel .rule-crit > div { grid-template-columns: 40px 1fr; padding: 5px 8px; }
.area-panel .rule-crit { font-size: 14.5px; }
.area-panel .rule-head { font-size: 15px; }
@media print {
  .area-panel { display: block !important; }
  .area-panel[hidden] { display: block !important; }
}
