/* แบบทดสอบบุคลิกภาพในที่ทำงาน — mobile-first, ไม่มี CSS framework
   Design direction: น่ารัก / ลายเส้นมือวาด / minimal (กำหนดโดยอรุณ)
   หมายเหตุ: ไฟล์นี้เปลี่ยนเฉพาะ "หน้าตา" — ชื่อ class เดิมคงไว้ทั้งหมด */

:root {
  --bg: #FFF9F2;
  --card: #FFFFFF;
  --accent: #FF9EAA;   /* โคราลชมพู */
  --accent2: #8FE0D6;  /* มินต์ */
  --text: #4A4458;     /* พลัมเข้ม ใช้แทนดำ/ขาวล้วน */
  --muted: #9A93A8;
  --line: #EFE7F0;
  --radius: 22px;

  /* เงานุ่มแบบมีสี (ไม่ใช้สีดำ) ใช้แทน border เดิม */
  --shadow: 0 10px 26px -14px rgba(255, 158, 170, 0.6),
            0 4px 12px -8px rgba(143, 224, 214, 0.45);
  --shadow-lift: 0 16px 34px -14px rgba(255, 158, 170, 0.7),
                 0 6px 16px -8px rgba(143, 224, 214, 0.5);

  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 16px;
  background: var(--bg);
  color: var(--text);
  font-family: "Sarabun", "Noto Sans Thai", -apple-system, "Segoe UI", system-ui, sans-serif;
  line-height: 1.7;
  min-height: 100vh;
}

main, .header, .footer { max-width: 560px; margin: 0 auto; }

/* ---------- Header ---------- */
.header { text-align: center; padding: 20px 0 8px; }
.header h1 { margin: 0; font-size: 1.6rem; }
.sub { margin: 6px 0 0; color: var(--muted); font-size: 0.9rem; }

/* ---------- Card ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 18px;
  margin: 16px 0;
  transition: transform 0.25s var(--bounce), box-shadow 0.25s ease;
}
.card:hover { transform: scale(1.01); box-shadow: var(--shadow-lift); }
.intro-text { margin: 0 0 18px; font-size: 0.98rem; }
.hint { color: var(--muted); font-size: 0.8rem; text-align: center; margin: 12px 0 0; }

/* แถวไอคอนตกแต่งบนหน้าแนะนำ */
.intro-icons {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 16px;
}
.intro-icons .mascot { height: 78px; }

.btn-primary {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 16px;
  background: var(--accent);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px -10px rgba(255, 158, 170, 1);
  transition: transform 0.2s var(--bounce), filter 0.2s ease;
}
.btn-primary:hover { transform: scale(1.03); filter: brightness(1.04); }
.btn-primary:active { transform: scale(0.98); }

/* ---------- Progress ---------- */
.progress { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.progress-bar {
  flex: 1;
  height: 10px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  border-radius: 99px;
  transition: width 0.5s var(--bounce); /* bounce easing ตอนเลื่อนข้อ */
}
.progress-label { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }

/* ---------- คำถาม / ตัวเลือก ---------- */
.question { margin: 0 0 16px; font-size: 1.15rem; line-height: 1.6; }
.choice-list { display: flex; flex-direction: column; gap: 10px; }
.choice-btn {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  background: var(--card);
  color: var(--text);
  border: 2px solid var(--line);
  border-radius: 16px;
  font-family: inherit;
  font-size: 0.97rem;
  line-height: 1.6;
  cursor: pointer;
  transition: transform 0.2s var(--bounce), border-color 0.2s ease, background 0.2s ease;
}
.choice-btn:hover, .choice-btn:focus-visible {
  border-color: var(--accent);
  background: #FFF5F6;
  transform: scale(1.02);
}
.choice-btn:active { transform: scale(0.99); }
.btn-back {
  margin-top: 16px;
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px 0;
}
.btn-back:hover { color: var(--accent); }

/* ---------- ภาพ mascot (ไฟล์ PNG ในโปรเจกต์ ไม่โหลดจากภายนอก) ----------
   ภาพต้นฉบับเป็นแนวตั้งและอัตราส่วนไม่เท่ากันในแต่ละตัว (กว้าง 300–480 สูง 512)
   จึงล็อก "ความสูง" ให้เท่ากันทุกตัวแล้วปล่อยความกว้างตามสัดส่วนจริง
   ถ้าล็อกเป็นกล่องจัตุรัส ตัวที่ผอมจะดูเล็กกว่าตัวอื่นอย่างเห็นได้ชัด */
.mascot {
  display: block;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  margin: 0 auto;
}

/* ---------- ผลลัพธ์ ---------- */
.result-head { text-align: center; margin-bottom: 16px; }
.result-icon { display: block; margin: 0 auto 6px; }
.result-icon .mascot { height: 168px; }
.result-head h2 { margin: 4px 0 2px; font-size: 1.35rem; }
.result-tagline { margin: 0; color: var(--muted); font-size: 0.9rem; }
.result-desc {
  background: #FFF5F6;
  border-radius: 16px;
  padding: 14px;
  margin: 0 0 12px;
  font-size: 0.96rem;
}

.trait-block { margin-bottom: 12px; }
.trait-block h3 { margin: 0 0 6px; font-size: 1rem; }
.trait-block ul { margin: 0; padding-left: 20px; }
.trait-block li { margin-bottom: 4px; font-size: 0.95rem; }
.trait-block p { margin: 0; font-size: 0.95rem; }

/* ---------- CTA + Disclosure ---------- */
.cta-block {
  border-top: 2px dashed var(--line);
  margin-top: 18px;
  padding-top: 16px;
}
.cta-block h3 { margin: 0 0 10px; font-size: 1rem; }
.disclosure {
  background: #F0FBF9;
  border-left: 4px solid var(--accent2);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 12px;
  font-size: 0.82rem;
}
.product-list { display: flex; flex-direction: column; gap: 8px; }
.product-btn {
  display: block;
  background: linear-gradient(180deg, #ee6a3a, #d94f21);
  color: #fff;
  text-decoration: none;
  text-align: center;
  padding: 13px 12px;
  border-radius: 16px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 8px 18px -12px rgba(217, 79, 33, 0.95);
  transition: transform 0.2s var(--bounce), filter 0.2s ease;
}
.product-btn:hover { transform: scale(1.02); filter: brightness(1.05); }
.product-btn .ext { font-weight: 400; font-size: 0.78rem; opacity: 0.92; display: block; }

/* ---------- ปุ่มท้ายหน้า ---------- */
.actions { display: flex; gap: 8px; margin-top: 18px; }
.actions button {
  flex: 1;
  padding: 12px;
  border-radius: 16px;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s var(--bounce);
}
.actions button:hover { transform: scale(1.03); }
.btn-share { background: var(--accent2); color: var(--text); }
.btn-reset { background: transparent; color: var(--muted); border: 2px solid var(--line) !important; }

.share-fallback {
  margin-top: 12px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}
.share-fallback a { color: var(--accent); margin: 0 8px; }

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 8px 0 32px;
}
.footer p { margin: 4px 0; }

/* ---------- Micro-interaction: ไอคอนขยับเบา ๆ ---------- */
@keyframes wiggle {
  0%, 100% { transform: rotate(-3deg); }
  50%      { transform: rotate(3deg); }
}
/* หมุนรอบปลายเท้า ไม่ใช่กลางภาพ ตัวละครจะได้ดูโยกตัวแทนที่จะดูลอยหมุน */
.mascot { transform-origin: bottom center; }
.result-icon .mascot { animation: wiggle 2.8s ease-in-out infinite; }
.intro-icons .mascot { animation: wiggle 3.4s ease-in-out infinite; }
.intro-icons .mascot:nth-child(2) { animation-delay: 0.4s; }
.intro-icons .mascot:nth-child(3) { animation-delay: 0.8s; }

/* ---------- จอใหญ่ขึ้น ---------- */
@media (min-width: 480px) {
  .header h1 { font-size: 1.9rem; }
  .result-icon .mascot { height: 190px; }
  .intro-icons .mascot { height: 92px; }
}

/* ---------- เคารพการตั้งค่าลดการเคลื่อนไหวของผู้ใช้ ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .card:hover,
  .btn-primary:hover,
  .choice-btn:hover,
  .product-btn:hover,
  .actions button:hover { transform: none; }
}
