/* assets/styles.css — UI ของ quiz funnel (mobile-first, ปรับแบรนด์ได้ผ่านตัวแปร) */
:root {
  --bg: #04284f;
  --card: #ffffff;
  --ink: #15314f;
  --ink-soft: #52657c;
  --line: #dbe5ef;
  --navy: #023466;
  --gold: #f2b543;
  --brand: #023466;        /* navy accent — option borders, focus, selected */
  --brand-ink: #ffffff;
  --brand-soft: #c2dcf2;   /* callout — selected option bg, result chip */
  --ok: #023466;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 23, 32, 0.12);
  font-family: -apple-system, "Segoe UI", "Sukhumvit Set", "Noto Sans Thai",
    Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 50% -10%, #07376d, var(--bg));
  color: var(--ink);
  display: flex;
  justify-content: center;
  padding: 24px 16px 40px;
}

.quiz-shell { width: 100%; max-width: 620px; }

.quiz-head { text-align: center; color: #eaf1f8; margin-bottom: 18px; }
.quiz-kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 6px;
}
.quiz-title { font-size: 26px; line-height: 1.25; margin: 0 0 8px; }
.quiz-sub { margin: 0; color: #aebfcf; font-size: 15px; }

/* progress */
.progress { margin: 0 4px 12px; display: flex; align-items: center; gap: 10px; }
.progress-bar {
  position: relative;
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--pct, 0%);
  background: linear-gradient(90deg, #7394b2, #c2dcf2);
  border-radius: 99px;
  transition: width 0.35s ease;
}
.progress-text { color: #aebfcf; font-size: 13px; font-variant-numeric: tabular-nums; }

/* card */
.quiz-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 22px;
  animation: rise 0.3s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.q-text { font-size: 19px; font-weight: 700; line-height: 1.4; margin: 0 0 18px; }

.options { display: grid; gap: 10px; }
.option {
  text-align: left;
  width: 100%;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 14px 16px;
  border-radius: 11px;
  font-size: 15.5px;
  line-height: 1.45;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.05s;
}
.option:hover { border-color: var(--brand); background: var(--brand-soft); }
.option:active { transform: scale(0.99); }
.option.selected { border-color: var(--brand); background: var(--brand-soft); }

.q-nav { margin-top: 16px; display: flex; justify-content: space-between; align-items: center; }
.linkbtn {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
  padding: 6px;
}
.linkbtn:hover { color: var(--brand); }
.linkbtn[disabled] { opacity: 0; pointer-events: none; }

/* lead form */
.lead-intro { margin: 0 0 18px; color: var(--ink-soft); font-size: 15px; line-height: 1.5; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input,
.field select {
  width: 100%;
  padding: 12px 13px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
}
.field input:focus,
.field select:focus { outline: none; border-color: var(--brand); }
.field .hint { font-size: 12.5px; color: var(--ink-soft); margin-top: 5px; }
.field .err { font-size: 12.5px; color: #d23b3b; margin-top: 5px; }

.cta {
  width: 100%;
  margin-top: 6px;
  background: var(--gold);
  color: var(--navy);
  border: none;
  padding: 14px;
  border-radius: 11px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s;
}
.cta:hover { filter: brightness(1.06); }
.cta[disabled] { opacity: 0.6; cursor: progress; }

.form-error { color: #d23b3b; font-size: 14px; margin-top: 10px; text-align: center; }

/* honeypot — ซ่อนจากคนจริง (บอทมักกรอกให้) */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

/* secondary CTA — ปุ่มไปต่อบนหน้าผลลัพธ์ (navy outline, ไม่แย่งโฟกัสจากปุ่มทอง) */
.cta-next { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.cta-next:hover { background: var(--brand-soft); filter: none; }

/* LINE CTA — รับ lead magnet ทาง LINE (ใช้ LINE CI: เขียว #06C755) */
.cta-line {
  width: 100%; margin-top: 6px; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #06C755; color: #ffffff;
  padding: 14px; border-radius: 11px;
  font-size: 16px; font-weight: 700; text-decoration: none;
  transition: filter 0.15s;
}
.cta-line:hover { filter: brightness(1.06); }

/* result */
.result-badge {
  display: inline-block;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 99px;
  margin-bottom: 12px;
}
.result-title { font-size: 22px; margin: 0 0 12px; line-height: 1.3; }
.result-desc { color: var(--ink-soft); font-size: 15.5px; line-height: 1.6; margin: 0 0 18px; }
.result-file {
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  padding: 16px;
  background: #fafcff;
}
.result-file .file-label { font-size: 13px; color: var(--ink-soft); margin: 0 0 6px; }
.result-file .file-name { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
.result-file .sent { color: var(--ok); font-size: 14px; margin: 0; }

.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(2, 52, 102, 0.25);
  border-top-color: var(--navy);
  border-radius: 50%;
  display: inline-block;
  vertical-align: -3px;
  margin-right: 8px;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
  .quiz-title { font-size: 22px; }
  .quiz-card { padding: 22px 16px; }
  .q-text { font-size: 17.5px; }
}
