/* ==========================================================================
   LOVIAX — tool.css
   Loaded only on tool pages (pages.php → 'styles' => ['tool']).
   Shared by every quiz/finder so each tool is data, not new CSS.

   Flow: intro → question (progress, choices, back/next, validation)
         → result (hero, meaning, explore, next step, product discovery,
                   related tools, share, disclaimer)
   ========================================================================== */

/* TOOL SHELL --------------------------------------------------------------- */
.tool {
  padding-block: var(--space-6) var(--space-7);
}

.tool__panel {
  max-width: 44rem;
  margin-inline: auto;
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 40rem) {
  .tool__panel {
    padding: var(--space-6) var(--space-7);
  }
}

/* INTRO -------------------------------------------------------------------- */
.tool-intro > * + * {
  margin-top: var(--space-4);
}

/* The user's problem, in their words */
.tool-intro__problem {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-style: italic;
  line-height: var(--leading-snug);
  color: var(--color-ink-soft);
}

.tool-intro__steps {
  display: grid;
  gap: var(--space-2);
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.tool-intro__steps li {
  display: flex;
  gap: var(--space-3);
  align-items: baseline;
  counter-increment: step;
}

.tool-intro__steps li::before {
  content: counter(step);
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 50%;
  background: var(--color-accent-tint);
  color: var(--color-accent);
  font-size: var(--text-sm);
  font-weight: 700;
}

.tool-intro__actions {
  padding-top: var(--space-2);
}

/* QUESTION ----------------------------------------------------------------- */
.quiz__progress {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.quiz__progress-label {
  display: flex;
  justify-content: space-between;
  color: var(--color-muted);
  font-size: var(--text-sm);
  font-weight: 600;
}

/* Native <progress> — accessible by default, styled consistently */
.quiz__progress progress {
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-surface-tint);
  overflow: hidden;
  appearance: none;
}

.quiz__progress progress::-webkit-progress-bar {
  background: var(--color-surface-tint);
  border-radius: var(--radius-pill);
}

.quiz__progress progress::-webkit-progress-value {
  background: var(--color-accent);
  border-radius: var(--radius-pill);
  transition: width 250ms ease;
}

.quiz__progress progress::-moz-progress-bar {
  background: var(--color-accent);
  border-radius: var(--radius-pill);
}

.quiz__question {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 560;
  line-height: var(--leading-snug);
  text-wrap: balance;
}

/* JS-only controls stay hidden when JavaScript is unavailable */
.no-js [data-quiz-start] {
  display: none;
}

.choices__list {
  display: grid;
  gap: var(--space-3);
}

.quiz .choices legend {
  margin-bottom: var(--space-2);
}

.quiz__help {
  margin-bottom: var(--space-4);
  color: var(--color-muted);
  font-size: 0.9375rem;
}

.quiz__error {
  margin-top: var(--space-4);
}

.quiz__nav {
  display: flex;
  flex-wrap: wrap-reverse;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-line);
}

@media (max-width: 29.99rem) {
  .quiz__nav .btn {
    flex: 1 1 100%;
  }
}

/* RESULT ------------------------------------------------------------------- */
.result > * + * {
  margin-top: var(--space-6);
}

.result-hero {
  padding: var(--space-6) var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--cat-tint, var(--color-accent-tint));
  text-align: center;
}

.result-hero > * + * {
  margin-top: var(--space-3);
}

.result-hero__label {
  color: var(--cat, var(--color-accent));
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-hero__title {
  font-family: var(--font-serif);
  line-height: var(--leading-tight);
  font-size: var(--text-3xl);
  font-weight: 520;
  letter-spacing: -0.02em;
}

.result-hero__summary {
  max-width: 32rem;
  margin-inline: auto;
  font-size: var(--text-lg);
  color: var(--color-ink-soft);
}

.result-hero__alt {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

/* Each result block: "What this means", "What you can explore", … */
.result-section > * + * {
  margin-top: var(--space-3);
}

.result-section__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xl);
}

.result-section__title .icon {
  color: var(--color-accent);
}


/* Next step: one clear recommended action */
.next-step {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5);
  border: 1.5px solid var(--color-ink);
  border-radius: var(--radius-lg);
}

.next-step__title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 560;
  line-height: var(--leading-snug);
}

@media (min-width: 40rem) {
  .next-step {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

/* Product discovery: what to look for, then an optional guide link */
.discovery {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--cat-choose-tint);
}

.discovery > * + * {
  margin-top: var(--space-3);
}

.discovery__title {
  font-size: var(--text-lg);
}

.discovery__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0;
  list-style: none;
}

.discovery__tags li {
  padding: 0.35em 0.8em;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  font-size: 0.9375rem;
}

/* Share bar */
.share-bar {
  display: grid;
  gap: var(--space-3);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-line);
}

.share-bar__title {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
}

.share-bar__status {
  min-height: 1.5em;
  color: var(--color-success);
  font-size: var(--text-sm);
  font-weight: 600;
}

/* Educational disclaimer at the end of every result */
.result-disclaimer {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-info-tint);
  color: var(--color-ink-soft);
  font-size: var(--text-sm);
}

.result-disclaimer .icon {
  margin-top: 0.1em;
}

/* SEO / supporting content around the tool --------------------------------- */
.tool-content {
  padding-block: var(--space-7);
}

.tool-content .prose {
  margin-inline: auto;
}

/* Result types grid, e.g. "The four skin types" */
.type-grid {
  --min: 14rem;
}

.type-grid .card__title {
  font-size: var(--text-lg);
}

/* Tool page content ---------------------------------------------------------- */
.tool-page .page-header {
  padding-bottom: 0;
}

.tool [data-quiz-shared] {
  margin-bottom: var(--space-5);
}


.faq > * + * {
  margin-top: var(--space-5);
}

.faq h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}
