/* ─────────────────────────────────────────────────────────────
   pool / forms.css  ── Light gray edition
   --------------------------------------------------------------- */

:root {
  /* light gray palette */
  --bg:          #EFEFEC;     /* ライトグレー基調 */
  --surface:     #F7F7F4;     /* 一段明るいベース(必要時) */
  --ink:         #0A0A0A;     /* 黒 */
  --ink-dim:     #3F3F46;     /* slate-700 */
  --mute:        #71717A;     /* slate-500 */
  --line:        rgba(10, 10, 10, .10);
  --line-hi:     rgba(10, 10, 10, .24);

  /* brand accent */
  --mint:        #B0EDA6;
  --electric:    #86EA5C;
  --green-deep:  #173506;
  --danger:      #B91C1C;

  /* Museo Sans → Mulish フォールバック */
  --font-display: 'museo-sans', 'Mulish', 'Helvetica Neue', system-ui, sans-serif;
  --font-body:    'Noto Sans JP', 'Mulish', 'Helvetica Neue', system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scrollbar-gutter: stable both-edges; color-scheme: light; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
::selection { background: var(--green-deep); color: var(--mint); }

/* ── Ambient(ライトグレーで控えめに) ─────────────────── */
.ambient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(900px 540px at 14% -10%, rgba(176, 237, 166, .22), transparent 64%),
    radial-gradient(820px 460px at 116% 22%, rgba(23, 53, 6, .06), transparent 64%),
    radial-gradient(700px 700px at 50% 110%, rgba(10, 10, 10, .03), transparent 62%);
  filter: blur(2px);
  animation: ambient-drift 26s ease-in-out infinite alternate;
}
@keyframes ambient-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-16px, -8px, 0) scale(1.03); }
}

/* ── Topbar ───────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  background: linear-gradient(to bottom, rgba(239,239,236,.92) 0%, rgba(239,239,236,.65) 70%, transparent 100%);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.topbar .brand {
  font-family: var(--font-display); font-weight: 700;
  font-size: 20px; letter-spacing: -.025em; color: var(--ink); text-decoration: none;
}
.topbar .nav-back {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--mute); text-decoration: none;
}
.topbar .nav-back:hover { color: var(--ink); }

/* ── Scene(Thanks 用に残す) ────────────────────────── */
.scene {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(64px, 10vh, 120px) clamp(20px, 6vw, 96px);
}
.scene.short { min-height: auto; padding-top: 0; }

/* ── Split layout(左コピー / 右フォーム、1 viewport 同居) ─── */
main.split {
  position: relative; z-index: 1;
  min-height: calc(100dvh - 64px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
}
.split .hero-pane {
  padding: clamp(48px, 7vh, 96px) clamp(28px, 5vw, 80px);
  display: flex; flex-direction: column; justify-content: center;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.split .form-pane {
  padding: clamp(48px, 7vh, 96px) clamp(28px, 5vw, 80px);
  display: flex; flex-direction: column; justify-content: flex-start;
  min-width: 0;
  max-height: calc(100dvh - 64px);
  overflow-y: auto;            /* フィールド多めの demo はこの pane 内のみスクロール */
}
.split .form-pane form { max-width: 540px; }
.split .audience-pill { margin-bottom: 24px; }

/* split 内では headline を半分サイズに */
.split h1.headline {
  font-size: clamp(36px, 4.6vw, 60px);
  line-height: 1.04;
  letter-spacing: -0.030em;
}
.split .lede { font-size: clamp(14px, 1vw, 16px); }

/* split 内では field 間隔・文字を 1 段圧縮 */
.split .field { padding: 20px 0 0; }
.split .field input,
.split .field textarea,
.split .field select { font-size: 17px; padding: 8px 0 11px; }
.split .field input::placeholder,
.split .field textarea::placeholder { font-size: 15px; }
.split .field textarea { min-height: 76px; font-size: 15px; }

.split .consent { margin-top: 32px; }
.split .turnstile-mount { margin-top: 20px; }
.split .submit-row { margin-top: 32px; gap: 18px; }
.split button[type="submit"] { padding: 18px 30px; font-size: clamp(16px, 1.4vw, 18px); }

/* 狭い画面では縦並びにフォールバック */
@media (max-width: 980px) {
  main.split {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .split .hero-pane {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding-bottom: 56px;
  }
  .split .form-pane {
    max-height: none;
    overflow-y: visible;
    padding-top: 56px;
  }
}

/* ── Hero ─────────────────────────────────────────────── */
.hero { padding-top: clamp(80px, 12vh, 140px); padding-bottom: clamp(40px, 6vh, 80px); }

.audience-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 18px;
  border: 1px solid var(--mint);
  border-radius: 999px;
  background: var(--mint);
  color: var(--green-deep);
  font-family: var(--font-mono); font-weight: 500;
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  width: max-content; margin: 0 0 32px;
}
.audience-pill::before {
  content: ""; width: 5px; height: 5px; border-radius: 999px;
  background: var(--green-deep);
}
.audience-pill .ja {
  margin-left: 10px;
  padding-left: 12px;
  border-left: 1px solid rgba(23, 53, 6, .3);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: .02em;
  text-transform: none;
  color: var(--green-deep);
}

h1.headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(46px, 8vw, 104px);
  line-height: 1.0;
  letter-spacing: -0.035em;
  margin: 0 0 28px;
  max-width: 18ch;
  color: var(--ink);
}
/* light bg では mint が薄れるので green-deep に変更(1 セクション 1 アクセント) */
h1.headline .punct { color: var(--green-deep); }

.lede {
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.78;
  color: var(--ink-dim);
  margin: 0;
  max-width: 56ch;
}
.lede a {
  color: var(--ink); text-decoration: underline;
  text-underline-offset: 3px; text-decoration-color: var(--line-hi);
}
.lede a:hover { text-decoration-color: var(--ink); }

/* ── Divider ───────────────────────────────────────────── */
.divider {
  position: relative; z-index: 1;
  width: min(100%, 1100px); margin: 0 auto;
  padding: 0 clamp(20px, 6vw, 96px);
}
.divider::before { content: ""; display: block; width: 100%; height: 1px; background: var(--line); }

/* ── Form scene ────────────────────────────────────────── */
.form-scene { padding-top: clamp(48px, 8vh, 96px); }

.section-meta { display: flex; align-items: baseline; gap: 18px; margin: 0 0 56px; }
.section-meta .num {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .22em; color: var(--mute);
}
.section-meta .label {
  font-family: var(--font-display); font-weight: 500;
  font-size: 24px; letter-spacing: -.018em; color: var(--ink);
}

form.pool-form { display: block; width: 100%; max-width: 720px; }

/* ── Field ──────────────────────────────────────────────
   underline 一本のミニマル
   ----------------------------------------------------- */
.field {
  display: block;
  padding: 22px 0 0;
  margin: 0 0 4px;
  position: relative;
}

.field label.lbl {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: .02em;
  color: var(--ink-dim);
  margin: 0 0 10px;
}
.field label .req {
  display: inline-block;
  width: 5px; height: 5px; border-radius: 999px;
  background: var(--ink);
  vertical-align: middle; margin: 0 0 2px 7px;
}
.field label .opt {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--mute);
  margin-left: 10px;
  vertical-align: middle;
}

.field .ctl { position: relative; display: block; }

.field input, .field textarea, .field select {
  appearance: none; width: 100%;
  background: transparent; border: none; outline: none;
  padding: 10px 0 14px;
  font: inherit; font-family: var(--font-body);
  font-size: clamp(18px, 2vw, 22px);
  color: var(--ink); line-height: 1.35;
  border-radius: 0; letter-spacing: -.005em;
}
.field input::placeholder, .field textarea::placeholder {
  color: rgba(10, 10, 10, .26);
  font-size: clamp(16px, 1.6vw, 19px);
}
.field textarea { resize: vertical; min-height: 96px; line-height: 1.7; font-size: clamp(16px, 1.4vw, 18px); }

.field select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--mute) 50%),
    linear-gradient(135deg, var(--mute) 50%, transparent 50%);
  background-position: calc(100% - 16px) center, calc(100% - 10px) center;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
.field select option { background: var(--surface); color: var(--ink); }

/* underline:focus 時に green-deep(濃い緑)が左から伸びる
   ── light bg では mint 1px は弱いので green-deep に */
.field .ctl::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--line); pointer-events: none;
}
.field .ctl::before {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--green-deep);
  transform: scaleX(0); transform-origin: left center;
  transition: transform .55s cubic-bezier(.16,1,.3,1);
  pointer-events: none; z-index: 1;
}
.field:focus-within .ctl::before { transform: scaleX(1); }
.field:has(input:not(:placeholder-shown)) .ctl::after,
.field:has(textarea:not(:placeholder-shown)) .ctl::after,
.field:has(select:valid) .ctl::after { background: var(--line-hi); }

/* ── 2 カラム ─────────────────────────────────────────── */
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 720px) { .row-2 { grid-template-columns: 1fr; gap: 0; } }

/* ── 同意 ─────────────────────────────────────────────── */
.consent {
  display: flex; gap: 14px; align-items: flex-start;
  margin: 44px 0 0;
  font-size: 13px; color: var(--ink-dim); line-height: 1.7;
}
.consent input[type="checkbox"] {
  appearance: none; width: 18px; height: 18px;
  border: 1px solid var(--line-hi); border-radius: 4px;
  background: transparent; cursor: pointer; flex-shrink: 0; margin-top: 2px;
  position: relative;
  transition: background .2s ease, border-color .2s ease;
}
.consent input[type="checkbox"]:checked {
  background: var(--ink); border-color: var(--ink);
}
.consent input[type="checkbox"]:checked::after {
  content: ""; position: absolute; inset: 3px 4px 5px 4px;
  border: solid var(--bg); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.consent a {
  color: var(--ink); text-decoration: underline;
  text-underline-offset: 3px; text-decoration-color: var(--line-hi);
}
.consent a:hover { text-decoration-color: var(--ink); }

/* ── Turnstile mount ─────────────────────────────────── */
.turnstile-mount { margin: 28px 0 0; min-height: 65px; }

/* ── Submit pill(form scene 唯一の mint) ─────────────── */
.submit-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 24px;
  margin: 48px 0 0;
}

button[type="submit"] {
  appearance: none; border: none; cursor: pointer;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(18px, 1.8vw, 22px); letter-spacing: -0.018em;
  background: var(--mint); color: var(--green-deep);
  padding: 22px 38px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 14px;
  transition: transform .18s ease, background .22s ease, box-shadow .22s ease, opacity .2s ease;
}
button[type="submit"]::after { content: "→"; font-size: 0.95em; transition: transform .25s ease; }
button[type="submit"]:hover {
  background: var(--electric);
  transform: translateY(-1px);
  box-shadow: 0 14px 32px -16px rgba(23, 53, 6, .45);
}
button[type="submit"]:hover::after { transform: translateX(4px); }
button[type="submit"]:active { transform: translateY(0); }
button[type="submit"][disabled] { opacity: .55; cursor: progress; }

.submit-row .hint {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--mute); max-width: 28ch; line-height: 1.6;
}

/* ── Status ───────────────────────────────────────────── */
.status {
  margin: 28px 0 0;
  font-size: 14px; line-height: 1.65;
  min-height: 1.65em;
}
.status.error { color: var(--danger); }
.status.ok    { color: var(--ink); }

/* ── Footer ───────────────────────────────────────────── */
footer {
  position: relative; z-index: 1;
  padding: 56px clamp(20px, 6vw, 96px) 48px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--mute);
  display: flex; flex-wrap: wrap; gap: 18px;
  align-items: center; justify-content: space-between;
}
footer a { color: var(--mute); text-decoration: none; transition: color .2s ease; }
footer a:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .ambient { animation: none; }
  .field .ctl::before { transition: none; }
  button[type="submit"]::after { transition: none; }
}
