/* ======================================================================
   Quiz funnel "Etsitään sinulle sopiva sormus" (T545, Joel 28.10.)
   Sama kieli kuin sormuskoneessa: yksi kysymys kerrallaan, vastaukset
   hiuslinjoin erotettuna listana, ohut edistymisviiva. Lopussa kaksi
   vaihtoehtoa rinnakkain, kumpikin aina näkyvissä.
   ====================================================================== */

/* Etusivulla jatkaa materiaaliosion lämpimästä alareunasta valkoiseen. */
.qf-banner {
  background: linear-gradient(180deg, #faf6f0 0%, #faf6f1 12.5%, #fbf7f2 25%, #fcf9f5 37.5%, #fcfaf8 50%, #fdfcfa 62.5%, #fefefd 75%, #fffffe 87.5%, #fff 100%);
}
.qf-section .section-head .lede { max-width: 48ch; }
.qf-more { margin-top: 1.1rem !important; }

.qf { position: relative; max-width: 72rem; margin: 0 auto; }

.qf-ticks {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  max-width: 11rem;
  margin-bottom: clamp(1.8rem, 3.5vw, 2.6rem);
}
.qf-ticks i { display: block; height: 1px; background: rgba(125, 98, 55, 0.25); }
.qf-ticks i::after {
  content: "";
  display: block;
  height: 1px;
  background: var(--gold-deep);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.9s var(--ease);
}
.qf-ticks i.is-done::after { transform: scaleX(1); }
.qf-ticks i.is-cur { background: rgba(125, 98, 55, 0.6); }

.qf-step[hidden], .qf-end[hidden] { display: none; }
.qf-step {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  column-gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.qf-lead { display: flex; flex-direction: column; align-items: flex-start; }
.qf-q {
  font-size: clamp(2.1rem, 3.6vw, 3.2rem);
  line-height: 1.08;
  text-wrap: balance;
  outline: none;
}
.qf-n {
  display: block;
  margin-bottom: 1rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.qf-opts { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(29, 24, 17, 0.12); }
.qf-opts li { border-bottom: 1px solid rgba(29, 24, 17, 0.12); }
.qf-opt {
  position: relative;
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) 1.25rem;
  align-items: center;
  gap: 1.1rem;
  width: 100%;
  min-height: 4.5rem;
  padding: 1rem 0.4rem;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.qf-step[data-name="aikataulu"] .qf-opt { grid-template-columns: minmax(0, 1fr) 1.25rem; padding-left: 0.6rem; }
.qf-step[data-name="aikataulu"] .qf-ico { display: none; }
.qf-opt::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  border-radius: var(--radius);
}
.qf-opt > * { position: relative; }
.qf-ico { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; color: var(--gold-deep); }
.qf-ico svg { width: 2.4rem; height: 2.4rem; }
.qf-sw {
  display: block;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 0 0 1px rgba(29, 24, 17, 0.12);
}
.qf-txt { display: grid; gap: 0.15rem; }
.qf-t { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.35rem, 1.9vw, 1.6rem); line-height: 1.15; }
.qf-s { font-size: 0.86rem; line-height: 1.55; color: var(--ink-soft); }
.qf-go {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: var(--gold-deep);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.55;
  transition: transform 0.5s var(--ease), opacity 0.5s var(--ease);
}
.qf-opt:active::before { opacity: 1; transition-duration: 0.12s; }
.qf-opt[aria-pressed="true"]::before { opacity: 1; }
.qf-opt[aria-pressed="true"] .qf-go { opacity: 1; transform: translateX(4px); }
.qf-opt:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .qf-opt:hover::before { opacity: 0.6; }
  .qf-opt:hover .qf-go { opacity: 1; transform: translateX(4px); }
}

.qf-back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  margin-top: 2rem;
  padding: 0 0.2rem;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
  touch-action: manipulation;
}
.qf-back svg { width: 0.95rem; height: 0.95rem; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.4s var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .qf-back:hover { color: var(--ink); }
  .qf-back:hover svg { transform: translateX(-3px); }
}

/* Kysymyksen vaihto: vanha häivyttyy ensin, uusi nousee sen jälkeen. */
.qf-flow { transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.qf-flow.is-leaving { opacity: 0; transform: translateY(-6px); transition: opacity 0.3s ease, transform 0.3s ease; }
.qf-flow.is-entering { opacity: 0; transform: translateY(10px); transition: none; }

/* ---------- Loppu: kaksi vaihtoehtoa rinnakkain ---------- */
.qf-end-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 0.6rem 2rem; margin-bottom: clamp(2rem, 4vw, 2.75rem); }
.qf-end-h { font-size: clamp(2rem, 3.2vw, 2.8rem); line-height: 1.1; outline: none; text-wrap: balance; }
.qf-sum { grid-column: 1; font-size: 0.95rem; color: var(--ink-soft); max-width: 60ch; }
.qf-sum:empty { display: none; }
.qf-restart { grid-column: 2; grid-row: 1 / span 2; align-self: end; margin-top: 0; }
.qf-choices {
  display: grid;
  grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr);
  border-top: 1px solid rgba(29, 24, 17, 0.12);
}
.qf-choice { padding: clamp(1.75rem, 3.5vw, 2.6rem) 0; }
.qf-choice-cal { padding-right: clamp(2rem, 4.5vw, 4rem); border-right: 1px solid rgba(29, 24, 17, 0.12); }
.qf-choice-form { padding-left: clamp(2rem, 4.5vw, 4rem); }
.qf-choice h4 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.6rem, 2.2vw, 1.95rem); line-height: 1.15; margin-bottom: 0.7rem; }
.qf-choice > p { color: var(--ink-soft); font-size: 0.97rem; line-height: 1.7; margin-bottom: 1.5rem; max-width: 42ch; }
.qf-choice-cal .btn { width: 100%; max-width: 22rem; }
.qf-addr { margin-top: 1.1rem; font-size: 0.86rem; color: var(--ink-soft); }
.qf-choice form[data-lead] { gap: 1rem; }
.qf-choice .field textarea { min-height: 5.5rem; }
.qf-opt-l { font-weight: 400; color: var(--ink-soft); }
.qf-submit { justify-self: start; }
.qf-choice .form-success { background: transparent; border: 0; padding: 0; text-align: left; }
.qf-choice .form-success h4 { margin-bottom: 0.5rem; }

@media (max-width: 900px) {
  .qf-step { grid-template-columns: 1fr; }
  .qf-q { margin-bottom: 1.4rem; }
  .qf-lead { display: contents; }
  .qf-back { order: 3; margin-top: 1rem; }
  .qf-choices { grid-template-columns: 1fr; }
  .qf-choice-cal { padding-right: 0; border-right: 0; border-bottom: 1px solid rgba(29, 24, 17, 0.12); }
  .qf-choice-form { padding-left: 0; }
}
@media (max-width: 640px) {
  .qf-ticks { margin-bottom: 1.6rem; }
  .qf-q { font-size: 2.05rem; }
  .qf-opt { grid-template-columns: 2.4rem minmax(0, 1fr) 1rem; gap: 0.9rem; min-height: 4.25rem; padding: 0.9rem 0.2rem; }
  .qf-ico { width: 2.4rem; height: 2.4rem; }
  .qf-ico svg { width: 2.1rem; height: 2.1rem; }
  .qf-t { font-size: 1.32rem; }
  .qf-s { font-size: 0.84rem; }
  .qf-end-head { grid-template-columns: 1fr; }
  .qf-restart { grid-column: 1; grid-row: auto; justify-self: start; }
  .qf-choice-cal .btn, .qf-submit { width: 100%; max-width: none; justify-self: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .qf-flow, .qf-flow.is-leaving, .qf-flow.is-entering { transform: none !important; transition: opacity 0.2s ease; }
}

/* Sormuskoneen tulosten perään sama kahden vaihtoehdon loppu (etusivu ja
   mallistosivut). Tuloksen oma varausnappi jää pois, ettei sama toiminto
   näy kahdesti peräkkäin. */
.qf-after { margin-top: clamp(3rem, 6vw, 4.5rem); }
.fd-stage:has([data-qf-after]:not([hidden])) .fd-res-cta { display: none; }
/* Kelluva "Kysy meiltä" ei peitä lomaketta eikä vaihtoehtoja. */
html.qf-in-view .aspa-launch, html.qf-in-view .aspa-launch.is-in { opacity: 0; pointer-events: none; transform: translateY(8px); }
.qf-after .qf-end-head { grid-template-columns: 1fr; }
