/* Car TEZZA クルマ探しアンケート — 黒×金 */
:root {
  --bg: #0b0b0c;
  --bg2: #141416;
  --card: #17171a;
  --line: #2c2a26;
  --text: #f3efe6;
  --muted: #a9a294;
  --gold: #c9a45c;
  --gold-hi: #ecd598;
  --gold-lo: #8f6d2f;
  --gold-grad: linear-gradient(135deg, #f1dc9e 0%, #c9a45c 45%, #9a7535 100%);
  --danger: #ff8a7a;
  --radius: 14px;
  --tap: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(201,164,92,.18), transparent 60%),
    linear-gradient(180deg, #0f0e0c 0%, var(--bg) 40%);
  background-color: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px calc(28px + var(--safe-b));
}

/* ---------- Header ---------- */
.header { text-align: center; padding: 8px 0 18px; }
.logo {
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.logo-line {
  flex: 0 1 44px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.logo-line:last-child { background: linear-gradient(90deg, var(--gold), transparent); }
.logo-text {
  font-family: "Didot", "Bodoni 72", "Times New Roman", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 34px;
  letter-spacing: .06em;
  line-height: 1.2;
  font-style: italic;
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  white-space: nowrap;
}
.logo-text b { font-style: normal; font-weight: 700; letter-spacing: .12em; }
.title {
  margin: 6px 0 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--text);
}
.lead { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- Progress ---------- */
.progress { margin: 0 2px 14px; }
.progress-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px;
}
.progress-step {
  font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--gold);
}
.progress-name { font-size: 13px; color: var(--muted); }
.progress-bar {
  height: 4px; border-radius: 4px; background: #2a2823; overflow: hidden;
}
.progress-bar span {
  display: block; height: 100%; width: 0;
  background: var(--gold-grad);
  transition: width .35s ease;
}
.progress-dots {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: flex; justify-content: space-between;
}
.progress-dots li {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2f2c26; border: 1px solid #3a362e;
  transition: background .3s, border-color .3s;
}
.progress-dots li.done { background: var(--gold-lo); border-color: var(--gold-lo); }
.progress-dots li.now { background: var(--gold-hi); border-color: var(--gold-hi); box-shadow: 0 0 0 3px rgba(236,213,152,.18); }

/* ---------- Card ---------- */
.card {
  background: linear-gradient(180deg, #1b1a1d, var(--card));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 18px 18px;
  box-shadow: 0 20px 40px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.03);
  position: relative;
}
.card::before {
  content: ""; position: absolute; left: 18px; right: 18px; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: .7;
}

.step { animation: fadeIn .28s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.step-title {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 6px; font-size: 20px; letter-spacing: .06em;
}
.step-title .num {
  display: inline-grid; place-items: center;
  min-width: 34px; height: 34px; padding: 0 6px;
  border: 1px solid var(--gold); border-radius: 50%;
  font-family: "Times New Roman", serif; font-size: 14px; color: var(--gold-hi);
}
.step-desc { margin: 0 0 18px; font-size: 14px; color: var(--muted); }

/* ---------- Fields ---------- */
.field { margin-bottom: 18px; }
.field > label {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px; font-size: 15px; font-weight: 700;
}
.req, .opt {
  font-size: 11px; font-weight: 700; line-height: 1;
  padding: 4px 7px; border-radius: 4px; letter-spacing: .05em;
}
.req { background: var(--gold-grad); color: #1a1406; }
.opt { border: 1px solid #4a453b; color: var(--muted); font-weight: 500; }

input[type="text"], input[type="tel"], select, textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 14px 16px;
  font: inherit; font-size: 16px; /* 16px未満だとiOSで拡大される */
  color: var(--text);
  background: #0e0e10;
  border: 1px solid #3a372f;
  border-radius: var(--radius);
  outline: none;
  -webkit-appearance: none; appearance: none;
  transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; min-height: 130px; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: #6d685e; }
input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,164,92,.2);
}
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 18px; top: 50%;
  width: 9px; height: 9px; margin-top: -7px;
  border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold);
  transform: rotate(45deg); pointer-events: none;
}
select { padding-right: 44px; }
select:invalid, select.placeholder { color: #6d685e; }
select option { color: #111; background: #fff; }

.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }
.field.invalid .choice span { border-color: rgba(255,138,122,.6); }
.error { margin: 6px 0 0; font-size: 13px; color: var(--danger); min-height: 0; }
.error:empty { display: none; }
.hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.hint.center { text-align: center; }

/* ---------- Choice buttons ---------- */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choices.list { grid-template-columns: 1fr; }
.choices.three { grid-template-columns: repeat(3, 1fr); }
.choices.three .choice span { padding-left: 6px; padding-right: 6px; }
.choices.chips { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.choice { position: relative; display: block; cursor: pointer; }
.choice.wide { grid-column: 1 / -1; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.choice span {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap);
  padding: 12px 14px;
  border: 1px solid #3a372f; border-radius: var(--radius);
  background: #0f0f11;
  font-size: 16px; font-weight: 700; text-align: center; line-height: 1.35;
  transition: border-color .15s, background .15s, color .15s, transform .08s;
}
.choices.list .choice span { justify-content: flex-start; padding-left: 52px; position: relative; }
.choices.list .choice span::before {
  content: ""; position: absolute; left: 18px; top: 50%;
  width: 20px; height: 20px; margin-top: -10px; border-radius: 50%;
  border: 2px solid #5a5446;
  transition: border-color .15s, box-shadow .15s;
}
.choice span i { font-style: normal; font-size: 20px; }
.choice:active span { transform: scale(.98); }
.choice input:checked + span {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(201,164,92,.22), rgba(201,164,92,.08));
  color: var(--gold-hi);
}
.choices.list .choice input:checked + span::before {
  border-color: var(--gold-hi);
  box-shadow: inset 0 0 0 4px #1a1710, inset 0 0 0 10px var(--gold-hi);
}
.choice input[type="checkbox"]:checked + span::after {
  content: "✓"; font-size: 14px; margin-left: 2px;
}

/* 予算：2列×5段 */
.choices.budget .choice span { font-size: 15px; padding: 10px 6px; letter-spacing: .01em; white-space: nowrap; }

/* 車両タイプ：シルエットイラスト付き */
.choices.cars { grid-template-columns: 1fr 1fr; }
.choices.cars .choice.car span {
  position: relative; flex-direction: column; gap: 4px;
  padding: 12px 8px 10px; min-height: 108px;
  font-size: 15px;
}
.car-ic {
  display: block; width: 100%; max-width: 128px; height: auto; aspect-ratio: 120 / 48;
  color: var(--gold); --car-fill: transparent;
  transition: color .15s, filter .15s;
}
.choice input:checked + span .car-ic {
  color: var(--gold-hi); --car-fill: rgba(236,213,152,.16);
  filter: drop-shadow(0 0 6px rgba(236,213,152,.35));
}
.choices.cars .choice.car input:checked + span::after {
  position: absolute; top: 8px; right: 10px; margin: 0;
}
.choice input:focus-visible + span { box-shadow: 0 0 0 3px rgba(201,164,92,.35); }
.sw {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  background: var(--c); border: 1px solid rgba(255,255,255,.35);
}
.sw.multi { background: conic-gradient(#d33, #fc3, #3c6, #39f, #93f, #d33); }

/* ---------- Review ---------- */
.review { display: grid; gap: 12px; }
.review-group {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #111113; overflow: hidden;
}
.review-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: #1c1a16; border-bottom: 1px solid var(--line);
  font-size: 14px; font-weight: 700; color: var(--gold-hi);
}
.review-edit {
  font: inherit; font-size: 13px; font-weight: 700;
  color: var(--gold); background: none; border: 1px solid #5c4c2c; border-radius: 999px;
  padding: 6px 14px; min-height: 36px; cursor: pointer;
}
.review dl { margin: 0; padding: 4px 14px 8px; }
.review dt { font-size: 12px; color: var(--muted); margin-top: 8px; }
.review dd { margin: 0; font-size: 15px; word-break: break-word; white-space: pre-wrap; }
.review dd.empty { color: #6d685e; }
.send-error { margin-top: 14px; padding: 12px 14px; border: 1px solid rgba(255,138,122,.4); border-radius: var(--radius); background: rgba(255,138,122,.07); }
.send-error:empty { display: none; }

/* ---------- Nav buttons ---------- */
.nav {
  display: grid; grid-template-columns: 1fr 2fr; gap: 10px;
  margin-top: 22px;
}
.nav.first { grid-template-columns: 1fr; }
.btn {
  display: flex; align-items: center; justify-content: center;
  min-height: 58px; padding: 12px 18px;
  font: inherit; font-size: 17px; font-weight: 700; letter-spacing: .06em;
  border-radius: 999px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .08s, filter .2s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn-gold {
  border: none; color: #1a1406;
  background: var(--gold-grad);
  box-shadow: 0 8px 20px rgba(201,164,92,.25), inset 0 1px 0 rgba(255,255,255,.4);
}
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid #4a453b;
}
.btn[disabled] { opacity: .55; cursor: wait; }
.btn .spinner {
  width: 18px; height: 18px; margin-right: 10px; border-radius: 50%;
  border: 2px solid rgba(26,20,6,.3); border-top-color: #1a1406;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Thanks ---------- */
.thanks { text-align: center; padding: 36px 20px 26px; animation: fadeIn .4s ease; }
.thanks:focus { outline: none; }
.thanks-mark svg { width: 76px; height: 76px; }
.thanks-mark circle { fill: none; stroke: var(--gold); stroke-width: 1.5; }
.thanks-mark path {
  fill: none; stroke: var(--gold-hi); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .6s .2s ease forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
.thanks-title { margin: 14px 0 8px; font-size: 18px; letter-spacing: .1em; color: var(--gold-hi); }
.thanks-text { margin: 0 0 22px; font-size: 16px; line-height: 1.9; }
.thanks .btn { margin: 0 auto 12px; max-width: 320px; }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 22px 8px 0; }
.privacy {
  margin: 0 auto; max-width: 420px;
  font-size: 12px; color: var(--muted); line-height: 1.7;
  padding-top: 14px; border-top: 1px solid var(--line);
}
.copy { margin: 10px 0 0; font-size: 11px; letter-spacing: .12em; color: #6d685e; }

/* 迷惑送信よけ */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.test-banner {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding: 8px 12px calc(8px + var(--safe-b));
  background: #5a1f17; color: #ffd9d2; font-size: 11px; text-align: center; z-index: 10;
}
body:has(.test-banner:not([hidden])) .page { padding-bottom: 70px; }

@media (max-width: 360px) {
  .logo-text { font-size: 29px; }
  .choices.chips { grid-template-columns: 1fr 1fr; }
  .card { padding: 20px 14px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .thanks-mark path { stroke-dashoffset: 0; }
}
