/* アイデアチェック（小売向け）共通スタイル。外部CDN・Webフォント・画像は使わない。
   配色（背景に対するコントラスト比）:
   本文 #3b2f2a / クリーム #fffaf3 ≒ 12:1、補助文字 #6b5b53 ≒ 6:1、
   アクセント #b45309 / 白 ≒ 5:1、アクセント文字 / クリーム ≒ 4.8:1、エラー #b42318 / 白 ≒ 6.5:1 */
:root {
  --bg: #fffaf3;
  --card: #ffffff;
  --ink: #3b2f2a;
  --muted: #6b5b53;
  --accent: #b45309;
  --accent-dark: #8f3f05;
  --accent-soft: #fdebd3;
  --line: #ead9c3;
  --track: #f1e5d3;
  --meter: #d97706;
  --error: #b42318;
  --error-soft: #fde8e6;
  --note-soft: #fff3d6;
  --gray-badge: #e7e2dc;
  --radius: 16px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif;
  font-size: 1rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.container { width: 100%; max-width: 44rem; margin: 0 auto; padding: 0 1rem; }

/* ---- ヘッダー・フッター ---- */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; padding-top: .75rem; padding-bottom: .75rem; }
.brand { color: var(--ink); font-weight: 700; font-size: 1.1rem; text-decoration: none; }
.brand::before { content: "●"; color: var(--meter); margin-right: .4em; font-size: .8em; }
.operator { color: var(--muted); font-size: .85rem; }

.site-footer { margin-top: 3rem; padding: 1.5rem 0 2.5rem; border-top: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: .9rem; line-height: 1.8; }
.site-footer ul { list-style: none; padding: 0; margin: 0 0 .5rem; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.site-footer p { margin: .25rem 0; }

main { padding-top: 1.5rem; }

/* ---- 文字・リンク ---- */
h1 { font-size: 1.75rem; line-height: 1.4; margin: 0 0 .75rem; }
h2 { font-size: 1.3rem; line-height: 1.5; margin: 2rem 0 .75rem; }
h3 { font-size: 1.1rem; margin: 1.25rem 0 .5rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { color: var(--accent-dark); }
.lead { font-size: 1.1rem; color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* キーボードのフォーカス表示 */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, .btn:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---- カード ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.25rem; margin: 0 0 1.5rem; box-shadow: 0 2px 8px rgba(120, 72, 20, .06); }
.card > :last-child { margin-bottom: 0; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.card.hero { background: var(--accent-soft); border-color: #f3cf9f; padding: 1.75rem 1.25rem; text-align: center; }
.card.note { background: var(--note-soft); border-color: #f0dca6; box-shadow: none; font-size: .9rem; line-height: 1.75; }
.card.legal { padding: 1.5rem 1.25rem; }
.card.legal h1 { font-size: 1.5rem; }
.card.legal h2 { font-size: 1.15rem; border-bottom: 1px solid var(--line); padding-bottom: .25rem; }
.card.mock-note { background: var(--error-soft); border-color: #f4b8b2; box-shadow: none; font-size: .9rem; }

/* ---- ボタン ---- */
.btn, button {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  line-height: 1.4;
  padding: .8rem 1.5rem;
  border-radius: 999px;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.btn:hover, button:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #ffffff; }
.btn.secondary, button.secondary { background: var(--card); color: var(--accent); }
.btn.secondary:hover, button.secondary:hover { background: var(--accent-soft); color: var(--accent-dark); }
.btn.large { font-size: 1.15rem; padding: 1rem 2rem; }
button:disabled { background: #8a7a70; border-color: #8a7a70; color: #ffffff; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }

/* ---- LP ---- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; counter-reset: step; }
.steps li { counter-increment: step; position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem .9rem 3.5rem; }
.steps li::before { content: counter(step); position: absolute; left: 1rem; top: .85rem; width: 1.9rem; height: 1.9rem; line-height: 1.9rem; text-align: center; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; }
.features { padding-left: 1.25rem; margin: 0; }
.features li { margin-bottom: .5rem; }
.sample-tag { display: inline-block; background: var(--ink); color: #fff; font-size: .8rem; font-weight: 700; padding: 0 .7rem; border-radius: 999px; margin-bottom: .5rem; }

/* ---- フォーム ---- */
.field { margin: 0 0 1.25rem; }
.field label, .field .label { display: block; font-weight: 700; margin-bottom: .35rem; }
.field .hint { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; }
input[type="text"], input[type="email"], textarea, input:disabled {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fffdf9;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: .65rem .8rem;
}
input:disabled { background: #f4ede3; color: var(--muted); }
textarea { resize: vertical; min-height: 7rem; line-height: 1.7; }
textarea.short { min-height: 4.5rem; }
input:focus, textarea:focus { border-color: var(--accent); }
.counter { display: block; text-align: right; color: var(--muted); font-size: .85rem; }
.has-error input, .has-error textarea { border-color: var(--error); }
.field-error { display: flex; gap: .4rem; align-items: baseline; color: var(--error); font-weight: 700; font-size: .9rem; margin: .35rem 0 0; }
.field-error::before { content: "!"; flex: none; width: 1.2rem; height: 1.2rem; line-height: 1.2rem; text-align: center; border-radius: 50%; background: var(--error); color: #fff; font-size: .8rem; }
.error-summary { background: var(--error-soft); border: 1px solid #f4b8b2; border-radius: 12px; padding: .75rem 1rem; margin-bottom: 1.25rem; color: var(--error); font-weight: 700; }
.busy { display: flex; align-items: center; gap: .6rem; margin-top: 1rem; color: var(--ink); }
.busy[hidden] { display: none; }
.spinner { flex: none; width: 1.4rem; height: 1.4rem; border: 3px solid var(--track); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
[hidden] { display: none !important; }

/* ---- 結果 ---- */
.total { text-align: center; }
.total .label { display: block; color: var(--muted); font-size: .95rem; }
.total .value { display: block; font-size: 3.25rem; line-height: 1.2; font-weight: 800; color: var(--accent); }
.total .value small { font-size: 1.1rem; font-weight: 700; color: var(--muted); }
.total .tag { display: inline-block; background: var(--accent-soft); color: var(--accent-dark); font-size: .85rem; font-weight: 700; padding: 0 .75rem; border-radius: 999px; }
.score-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 1rem; }
.score-item { border-top: 1px solid var(--line); padding-top: .9rem; }
.score-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .25rem .75rem; margin-bottom: .35rem; }
.score-name { font-weight: 700; }
.score-num { font-weight: 800; color: var(--accent-dark); }
.score-num small { color: var(--muted); font-weight: 400; }
.badge { display: inline-block; background: var(--gray-badge); color: #4a4039; font-size: .85rem; font-weight: 700; padding: .05rem .8rem; border-radius: 999px; }
meter { display: block; width: 100%; height: 14px; border-radius: 999px; border: 0; background: var(--track); overflow: hidden; }
meter::-webkit-meter-bar { background: var(--track); border: 0; border-radius: 999px; height: 14px; }
meter::-webkit-meter-optimum-value, meter::-webkit-meter-suboptimum-value, meter::-webkit-meter-even-less-good-value { background: var(--meter); border-radius: 999px; }
meter::-moz-meter-bar { background: var(--meter); border-radius: 999px; }
.reason { margin: .4rem 0 0; color: var(--muted); font-size: .9rem; line-height: 1.7; }
.summary { margin: 0; }
.id-line { color: var(--muted); font-size: .9rem; margin-bottom: 1rem; }

/* ---- 表（規約・管理画面） ---- */
.table-wrap { overflow-x: auto; margin: 0 0 1rem; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { border: 1px solid var(--line); padding: .5rem .65rem; text-align: left; vertical-align: top; }
th { background: var(--accent-soft); }
blockquote { margin: 0 0 1rem; padding: .6rem 1rem; background: var(--note-soft); border-radius: 12px; }
code { background: #f4ede3; padding: 0 .3em; border-radius: 4px; }

/* ---- 管理画面 ---- */
.container.wide { max-width: 62rem; }
.admin-steps li { margin-bottom: 1rem; }
.admin-steps form { margin-top: .5rem; }
.admin-steps input { width: auto; max-width: 100%; margin-right: .5rem; }
.admin-error { color: var(--error); font-weight: 700; }

@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  .card { padding: 1rem; }
  .total .value { font-size: 2.75rem; }
  .btn.large { width: 100%; padding-left: 1rem; padding-right: 1rem; }
  .actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 3s; }
}
