/* MeowBTI Enneagram quiz (enn-v1). Loaded after style.css; reuses its tokens
   and the MBTI .likert-* / .quiz-progress / .quiz-nav / .btn-* classes.
   Everything new is scoped to #enn-quiz-app or .ennq-*. */

#enn-quiz-app { min-height: 480px; }

.ennq-sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Visible keyboard focus (style.css has none). */
#enn-quiz-app a:focus-visible,
#enn-quiz-app button:focus-visible {
  outline: 3px solid var(--ink); outline-offset: 3px;
}
#enn-quiz-app [tabindex="-1"]:focus { outline: none; }

/* ── Intro ── */
.ennq-intro { max-width: 640px; margin: 0 auto; padding: 44px 0 56px; }
.ennq-intro-title {
  font-family: var(--font-display); font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.1; text-align: center; margin-bottom: 14px;
}
.ennq-intro-lead { text-align: center; color: var(--ink-soft); font-size: 1.05rem; line-height: 1.6; margin: 0 auto 28px; max-width: 540px; }
.ennq-how {
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius-lg);
  padding: 24px 22px; box-shadow: var(--shadow-card) var(--ink-08, rgba(31,20,16,0.08));
  margin-bottom: 28px;
}
.ennq-how h2 { font-family: var(--font-display); font-size: 1.35rem; margin-bottom: 14px; }
.ennq-how-list { list-style: none; counter-reset: ennq-how; display: grid; gap: 14px; }
.ennq-how-list li {
  counter-increment: ennq-how; position: relative; padding-left: 42px;
  line-height: 1.55; color: var(--ink);
}
.ennq-how-list li::before {
  content: counter(ennq-how); position: absolute; left: 0; top: -1px;
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ink);
  background: var(--soft); font-weight: 700; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
}
.ennq-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.ennq-resume {
  background: var(--surface-warm); border: 2px solid var(--accent); border-radius: var(--radius-lg);
  padding: 22px; text-align: center;
}
.ennq-resume h2 { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 6px; }
.ennq-resume p { color: var(--ink-soft); margin-bottom: 16px; }
.ennq-last-result { text-align: center; margin-top: 18px; color: var(--ink-soft); }
.ennq-last-result a { font-weight: 700; color: var(--accent-deep, var(--accent)); display: inline-block; padding: 12px 2px; }
.ennq-disclaimer {
  margin-top: 28px; font-size: 0.82rem; line-height: 1.6; color: var(--ink-soft);
  border-top: 1.5px solid var(--line-soft); padding-top: 16px;
}
.ennq-clear { margin-top: 10px; text-align: center; }
.ennq-status { font-size: 0.9rem; font-weight: 600; color: var(--sage-deep, var(--ink)); min-height: 1.4em; margin-top: 6px; }
.ennq-status:empty { min-height: 0; margin: 0; }

/* Text-style button, still a 44px target. */
.ennq-linkbtn {
  background: none; border: 0; font: inherit; font-size: 0.9rem; font-weight: 600;
  color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer; min-height: 44px; padding: 10px 6px;
}
.ennq-linkbtn:hover { color: var(--ink); }

.ennq-confirm {
  margin: 12px auto 0; max-width: 460px; background: var(--paper);
  border: 2px solid var(--ink); border-radius: var(--radius-md); padding: 16px;
  text-align: center;
}
.ennq-confirm[hidden] { display: none; }
.ennq-confirm-text { font-size: 0.95rem; line-height: 1.5; margin-bottom: 12px; }
.ennq-confirm-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.ennq-btn-sm { font-size: 0.95rem; padding: 10px 20px; min-height: 44px; }

.ennq-notice {
  background: var(--soft); border: 2px solid var(--ember); border-radius: var(--radius-md);
  padding: 12px 14px; font-size: 0.9rem; line-height: 1.5; margin: 0 0 20px;
}

/* ── Question pages ── */
.ennq-progress .progress-label { font-variant-numeric: tabular-nums; }
.ennq-item { scroll-margin-top: 120px; }
.ennq-qnum { color: var(--ink-soft); font-weight: 700; font-size: 0.9em; margin-right: 2px; }
.ennq-item.ennq-missing {
  border-color: var(--accent); opacity: 1;
  box-shadow: 0 0 0 3px rgba(255, 91, 59, 0.18);
}
.ennq-scale { gap: 14px; }

/* Each option = a 44px hit area (label) with the visible ring on ::before,
   sized like the MBTI dots: ends big, middle small. */
.ennq-dot {
  position: relative; display: inline-flex; flex-shrink: 0;
  width: 44px; height: 44px; cursor: pointer; border-radius: 50%;
}
.ennq-dot input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; opacity: 0; cursor: pointer;
}
.ennq-dot::before {
  content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--paper); box-sizing: border-box;
  border: 2.5px solid var(--ink-20, rgba(31,20,16,0.2));
  transition: transform 0.12s, background 0.12s;
  pointer-events: none;
}
.ennq-dot.size-3::before { width: 44px; height: 44px; }
.ennq-dot.size-2::before { width: 36px; height: 36px; }
.ennq-dot.size-1::before { width: 28px; height: 28px; }
.ennq-dot.agree::before { border-color: var(--accent); }
.ennq-dot.disagree::before { border-color: var(--iris); }
.ennq-dot:hover::before { transform: translate(-50%, -50%) scale(1.12); }
.ennq-dot.agree.selected::before { background: var(--accent); }
.ennq-dot.disagree.selected::before { background: var(--iris); }
.ennq-dot.neutral.selected::before { background: var(--ink-soft); }
.ennq-dot.selected::after {
  /* a centre dot so the choice is not shown by colour alone */
  content: ''; position: absolute; top: 50%; left: 50%; width: 8px; height: 8px;
  transform: translate(-50%, -50%); border-radius: 50%; background: var(--paper);
  pointer-events: none;
}
.ennq-dot:has(input:focus-visible)::before { outline: 3px solid var(--ink); outline-offset: 3px; }
@supports not selector(:has(a)) {
  .ennq-dot:focus-within::before { outline: 3px solid var(--ink); outline-offset: 3px; }
}

.ennq-nav .btn-primary, .ennq-nav .btn-secondary { min-height: 48px; }
.ennq-nav { padding-bottom: 12px; }
.ennq-restart { text-align: center; padding-bottom: 60px; }

@media (max-width: 480px) {
  .ennq-intro { padding-top: 32px; }
  .ennq-how { padding: 20px 16px; }
  .ennq-how-list li { padding-left: 38px; }
  .ennq-scale { gap: 0; justify-content: space-between; max-width: 320px; margin: 0 auto; }
  .ennq-dot.size-3::before { width: 40px; height: 40px; }
  .ennq-dot.size-2::before { width: 33px; height: 33px; }
  .ennq-dot.size-1::before { width: 26px; height: 26px; }
  .ennq-nav .btn-primary, .ennq-nav .btn-secondary { padding-left: 18px; padding-right: 18px; }
  .ennq-actions .btn-primary, .ennq-actions .btn-secondary { width: 100%; }
}

html[lang="th"] .ennq-intro-lead,
html[lang="th"] .ennq-how-list li,
html[lang="th"] .ennq-disclaimer { line-height: 1.75; }
html[lang="th"] .ennq-intro-title { line-height: 1.32; }

@media (prefers-reduced-motion: reduce) {
  .ennq-dot::before { transition: none; }
  .ennq-dot:hover::before { transform: translate(-50%, -50%); }
}
