/* Quiz de estilo — same world as the home: cream, gold hairlines, Caslon for questions, Jost for UI.
   Option rows follow the home's .tool-list rows (gold top rule, hairlines, paper on hover). No cards. */

.quiz-page {
  max-width: 1180px; margin: 0 auto;
  padding: clamp(36px, 5vw, 72px) var(--gutter) clamp(72px, 8vw, 120px);
}
.quiz-intro { max-width: 720px; }
.quiz-intro h1 {
  margin: 0 0 14px;
  font: 400 clamp(38px, 4.6vw, 60px)/1.06 var(--font-display); letter-spacing: -0.015em; text-wrap: balance;
}
.quiz-lead { margin: 0; max-width: 46ch; color: var(--ink-2); font-size: 17px; }

.quiz { margin-top: clamp(32px, 4.5vw, 56px); scroll-margin-top: calc(var(--header-h) + 12px); }

/* ---------- progress bar ---------- */
.q-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: clamp(14px, 2.4vw, 28px); }
.q-back {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding-right: 4px;
  font-size: 13px; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--ink-2);
  transition: color .2s, transform .16s var(--ease-out);
}
.q-back svg { width: 18px; height: 18px; color: var(--gold-text); transition: transform .25s var(--ease-out); }
.q-back:active, .q-restart:active, .qr-ans:active { transform: scale(.97); }
.q-back:disabled { visibility: hidden; }
.q-track { position: relative; height: 1px; background: var(--line); }
.q-track span {
  position: absolute; left: 0; right: 0; top: -0.5px; height: 2px; background: var(--gold);
  transform-origin: 0 50%; transform: scaleX(var(--p, 0));
  transition: transform .45s var(--ease-out);
}
.q-count { margin: 0; font-size: 14px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- a question ---------- */
.q-screen {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); align-items: start;
  padding-top: clamp(28px, 3.5vw, 48px);
}
.q-screen.is-fwd { animation: q-in-fwd .28s var(--ease-out); }
.q-screen.is-back { animation: q-in-back .28s var(--ease-out); }
@keyframes q-in-fwd { from { opacity: 0; transform: translateX(10px); } }
@keyframes q-in-back { from { opacity: 0; transform: translateX(-10px); } }

.q-title {
  margin: 0; font: 400 clamp(28px, 3vw, 40px)/1.15 var(--font-display); letter-spacing: -0.01em; text-wrap: balance;
}
.q-title:focus { outline: none; }
.q-title:focus-visible { outline: 2px solid var(--gold-text); outline-offset: 6px; }
.q-hint { margin: 14px 0 0; max-width: 36ch; color: var(--ink-2); font-size: 16px; }
.q-link { margin-top: 18px; }

.q-opts { border-top: 1px solid var(--gold); }
.q-opt {
  position: relative; width: 100%;
  display: grid; grid-template-columns: 88px minmax(0, 1fr) 20px; align-items: center; gap: 22px;
  min-height: 84px; padding: 16px 8px 16px 4px;
  border-bottom: 1px solid var(--line); text-align: left;
  transition: background-color .25s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.q-opt:active { background: var(--cream-2); }
.q-opt[aria-pressed="true"] { background: var(--paper); }
.q-opt:focus-visible { outline-offset: -2px; }
.q-opt-art { display: grid; place-items: center; height: 48px; color: var(--ink); }
.q-ico { width: 88px; height: 48px; stroke-width: 1.5; }
.q-frame { display: block; width: 84px; }
.q-frame svg.frame { display: block; width: 100%; height: auto; overflow: visible; }
.q-frame .frame { --fc: currentColor; --fc2: currentColor; }
.q-opt-name { display: block; font: 400 21px/1.25 var(--font-display); color: var(--ink); }
.q-opt-hint { display: block; margin-top: 3px; font-size: 14px; line-height: 1.45; color: var(--ink-3); }
.q-opt-go { position: relative; width: 20px; height: 20px; color: var(--gold-text); }
.q-opt-go svg { position: absolute; inset: 0; width: 20px; height: 20px; stroke-width: 1.6; transition: transform .25s var(--ease-out), opacity .2s; }
.q-opt-go .ok { opacity: 0; transform: scale(.8); stroke-width: 1.9; }
.q-opt[aria-pressed="true"] .go { opacity: 0; }
.q-opt[aria-pressed="true"] .ok { opacity: 1; transform: none; }

.q-noscript { padding-top: 24px; color: var(--ink-2); }

/* ---------- result ---------- */
.quiz.is-done .q-count { color: var(--gold-text); }
.qr { padding-top: clamp(28px, 3.5vw, 48px); }
.qr.is-enter { animation: q-in-fwd .32s var(--ease-out); }
.qr-head h2 {
  margin: 0 0 12px; font: 400 clamp(30px, 3.4vw, 46px)/1.1 var(--font-display); letter-spacing: -0.015em; text-wrap: balance;
}
.qr-head h2:focus { outline: none; }
.qr-head h2:focus-visible { outline: 2px solid var(--gold-text); outline-offset: 6px; }
.qr-face { margin: 0; max-width: 60ch; color: var(--ink-2); font-size: 17px; }

.qr-answers { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 20px; margin-top: 22px; }
.qr-answers-k { margin: 0; font: 400 20px/1.3 var(--font-display); color: var(--ink); }
.qr-answers ul { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.qr-ans {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0;
  font-size: 15px; color: var(--ink);
  background: linear-gradient(var(--line), var(--line)) 0 calc(100% - 9px) / 100% 1px no-repeat;
  transition: color .2s, transform .16s var(--ease-out);
}
.qr-ans-k { font-size: 13px; color: var(--ink-3); }
.qr-ans svg { width: 13px; height: 13px; color: var(--gold-text); opacity: .55; transition: opacity .2s, transform .25s var(--ease-out); }

.qr-shapes {
  list-style: none; margin: clamp(28px, 3.5vw, 44px) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--gold); border-bottom: 1px solid var(--line);
}
.qr-shape { display: grid; justify-items: center; align-content: start; gap: 6px; padding: 30px clamp(14px, 2.4vw, 36px) 30px; text-align: center; }
.qr-shape + .qr-shape { box-shadow: inset 1px 0 0 var(--line); }
.qr.is-enter .qr-shape { animation: qr-shape-in .42s var(--ease-out) both; animation-delay: calc(80ms + var(--i, 0) * 60ms); }
@keyframes qr-shape-in { from { opacity: 0; transform: translateY(8px); } }
.qr-art { width: 100%; max-width: 230px; padding: 6px 0 10px; }
.qr-art svg.frame { display: block; width: 100%; height: auto; overflow: visible; }
.qr-shape h3 { margin: 0; font: 400 25px/1.2 var(--font-display); }
.qr-why { margin: 0; font-size: 13px; color: var(--gold-text); }
.qr-blurb { margin: 2px 0 0; max-width: 30ch; color: var(--ink-2); font-size: 15px; }

.qr-details { margin: clamp(36px, 4.5vw, 60px) 0 0; border-top: 1px solid var(--gold); }
.qr-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 5fr); gap: 20px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.qr-row dt { font: 400 22px/1.3 var(--font-display); }
.qr-row dd { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.65; max-width: 64ch; }
.qr-row dd p { margin: 0 0 4px; }
.qr-names { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--ink); font-size: 16px; font-weight: 500; }
.qr-sub { margin-top: 12px !important; }
.qr-tip { margin-top: 8px !important; font-size: 14px; color: var(--ink-3); }
.qr-sw { display: inline-flex; gap: 6px; }
.qr-sw span { width: 18px; height: 18px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(20, 19, 18, .18); }
.qr-coats { margin: 0 0 12px; display: grid; gap: 6px; }
.qr-coats strong { font-weight: 500; color: var(--ink); }

.qr-next {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px);
  margin-top: clamp(48px, 6vw, 80px); padding-top: clamp(28px, 3.5vw, 40px); border-top: 1px solid var(--gold);
}
.qr-next h3 { margin: 0 0 12px; font: 400 clamp(24px, 2.4vw, 30px)/1.2 var(--font-display); }
.qr-next-copy p { margin: 0 0 18px; max-width: 44ch; color: var(--ink-2); }
.qr-links { display: grid; justify-items: start; gap: 8px; }
.q-restart {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 22px;
  font-size: 13px; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--ink-2);
  transition: color .2s, transform .16s var(--ease-out);
}
.q-restart svg { width: 18px; height: 18px; color: var(--gold-text); transition: transform .4s var(--ease-out); }

.qr-mail { align-self: start; }
.qr-mail-label { display: block; margin-bottom: 8px; font-size: 15px; font-weight: 500; color: var(--ink); }
.qr-mail-row { display: flex; flex-wrap: wrap; gap: 12px; }
.qr-mail-row input {
  flex: 1 1 240px; min-width: 0; min-height: 50px; padding: 0 18px;
  border: 1px solid #cdbba0; border-radius: 0; background: var(--paper);
  font: 400 16px var(--font-ui); color: var(--ink); caret-color: var(--gold-text); outline: none;
  transition: border-color .2s;
}
.qr-mail-row input:focus { border-color: var(--gold-text); }
.qr-mail-row input[aria-invalid="true"] { border-color: #a1322b; }
.qr-check { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: start; margin-top: 16px; font-size: 15px; line-height: 1.5; color: var(--ink-2); cursor: pointer; }
.qr-check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--gold-text); cursor: pointer; }
.qr-note { position: relative; margin: 14px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-3); }
.qr-note::before { content: ""; position: absolute; left: 0; top: .75em; width: 8px; height: 1px; background: var(--gold); }
.qr-msg { min-height: 1.5em; margin: 10px 0 0; font-size: 14px; }
.qr-msg.is-error { color: #a1322b; }
.qr-msg.is-ok { color: var(--gold-deep); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .q-screen { grid-template-columns: 1fr; gap: 22px; }
  .q-opt { grid-template-columns: 64px minmax(0, 1fr) 18px; gap: 16px; min-height: 76px; padding: 14px 4px 14px 2px; }
  .q-ico { width: 64px; height: 40px; }
  .q-frame { width: 64px; }
  .qr-shapes { grid-template-columns: 1fr; }
  .qr-shape {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); justify-items: start; text-align: left;
    column-gap: 18px; row-gap: 4px; padding: 22px 0;
  }
  .qr-shape + .qr-shape { box-shadow: inset 0 1px 0 var(--line); }
  .qr-art { grid-column: 1; grid-row: 1 / span 3; align-self: center; padding: 0; }
  .qr-shape > :not(.qr-art) { grid-column: 2; }
  .qr-row { grid-template-columns: 1fr; gap: 6px; }
  .qr-next { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .q-opt-name { font-size: 19px; }
  .qr-mail-row .btn { width: 100%; justify-content: center; }
}
@media (hover: hover) and (pointer: fine) {
  .q-back:hover, .q-restart:hover { color: var(--ink); }
  .q-back:hover svg { transform: translateX(-3px); }
  .q-restart:hover svg { transform: rotate(-120deg); }
  .q-opt:hover { background: var(--paper); }
  .q-opt:hover .go { transform: translateX(5px); }
  .qr-ans:hover { color: var(--gold-deep); background-image: linear-gradient(var(--gold), var(--gold)); }
  .qr-ans:hover svg { opacity: 1; transform: rotate(-8deg); }
}
