
:root {
  --paper: #f5f6f8;
  --surface: #ffffff;
  --ink: #1b2433;
  --muted: #5d6878;
  --rule: #cdd3dc;
  --ledger: #2e6a52;      /* 帳簿の罫線の緑：主要アクションと契約期間 */
  --ledger-soft: #e3eee8;
  --danger: #a3302a;
  --danger-soft: #f6e4e2;
  --radius: 6px;
  --font: 'Yu Gothic Medium', '游ゴシック Medium', YuGothic, '游ゴシック体', 'Yu Gothic', '游ゴシック', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
}

* { box-sizing: border-box; }
button, input, select, textarea { font-family: inherit; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ledger); }
:focus-visible { outline: 3px solid var(--ledger); outline-offset: 2px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}
.site-header .inner {
  max-width: 1080px; margin: 0 auto; padding: 14px 24px;
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  font-size: 14px; color: var(--muted);
}
.site-header strong { color: var(--ink); font-size: 16px; }

main { max-width: 1080px; margin: 0 auto; padding: 48px 24px 80px; }

/* 申込ページ */
.signup { display: grid; grid-template-columns: 1fr 420px; gap: 56px; align-items: start; }
@media (max-width: 880px) { .signup { grid-template-columns: 1fr; gap: 40px; } }

.price { margin: 0; font-size: clamp(32px, 5vw, 48px); line-height: 1.2; font-weight: 700; letter-spacing: 0.01em; }
.price small { font-size: 0.42em; font-weight: 400; color: var(--muted); margin-left: 6px; }
.lead { margin: 12px 0 28px; color: var(--muted); max-width: 34em; }

.terms { margin: 0; border-top: 1px solid var(--rule); }
.terms div { display: grid; grid-template-columns: 9em 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.terms dt { color: var(--muted); font-size: 14px; }
.terms dd { margin: 0; }
@media (max-width: 520px) { .terms div { grid-template-columns: 1fr; gap: 2px; } }

/* フォーム */
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 28px; }
.panel h2 { margin: 0 0 20px; font-size: 20px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.field .opt { font-weight: 400; color: var(--muted); margin-left: 6px; }
.field input[type='text'], .field input[type='email'], .field input[type='tel'], .card-element {
  width: 100%; padding: 11px 12px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
}
.field input:focus, .card-element.is-focused { border-color: var(--ledger); outline: 2px solid var(--ledger-soft); }
.card-element { min-height: 46px; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }

.agree { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 22px 0; }
.agree input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--ledger); }

.btn {
  display: inline-block; width: 100%; padding: 14px 18px; font: inherit; font-weight: 700;
  color: #fff; background: var(--ledger); border: none; border-radius: var(--radius); cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.55; cursor: progress; }

.alert { padding: 12px 14px; border-radius: var(--radius); font-size: 14px; margin-bottom: 18px; background: var(--danger-soft); color: var(--danger); }
.alert.ok { background: var(--ledger-soft); color: var(--ledger); }

/* 完了・カード更新 */
.narrow { max-width: 520px; margin: 0 auto; }
.narrow h1 { font-size: 26px; margin: 0 0 12px; }

/* 管理画面 */
.admin h1 { font-size: 24px; margin: 0 0 4px; }
.admin .sub { color: var(--muted); margin: 0 0 24px; font-size: 14px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; white-space: nowrap; }
th { font-weight: 700; color: var(--muted); background: var(--paper); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: none; }
.status { font-weight: 700; }
.status.payment_failed { color: var(--danger); }
.status.active { color: var(--ledger); }
.status.cancel_scheduled, .status.canceled { color: var(--muted); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions button {
  font: inherit; font-size: 13px; padding: 6px 10px; cursor: pointer;
  background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: var(--radius);
}
.actions button.warn { color: var(--danger); border-color: var(--danger); }
.empty { padding: 40px; text-align: center; color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.card-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card-row .field { margin-bottom: 0; }
.card-hint { margin: 8px 0 18px; }
.card-element { display: flex; align-items: center; }
.card-element > * { flex: 1; }
.cf-turnstile { margin: 4px 0 20px; min-height: 65px; }
