/* Doina Vin · dv-rewards: the quiz page ("Ce vin vi se potrivește?"). Kit parts: .dvh-pagehead, .dvh-lead, .dvh-btn,
   .dvh-progress, .dvh-cards / .dvh-card (the theme's wine cards); only the additions here. Loaded on this page only. */

.dvrw-quiz { padding-bottom: var(--section, 64px); }
.dvrw-quiz__head .dvh-lead { max-width: 60ch; margin: var(--sp-3) 0 0; }
.dvrw-quiz__body { display: grid; gap: var(--sp-6, 32px); }
.dvrw-quiz__h2 { margin: 0; font-family: var(--font-display); font-size: var(--fs-h3, 1.5rem); line-height: var(--lh-h3, 1.25); font-weight: var(--fw-title, 500); color: var(--ink); text-wrap: balance; }

/* the form: a card holding one question at a time (with JavaScript) or all four */
.dvrw-quiz__form {
  display: grid; gap: var(--sp-5); max-width: 760px; padding: var(--sp-5); box-sizing: border-box;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-media, 8px);
}
.dvrw-quiz__progress { padding: 0; background: none; }
.dvrw-quiz__progress .dvh-progress__track, .dvrw-quiz__progress .dvh-progress__fill { display: block; }
.dvrw-quiz__progress .dvh-progress__fill { transition: width .25s cubic-bezier(.2, .8, .2, 1); }
.dvrw-q { display: grid; gap: var(--sp-3); min-width: 0; margin: 0; padding: 0; border: 0; }
.dvrw-q[hidden] { display: none; }
.dvrw-q legend { display: grid; gap: var(--sp-1); margin: 0 0 var(--sp-3); padding: 0; outline: none; }
.dvrw-q legend:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 2px; }
.dvrw-q__n { color: var(--muted); font-size: var(--fs-meta); line-height: var(--lh-meta); font-variant-numeric: tabular-nums; }
.dvrw-q__t { font-family: var(--font-display); font-size: var(--fs-h3, 1.5rem); line-height: var(--lh-h3, 1.25); font-weight: var(--fw-title, 500); color: var(--ink); text-wrap: balance; }
.dvrw-q__opts { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* an answer: a pill around a radio (the radio stays in the page for the keyboard and screen readers) */
.dvrw-opt { position: relative; display: inline-flex; cursor: pointer; }
.dvrw-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.dvrw-opt span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--sp-4); box-sizing: border-box;
  border: 1px solid var(--control); border-radius: 999px; background: var(--surface);
  font-size: var(--fs-ui); line-height: 1.2; font-weight: var(--fw-ui, 500); color: var(--ink);
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.dvrw-opt:hover span { border-color: var(--ink); }
.dvrw-opt input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.dvrw-opt input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

.dvrw-quiz__nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }
.dvrw-quiz__nav [hidden] { display: none; }
.dvrw-quiz__nav:not(:has(> :not([hidden]))) { display: none; }
.dvrw-quiz__nav .dvh-btn { min-height: 44px; gap: var(--sp-1); }
.dvrw-quiz__nav .dvh-icon { width: 18px; height: 18px; }
.dvrw-quiz__form.is-steps .dvrw-quiz__nav [data-dvrw-submit] { margin-left: auto; }
.dvrw-quiz__form.is-steps .dvrw-quiz__nav [data-dvrw-next] { margin-left: auto; }

/* results */
.dvrw-quiz__res { display: grid; gap: var(--sp-4); }
.dvrw-quiz__note { display: flex; align-items: flex-start; gap: var(--sp-2); max-width: 70ch; margin: 0; font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--ink); }
.dvrw-quiz__note .dvh-icon { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--muted); }
.dvrw-quiz__note.is-ok .dvh-icon { color: var(--success); }
.dvrw-quiz__note a, .dvrw-quiz__fine a { color: var(--link); text-underline-offset: .18em; }
.dvrw-quiz__cards { margin-top: var(--sp-2); }
@media (min-width: 1200px) { .dvrw-quiz__cards { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 980px; } }
.dvrw-why { display: flex; align-items: flex-start; gap: 6px; margin: var(--sp-1) 0 var(--sp-2); padding-inline: 6px; font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--success); }
.dvrw-why .dvh-icon { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.dvrw-quiz__more { margin: 0; }
.dvrw-quiz__fine { max-width: 70ch; margin: 0; color: var(--muted); font-size: var(--fs-meta); line-height: var(--lh-meta); }

@media (max-width: 599.98px) {
  .dvrw-quiz__form { padding: var(--sp-4); }
  .dvrw-opt { flex: 1 1 calc(50% - var(--sp-2)); }
  .dvrw-opt span { width: 100%; justify-content: center; text-align: center; padding: 6px var(--sp-3); border-radius: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .dvrw-opt span, .dvrw-quiz__progress .dvh-progress__fill { transition: none; }
}
