/* Goldie's "Find your scent" quiz: the floating pill, the homepage band and the quiz window.
   Uses the site's colour and font variables from style.css. */

/* ---------- Floating pill ---------- */
.quiz-pill {
  position: fixed; z-index: 70; bottom: 20px; inset-inline-end: 20px;
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 20px 6px 7px; padding-inline: 7px 20px;
  border: 0; border-radius: 99px; cursor: pointer;
  background: var(--gold-deep); color: #fff; font: inherit; font-size: .9375rem; font-weight: 500; letter-spacing: .01em;
  box-shadow: 0 10px 26px rgba(133, 104, 58, .35);
  transition: transform .2s var(--ease), background-color .2s var(--ease), opacity .2s var(--ease);
}
.quiz-pill img { width: 38px; height: 38px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 255, 255, .55); }
.quiz-pill:hover { background: #6F5630; transform: translateY(-2px); }
.quiz-pill.is-pulsing { animation: quiz-pulse 2.4s ease-out 1.2s 4; }
@keyframes quiz-pulse {
  0% { box-shadow: 0 10px 26px rgba(133, 104, 58, .35), 0 0 0 0 rgba(205, 176, 122, .6); }
  70%, 100% { box-shadow: 0 10px 26px rgba(133, 104, 58, .35), 0 0 0 16px rgba(205, 176, 122, 0); }
}
html.quiz-locked .quiz-pill, html.goldie-locked .quiz-pill { opacity: 0; pointer-events: none; }
@media (max-width: 600px) {
  .quiz-pill { bottom: 16px; inset-inline-end: 16px; min-height: 48px; font-size: .875rem; }
  .quiz-pill img { width: 34px; height: 34px; }
}

/* ---------- Homepage band under the hero ---------- */
.quiz-band { background: var(--tint); border-bottom: 1px solid var(--line); }
.quiz-band-inner { display: flex; align-items: center; gap: 20px; padding-block: 26px; }
.quiz-band-avatar { width: 56px; height: 56px; border-radius: 50%; flex: none; }
.quiz-band-text { flex: 1; min-width: 0; }
.quiz-band-title { font-family: var(--title); font-size: 1.25rem; font-weight: 600; letter-spacing: .02em; margin: 0; }
.quiz-band-sub { margin: 4px 0 0; color: var(--muted); font-size: .9375rem; }
@media (max-width: 700px) {
  .quiz-band-inner { flex-wrap: wrap; gap: 14px; padding-block: 22px; }
  .quiz-band-text { flex-basis: calc(100% - 76px); }
  .quiz-band-inner .btn { width: 100%; }
}

/* ---------- Window ---------- */
.quiz { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 24px; }
.quiz[hidden] { display: none; }
html.quiz-locked, html.quiz-locked body { overflow: hidden; }
.quiz-scrim { position: absolute; inset: 0; background: rgba(20, 17, 12, .55); opacity: 0; transition: opacity .3s var(--ease); }
.quiz-sheet {
  position: relative; width: min(820px, 100%); height: min(760px, 100%);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); color: var(--ink); border-radius: 22px; box-shadow: 0 30px 80px rgba(20, 17, 12, .3);
  opacity: 0; transform: translateY(28px) scale(.98);
  transition: opacity .3s var(--ease), transform .35s var(--ease);
}
.quiz-sheet:focus { outline: none; }
.quiz.is-open .quiz-scrim { opacity: 1; }
.quiz.is-open .quiz-sheet { opacity: 1; transform: none; }
.quiz-grab { display: none; }

.quiz-head {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 14px;
  padding: 18px 20px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--tint), var(--bg));
}
.quiz-avatar { width: 44px; height: 44px; border-radius: 50%; }
.quiz-head-text { min-width: 0; }
.quiz-title { font-family: var(--title); font-size: 1.25rem; font-weight: 600; letter-spacing: .03em; margin: 0; line-height: 1.2; }
.quiz-steplabel { margin: 2px 0 0; font-size: .8125rem; color: var(--muted); letter-spacing: .04em; }
.quiz-x { width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.quiz-x:hover { background: rgba(255, 255, 255, .8); }
.quiz-x svg { width: 22px; height: 22px; }
.quiz-progress { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.quiz-track { flex: 1; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.quiz-fill {
  display: block; height: 100%; border-radius: inherit; transform-origin: left center; transform: scaleX(0);
  background: linear-gradient(90deg, #E3C88F, var(--gold) 45%, var(--gold-deep));
  transition: transform .55s var(--ease);
}
[dir="rtl"] .quiz-fill { transform-origin: right center; background: linear-gradient(270deg, #E3C88F, var(--gold) 45%, var(--gold-deep)); }
.quiz-pct { font-size: .75rem; color: var(--gold-deep); font-weight: 500; white-space: nowrap; min-width: 6.5em; text-align: end; }

.quiz-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 22px 24px 26px; }
/* Steps with a few answer cards sit in the middle of the window on larger screens. */
@media (min-width: 641px) { .quiz-screen.is-short { min-height: 100%; display: flex; flex-direction: column; justify-content: center; padding-bottom: 24px; } }
.quiz-screen.is-in-next { animation: quiz-in-next .38s var(--ease); }
.quiz-screen.is-in-prev { animation: quiz-in-prev .38s var(--ease); }
@keyframes quiz-in-next { from { opacity: 0; transform: translateX(28px); } }
@keyframes quiz-in-prev { from { opacity: 0; transform: translateX(-28px); } }
[dir="rtl"] .quiz-screen.is-in-next { animation-name: quiz-in-prev; }
[dir="rtl"] .quiz-screen.is-in-prev { animation-name: quiz-in-next; }

.quiz-q { font-family: var(--title); font-size: 1.5rem; font-weight: 600; letter-spacing: .02em; text-align: center; margin: 4px 0 6px; line-height: 1.3; }
.quiz-sub { text-align: center; color: var(--muted); margin: 0 0 20px; font-size: .9375rem; }
.quiz-q + .quiz-options, .quiz-q + .quiz-notes { margin-top: 22px; }

/* Answer cards (steps 1, 2, 5, 6) */
.quiz-options { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); width: 100%; max-width: 680px; margin-inline: auto; }
.quiz-q:focus { outline: none; }
@media (min-width: 700px) {
  .quiz-options.is-4 { grid-template-columns: repeat(4, 1fr); }
  .quiz-options.is-5 { grid-template-columns: repeat(5, 1fr); max-width: 820px; }
  .quiz-options.is-3 { grid-template-columns: repeat(3, 1fr); max-width: 560px; }
}
/* Phones: an odd last card (five answers) spans the full row. */
@media (max-width: 699px) { .quiz-options.is-5 > :last-child { grid-column: 1 / -1; min-height: 88px; flex-direction: row; } }
@media (max-width: 699px) { .quiz-options.is-3 { grid-template-columns: 1fr; } .quiz-options.is-3 .quiz-option { flex-direction: row; justify-content: flex-start; min-height: 72px; padding-inline: 18px; } }
.quiz-option, .quiz-note {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink); cursor: pointer;
  font: inherit; text-align: center;
  transition: border-color .2s var(--ease), background-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.quiz-option { min-height: 132px; padding: 18px 12px; }
.quiz-option:hover, .quiz-note:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(133, 104, 58, .1); }
.quiz-option-icon, .quiz-note-icon { display: block; color: var(--gold-deep); }
.quiz-option-icon svg { width: 40px; height: 40px; display: block; }
.quiz-option-label { font-size: .9375rem; font-weight: 500; line-height: 1.3; }
.quiz-option[aria-checked="true"], .quiz-note[aria-pressed="true"] { border-color: var(--gold-deep); background: var(--tint); box-shadow: inset 0 0 0 1px var(--gold-deep); }

.quiz-badge {
  position: absolute; top: 8px; inset-inline-end: 8px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: var(--gold-deep); color: #fff; transform: scale(0); opacity: 0;
  transition: transform .2s var(--ease), opacity .2s var(--ease);
}
.quiz-badge svg { width: 14px; height: 14px; }
.quiz-option[aria-checked="true"] .quiz-badge, .quiz-note[aria-pressed="true"] .quiz-badge { opacity: 1; transform: scale(1); animation: quiz-pop .32s var(--ease); }
@keyframes quiz-pop { 0% { transform: scale(0); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* Scent notes (steps 3 and 4) */
.quiz-notes-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; min-height: 28px; }
.quiz-count { font-size: .8125rem; color: var(--gold-deep); font-weight: 500; }
.quiz-seeall { margin-inline-start: auto; border: 0; background: none; color: var(--gold-deep); font: inherit; font-size: .875rem; font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--gold); padding: 6px 0; }
.quiz-note-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.quiz-note { min-height: 108px; padding: 14px 8px 12px; gap: 8px; }
.quiz-note[hidden] { display: none; }
.quiz-note-icon svg { width: 36px; height: 36px; display: block; }
.quiz-note-icon.is-img { width: 36px; height: 36px; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.quiz-note-name { font-size: .8125rem; font-weight: 500; line-height: 1.25; }
.quiz-search { display: flex; align-items: center; gap: 10px; padding: 0 14px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.quiz-search:focus-within { border-color: var(--gold); }
.quiz-search svg { width: 20px; height: 20px; color: var(--muted); display: block; }
.quiz-search-input { flex: 1; min-width: 0; min-height: 46px; border: 0; background: none; font: inherit; font-size: 1rem; }
.quiz-search-input:focus { outline: none; }
.quiz-cat { margin-bottom: 20px; }
.quiz-cat[hidden] { display: none; }
.quiz-cat h4 { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 0 0 10px; }
[dir="rtl"] .quiz-cat h4 { letter-spacing: 0; font-size: .875rem; }
.quiz-empty { text-align: center; color: var(--muted); padding: 20px 0; }
/* Notes to avoid: red with a cross. */
.quiz-notes.is-avoid .quiz-note[aria-pressed="true"] { border-color: var(--danger); background: #FBEFEC; box-shadow: inset 0 0 0 1px var(--danger); }
.quiz-notes.is-avoid .quiz-note[aria-pressed="true"] .quiz-note-icon { color: var(--danger); }
.quiz-notes.is-avoid .quiz-badge { background: var(--danger); }

.quiz-chatlink { display: block; margin: 26px auto 0; border: 0; background: none; color: var(--gold-deep); font: inherit; font-size: .9375rem; cursor: pointer; text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--gold); }

/* Footer: Back · Skip · Next */
.quiz-foot { display: flex; align-items: center; gap: 12px; padding: 14px 20px; padding-bottom: max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }
.quiz-foot[hidden] { display: none; }
.quiz-foot .btn { min-width: 120px; }
.quiz-next { margin-inline-start: auto; }
.quiz-next:disabled { opacity: .4; cursor: not-allowed; }
.quiz-skip { border: 0; background: none; color: var(--muted); font: inherit; font-size: .875rem; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; padding: 8px 4px; }
.quiz-skip[hidden] { display: none; }
.quiz-skip:hover { color: var(--ink); }

/* Loading */
.quiz-loading { min-height: 100%; display: grid; place-content: center; justify-items: center; gap: 4px; padding: 30px 0; text-align: center; }
.quiz-orb { position: relative; width: 108px; height: 108px; display: grid; place-items: center; margin-bottom: 18px; }
.quiz-orb::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 35%, var(--gold) 60%, var(--gold-deep) 80%, transparent 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  animation: quiz-spin 1.1s linear infinite;
}
.quiz-orb img { width: 76px; height: 76px; border-radius: 50%; animation: quiz-breathe 1.6s ease-in-out infinite; }
@keyframes quiz-spin { to { transform: rotate(1turn); } }
@keyframes quiz-breathe { 50% { transform: scale(1.06); } }
.quiz-loading .quiz-sub { margin-bottom: 18px; }
.quiz-chips { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 0; margin: 0; }
.quiz-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px 8px 12px; padding-inline: 12px 16px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: .875rem; transition: all .35s var(--ease); }
.quiz-chip span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: #fff; transition: background-color .35s var(--ease); }
.quiz-chip svg { width: 13px; height: 13px; }
.quiz-chip.is-lit { border-color: var(--gold); background: var(--tint); color: var(--gold-deep); box-shadow: 0 0 0 4px rgba(205, 176, 122, .18); }
.quiz-chip.is-lit span { background: var(--gold-deep); }

/* Results */
.quiz-picks { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.quiz-pick {
  display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff;
  animation: quiz-rise .5s var(--ease) both; animation-delay: calc(var(--i) * 120ms);
}
.quiz-pick.is-top { border-color: var(--gold); box-shadow: 0 14px 34px rgba(133, 104, 58, .14); }
@keyframes quiz-rise { from { opacity: 0; transform: translateY(18px); } }
.quiz-pick-img { position: relative; display: block; aspect-ratio: 1; background: var(--surface); }
.quiz-pick-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.quiz-match {
  position: absolute; top: 10px; inset-inline-start: 10px; padding: 5px 11px; border-radius: 99px;
  background: var(--gold-deep); color: #fff; font-size: .8125rem; font-weight: 600; letter-spacing: .02em; font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 12px rgba(35, 35, 35, .18);
}
.quiz-pick-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; }
.quiz-rank { margin: 0; font-size: .75rem; color: var(--gold-deep); letter-spacing: .12em; font-weight: 600; }
.quiz-pick-name { font-family: var(--title); font-size: 1.0625rem; font-weight: 600; letter-spacing: .03em; margin: 0; line-height: 1.25; }
.quiz-pick-name a { color: inherit; text-decoration: none; }
.quiz-price { margin: 0; font-weight: 500; }
.quiz-price s { color: var(--muted); font-weight: 400; margin-inline-end: .4em; }
.quiz-price.is-soon { font-weight: 400; font-style: italic; color: var(--muted); }
.quiz-label { margin: 8px 0 4px; font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
[dir="rtl"] .quiz-label { letter-spacing: 0; font-size: .8125rem; }
.quiz-why ul, .quiz-keys ul { list-style: none; padding: 0; margin: 0; }
.quiz-why li { display: flex; gap: 8px; align-items: flex-start; font-size: .8125rem; line-height: 1.45; margin-bottom: 4px; }
.quiz-why li > span:first-child { flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--tint); color: var(--gold-deep); display: grid; place-items: center; }
.quiz-why svg { width: 12px; height: 12px; }
.quiz-keys ul { display: flex; flex-wrap: wrap; gap: 6px; }
.quiz-keys li { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 6px; padding-inline: 6px 10px; border-radius: 99px; background: var(--surface); font-size: .75rem; }
.quiz-keys .quiz-note-icon svg, .quiz-keys .quiz-note-icon.is-img { width: 18px; height: 18px; }
.quiz-pick-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 12px; }
.quiz-pick-actions .btn { flex: 1; min-height: 42px; padding-inline: 10px; font-size: .875rem; }
.quiz-after { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.quiz-after .btn img { width: 22px; height: 22px; border-radius: 50%; }

/* Phones: a full-height bottom sheet that slides up. */
@media (max-width: 640px) {
  .quiz { padding: 0; place-items: end stretch; }
  .quiz-sheet { width: 100%; height: calc(100% - 10px); height: calc(100dvh - 10px); border-radius: 20px 20px 0 0; transform: translateY(100%); opacity: 1; }
  .quiz.is-open .quiz-sheet { transform: none; }
  .quiz-grab { display: block; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 99px; background: rgba(35, 35, 35, .18); }
  .quiz-head { padding: 18px 16px 14px; }
  .quiz-body { padding: 18px 16px 22px; }
  .quiz-q { font-size: 1.3125rem; }
  .quiz-option { min-height: 116px; }
  .quiz-note-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .quiz-note { min-height: 96px; padding: 12px 4px 10px; }
  .quiz-foot { padding-inline: 16px; }
  .quiz-foot .btn { min-width: 0; padding-inline: 18px; }
  .quiz-picks { grid-template-columns: 1fr; gap: 12px; }
  .quiz-pick { display: grid; grid-template-columns: 112px 1fr; }
  .quiz-pick-img { aspect-ratio: auto; min-height: 100%; }
  .quiz-match { top: 8px; inset-inline-start: 8px; padding: 4px 8px; font-size: .6875rem; }
  .quiz-pick-body { padding: 12px 12px 14px; }
  .quiz-pick-actions { flex-wrap: wrap; }
  .quiz-after .btn { flex: 1 1 100%; }
}
@media (min-width: 641px) and (max-width: 860px) { .quiz-picks { grid-template-columns: 1fr; } .quiz-pick { display: grid; grid-template-columns: 180px 1fr; } .quiz-pick-img { aspect-ratio: auto; } }

@media (prefers-reduced-motion: reduce) {
  .quiz-pill.is-pulsing, .quiz-screen.is-in-next, .quiz-screen.is-in-prev, .quiz-pick, .quiz-badge,
  .quiz-option[aria-checked="true"] .quiz-badge, .quiz-note[aria-pressed="true"] .quiz-badge, .quiz-orb::before, .quiz-orb img { animation: none; }
  .quiz-scrim, .quiz-sheet, .quiz-fill, .quiz-chip, .quiz-option, .quiz-note, .quiz-pill { transition: none; }
}
