/* Self-assessment quiz widget (/guide/quiz.js).
   Separate file rather than an addition to guide.css: only ~5 pages load it,
   and guide.css is on all 543. Variables come from guide.css, which is always
   loaded first, so the widget follows the theme automatically. */

.luna-quiz {
  margin: 28px 0;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.luna-quiz__q {
  border: 0;
  padding: 0;
  margin: 0 0 18px;
}
.luna-quiz__q:last-of-type { margin-bottom: 22px; }

.luna-quiz__q-text {
  padding: 0;
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
}

.luna-quiz__opts { display: grid; gap: 6px; }

/* 44px min height: these are tapped on a phone inside Telegram. */
.luna-quiz__opt {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.luna-quiz__opt:hover { border-color: var(--accent); }
.luna-quiz__opt:has(input:checked) {
  border-color: var(--accent);
  background: rgba(232, 160, 191, 0.1);
}
.luna-quiz__opt input { accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
/* Keyboard focus must stay visible — the label swallows the input outline. */
.luna-quiz__opt:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.luna-quiz__submit,
.luna-quiz__share,
.luna-quiz__retake,
.luna-quiz__cta-btn {
  min-height: 44px;
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}
.luna-quiz__submit {
  width: 100%;
  border: 0;
  background: var(--accent);
  color: #fff;
}
.luna-quiz__submit:hover { filter: brightness(0.96); }

.luna-quiz__error {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--accent-dark, #b0507f);
}

.luna-quiz__result {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.luna-quiz__result-title { font-size: 19px; margin: 0 0 6px; text-align: left; }
.luna-quiz__score { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.luna-quiz__result-text p { margin: 0 0 10px; font-size: 15px; line-height: 1.6; }
.luna-quiz__result-text ul { margin: 0 0 10px; padding-left: 20px; font-size: 15px; line-height: 1.6; }

.luna-quiz__actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 4px; }

.luna-quiz__cta {
  margin-top: 18px;
  padding: 16px;
  background: var(--bg, transparent);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.luna-quiz__cta p { margin: 0 0 12px; font-size: 15px; line-height: 1.6; }
.luna-quiz__cta-btn {
  display: inline-block;
  text-decoration: none;
  border-color: var(--accent);
  color: var(--accent-dark, var(--text));
}
.luna-quiz__cta-btn:hover { background: rgba(232, 160, 191, 0.08); }

.luna-quiz__disclaimer {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

@media (max-width: 500px) {
  .luna-quiz { padding: 16px; }
  .luna-quiz__actions { flex-direction: column; }
  .luna-quiz__actions button { width: 100%; }
}
