/* "Monte seu stack" quiz: one phase per screen, game-like feedback on every choice */
.stack { padding-top: calc(72px + var(--s-7, 40px)); padding-bottom: var(--s-9, 64px); min-height: 100svh; box-sizing: border-box; }
.stack__in { position: relative; }

/* HUD: phase, progress bar, XP */
.stack__hud { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; margin-bottom: var(--s-7, 40px); }
.stack__hud[hidden] { display: none; }
.stack__fase-label, .stack__xp { margin: 0; font-size: 15px; color: var(--p-muted); white-space: nowrap; }
.stack__fase-label span, .stack__xp span { color: var(--p-ink); font-weight: 600; }
.stack__xp span { color: var(--p-accent); font-variant-numeric: tabular-nums; }
.stack__bar { height: 8px; border-radius: 999px; background: var(--p-surface); overflow: hidden; }
.stack__bar span { display: block; height: 100%; background: var(--p-accent); transform: scaleX(0); transform-origin: left; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }

/* phases */
.fase[hidden] { display: none; }
.fase.is-on { animation: fase-in .5s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes fase-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.fase h1 { font-family: var(--font-display); font-size: clamp(40px, 6vw, 76px); line-height: 1.02; letter-spacing: var(--display-tracking, -.025em); margin: 0 0 var(--s-5, 20px); max-width: 14ch; }
.fase h2 { font-family: var(--font-display); font-size: clamp(32px, 4.4vw, 54px); line-height: 1.05; letter-spacing: var(--display-tracking, -.025em); margin: 0 0 var(--s-6, 28px); }
.fase h1:focus, .fase h2:focus { outline: none; }
.fase .t-lead { color: var(--p-muted); max-width: 56ch; margin: 0 0 var(--s-7, 40px); }
.fase .btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.fase__perks { list-style: none; padding: 0; margin: var(--s-8, 48px) 0 0; display: flex; flex-wrap: wrap; gap: 12px; }
.fase__perks li { background: var(--p-surface); border-radius: 999px; padding: 10px 18px; font-size: 15px; color: var(--p-muted); }
.fase__perks strong { color: var(--p-ink); }
.fase__q { font-size: 18px; font-weight: 600; margin: var(--s-6, 28px) 0 12px; }
.fase__nav { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--s-7, 40px); }

/* choice cards */
.opcoes { display: grid; gap: 16px; }
.opcoes--foto { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.opcoes--card { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opcoes--chip { display: flex; flex-wrap: wrap; gap: 10px; }
.opcao { position: relative; display: grid; align-content: end; text-align: left; padding: 0; border: 2px solid transparent; border-radius: var(--r-lg, 16px); background: var(--p-surface); color: var(--p-ink); font: inherit; cursor: pointer; overflow: hidden; isolation: isolate; transition: transform .25s cubic-bezier(.2, .8, .2, 1), border-color .2s, box-shadow .25s; }
.opcoes--foto .opcao { aspect-ratio: 4 / 5; }
.opcao img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.opcoes--foto .opcao::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(17, 18, 20, .92) 0%, rgba(17, 18, 20, .35) 55%, rgba(17, 18, 20, .1) 100%); }
.opcao__txt { display: grid; gap: 4px; padding: 20px; }
.opcao__txt strong { font-size: 22px; line-height: 1.15; }
.opcao__txt small { font-size: 15px; color: var(--p-muted); line-height: 1.35; }
.opcoes--foto .opcao__txt small { color: #d7d7d4; }
.opcao--plana { align-content: start; gap: 8px; padding: 24px 4px 8px; min-height: 200px; }
.opcao__nivel { padding: 0 20px; font-family: var(--font-display); font-size: 40px; font-weight: 600; color: var(--p-accent); letter-spacing: .04em; }
.opcao:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(0, 0, 0, .4); }
.opcao:hover img { transform: scale(1.04); }
.opcao:active { transform: translateY(-1px) scale(.985); }
.opcao:focus-visible, .chip:focus-visible { outline: 2px solid var(--p-accent); outline-offset: 3px; }
.opcao[aria-pressed="true"] { border-color: var(--p-accent); box-shadow: 0 0 0 4px rgba(255, 106, 61, .22); }
.opcao[aria-pressed="true"]::before { content: "✓"; position: absolute; top: 14px; right: 14px; z-index: 2; width: 32px; height: 32px; border-radius: 50%; background: var(--p-accent); color: #000; display: grid; place-items: center; font-weight: 700; }

.chip { min-height: 52px; min-width: 64px; padding: 0 22px; border-radius: 999px; border: 2px solid #34363c; background: var(--p-surface); color: var(--p-ink); font: inherit; font-size: 17px; font-weight: 600; cursor: pointer; transition: transform .2s cubic-bezier(.2, .8, .2, 1), border-color .2s, background-color .2s; }
.chip:hover { transform: translateY(-2px); border-color: #55575e; }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { border-color: var(--p-accent); background: var(--p-accent); color: #000; }

.is-pulse { animation: pulse .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes pulse { 0% { transform: scale(1); } 40% { transform: scale(1.04); } 100% { transform: scale(1); } }

/* floating "+100 XP" */
.xp-pop { position: absolute; left: 50%; top: 40%; z-index: 3; transform: translateX(-50%); pointer-events: none; padding: 6px 12px; border-radius: 999px; background: var(--p-accent); color: #000; font-weight: 700; font-size: 16px; white-space: nowrap; animation: xp-pop .9s cubic-bezier(.2, .8, .2, 1) forwards; }
@keyframes xp-pop { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.8); } 25% { opacity: 1; transform: translate(-50%, -6px) scale(1.05); } 100% { opacity: 0; transform: translate(-50%, -46px) scale(1); } }
.btn { position: relative; }

/* weight slider */
.peso { max-width: 720px; }
.peso__num { display: block; font-family: var(--font-display); font-size: clamp(72px, 12vw, 140px); line-height: 1; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-bottom: 20px; }
.peso__num span { font-size: .35em; color: var(--p-muted); font-weight: 500; letter-spacing: 0; }
.peso__range { --k: .3; -webkit-appearance: none; appearance: none; width: 100%; height: 12px; border-radius: 999px; margin: 0; cursor: pointer;
  background: linear-gradient(to right, var(--p-accent) calc(var(--k) * 100%), var(--p-surface) calc(var(--k) * 100%)); }
.peso__range::-webkit-slider-thumb { -webkit-appearance: none; width: 34px; height: 34px; border-radius: 50%; background: var(--p-ink); border: 6px solid var(--p-accent); box-shadow: 0 4px 14px rgba(0, 0, 0, .4); transition: transform .15s; }
.peso__range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--p-ink); border: 6px solid var(--p-accent); }
.peso__range:active::-webkit-slider-thumb { transform: scale(1.15); }
.peso__range:focus-visible { outline: 2px solid var(--p-accent); outline-offset: 6px; }
.peso__escala { display: flex; justify-content: space-between; margin-top: 10px; font-size: 14px; color: var(--p-muted); }

.metas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: var(--s-7, 40px) 0 0; max-width: 880px; }
.metas div { background: var(--p-surface); border-radius: var(--r-lg, 16px); padding: 18px 20px; display: grid; gap: 6px; }
.metas dt { font-size: 14px; color: var(--p-muted); }
.metas dd { margin: 0; font-size: 30px; font-weight: 600; color: var(--p-accent); font-variant-numeric: tabular-nums; }

/* result sheet */
.ficha { background: var(--p-surface); border-radius: var(--r-lg, 16px); padding: clamp(24px, 4vw, 44px); border: 1px solid #2e3036; position: relative; overflow: hidden; }
.ficha::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--p-accent); }
.ficha__nivel { display: inline-block; margin: 0 0 14px; padding: 6px 14px; border-radius: 999px; background: var(--p-accent); color: #000; font-weight: 700; font-size: 15px; animation: nivel-in .6s .15s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes nivel-in { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
.ficha h2 { margin-bottom: 12px; }
.ficha__resumo { color: var(--p-muted); font-size: 18px; margin: 0; max-width: 60ch; }
.metas--ficha { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: none; margin-top: var(--s-6, 28px); }
.metas--ficha div { background: var(--p-bg); }
.conquistas { list-style: none; padding: 0; margin: var(--s-6, 28px) 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.conquista { padding: 8px 14px 8px 36px; border-radius: 999px; background: var(--p-bg); color: var(--p-muted); font-size: 15px; position: relative; }
.conquista::before { content: "★"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #4a4c52; }
.conquista.is-on { color: var(--p-ink); animation: conq-in .5s calc(.3s + var(--i) * .12s) cubic-bezier(.2, .8, .2, 1) both; }
.conquista.is-on::before { color: var(--p-accent); }
@keyframes conq-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.stack__h3 { font-size: clamp(24px, 3vw, 32px); margin: var(--s-8, 48px) 0 var(--s-4, 16px); }
.stack__itens { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.item { background: var(--p-surface); border-radius: var(--r-lg, 16px); padding: 24px; display: grid; align-content: start; animation: conq-in .5s calc(.5s + var(--i) * .15s) cubic-bezier(.2, .8, .2, 1) both; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.item:hover { transform: translateY(-2px); }
.item__cat { margin: 0 0 6px; color: var(--p-accent); font-weight: 600; font-size: 15px; }
.item h4 { margin: 0; font-size: 22px; line-height: 1.2; }
.item__marca { margin: 2px 0 12px; color: var(--p-muted); }
.item__porque { margin: 0 0 18px; font-size: 16px; line-height: 1.55; }
.item .btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.stack__dica { border-left: 3px solid var(--p-accent); padding: 4px 0 4px 18px; color: var(--p-muted); margin: var(--s-6, 28px) 0 0; max-width: 70ch; }
.fase--ficha .disclosure { margin-top: var(--s-6, 28px); max-width: 80ch; }

/* achievement toast */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; display: grid; gap: 2px; min-width: 260px; max-width: calc(100vw - 32px); box-sizing: border-box; padding: 14px 20px 14px 56px; border-radius: 16px; background: var(--p-ink); color: var(--p-bg); box-shadow: 0 18px 40px rgba(0, 0, 0, .45); transform: translate(-50%, 140%); opacity: 0; pointer-events: none; transition: transform .45s cubic-bezier(.2, .8, .2, 1), opacity .3s; }
.toast::before { content: "★"; position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; background: var(--p-accent); color: #000; display: grid; place-items: center; font-size: 15px; }
.toast strong { font-size: 16px; }
.toast span { font-size: 14px; color: #3d3e42; }
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 1023px) {
  .opcoes--foto { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opcoes--foto .opcao { aspect-ratio: 4 / 3; }
  .metas--ficha { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
  .stack { padding-top: calc(64px + var(--s-5, 20px)); }
  .stack__hud { grid-template-columns: auto auto; }
  .stack__bar { grid-column: 1 / -1; grid-row: 2; }
  .stack__xp { justify-self: end; }
  .opcoes--foto { gap: 10px; }
  .opcoes--foto .opcao { aspect-ratio: 1; }
  .opcao__txt { padding: 14px; }
  .opcao__txt strong { font-size: 18px; }
  .opcao__txt small { font-size: 13px; }
  .opcoes--card, .metas, .stack__itens { grid-template-columns: minmax(0, 1fr); }
  .opcao--plana { min-height: 0; padding-bottom: 4px; }
  .metas--ficha { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metas dd { font-size: 24px; }
  .fase__nav .btn, .fase .btn-row .btn { flex: 1 1 auto; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .fase.is-on, .ficha__nivel, .conquista.is-on, .item, .is-pulse { animation: none; }
  .opcao, .opcao img, .chip, .stack__bar span, .toast, .item { transition: none; }
}

/* intro: text beside a photo on wide screens */
.fase--intro.is-on { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-7, 40px); align-items: center; }
.intro__foto { border-radius: var(--r-lg, 16px); overflow: hidden; aspect-ratio: 4 / 3; }
.intro__foto img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.intro__foto:hover img { transform: scale(1.03); }
@media (min-width: 1024px) { .fase--intro.is-on { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); min-height: calc(100svh - 72px - 2 * var(--s-9, 64px)); } .intro__foto { aspect-ratio: 4 / 5; } }
@media (max-width: 639px) {
  .opcao--plana { grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 0; padding: 16px 4px; }
  .opcao--plana .opcao__txt { padding: 4px 16px 4px 0; }
  .opcao__nivel { font-size: 28px; padding: 0 0 0 16px; }
}
