/* v3: survey redesign (beige and sage, no black or gold), calmer bottom nav, smoother transitions */

/* ================= Survey ================= */
#assessment { overflow: hidden; }
.q-bg { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.q-bg i { position: absolute; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #EAD9C4, rgba(216,180,148,.0) 70%); animation: qdrift 22s ease-in-out infinite alternate; }
.q-bg i:nth-child(1) { width: 520px; height: 520px; top: -120px; right: -120px; }
.q-bg i:nth-child(2) { width: 420px; height: 420px; bottom: -140px; left: -100px; background: radial-gradient(circle at 40% 35%, #DCE0D4, rgba(227,229,223,0) 70%); animation-duration: 28s; animation-direction: alternate-reverse; }
.q-bg i:nth-child(3) { width: 240px; height: 240px; top: 45%; left: 42%; opacity: .6; animation-duration: 34s; }
@keyframes qdrift { to { transform: translate3d(-40px, 30px, 0) scale(1.08); } }
#assessment .container { position: relative; z-index: 1; }

.q-profile { margin-top: 34px; padding: 22px 24px; border-radius: 22px; background: rgba(255,255,255,.72); border: 1px solid var(--accent); max-width: 26rem; }
.q-profile h4 { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.q-profile ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.q-profile li { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding-bottom: 10px; border-bottom: 1px dashed var(--accent); }
.q-profile li:last-child { border: 0; padding-bottom: 0; }
.q-profile li span { color: var(--muted); }
.q-profile li b { font-weight: 500; color: #b3ada0; transition: color .3s; }
.q-profile li.filled b { color: var(--dark); }

.q-card { position: relative; padding: 30px 34px 34px; border-radius: 32px; background: #fff; border: 1px solid var(--accent); box-shadow: 0 50px 90px -56px rgba(51,37,26,.45); min-height: 520px; display: flex; flex-direction: column; overflow: hidden; }
.q-top { display: flex; align-items: center; gap: 14px; transition: opacity .3s; }
.q-top.hide { opacity: 0; pointer-events: none; }
.q-back { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--accent); display: grid; place-items: center; color: var(--dark); flex: none; transition: background .2s, border-color .2s, transform .25s var(--ease); }
.q-back:hover { background: var(--sage); border-color: #cfcabc; transform: translateX(-2px); }
.q-back[hidden] { display: none; }
.q-segs { flex: 1; display: flex; gap: 6px; }
.q-segs i { flex: 1; height: 5px; border-radius: 5px; background: var(--accent); overflow: hidden; position: relative; }
.q-segs i::after { content: ""; position: absolute; inset: 0; background: var(--beige); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.q-segs i.on::after { transform: scaleX(1); }
.q-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; }
.q-stage { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-top: 22px; }

.q-step { animation: qin .45s var(--ease) both; }
.q-step.from-left { animation-name: qinL; }
.q-step.out-left { animation: qoutL .19s ease-in forwards; }
.q-step.out-right { animation: qoutR .19s ease-in forwards; }
@keyframes qin { from { opacity: 0; transform: translate3d(28px,0,0); } to { opacity: 1; transform: none; } }
@keyframes qinL { from { opacity: 0; transform: translate3d(-28px,0,0); } to { opacity: 1; transform: none; } }
@keyframes qoutL { to { opacity: 0; transform: translate3d(-28px,0,0); } }
@keyframes qoutR { to { opacity: 0; transform: translate3d(28px,0,0); } }
.q-step h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); text-align: left; margin-bottom: 6px; }
.q-hint { color: var(--muted); font-size: .9rem; margin: 0 0 24px; }

.q-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.q-grid.n3 { grid-template-columns: 1fr; }
.q-opt { display: flex; align-items: center; gap: 16px; text-align: left; padding: 16px 18px; border-radius: 20px; border: 1px solid var(--accent); background: #FBFAF7; color: var(--dark); animation: qopt .5s var(--ease) both; animation-delay: calc(var(--i) * 60ms + 80ms); transition: transform .25s var(--ease), border-color .25s, background .25s, box-shadow .25s; }
@keyframes qopt { from { opacity: 0; transform: translate3d(0,12px,0); } to { opacity: 1; transform: none; } }
.q-ico { flex: none; width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; background: #F1E6D8; color: #7a5a3c; transition: background .25s, color .25s, transform .35s var(--ease); }
.q-txt b { display: block; font-weight: 600; font-size: 15px; line-height: 1.25; }
.q-txt small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.q-opt:hover { border-color: var(--beige); background: #fff; box-shadow: 0 18px 30px -22px rgba(122,90,60,.55); transform: translate3d(0,-3px,0); }
.q-opt:hover .q-ico { transform: scale(1.06) rotate(-3deg); }
.q-opt:active { transform: scale(.98); }
.q-opt.picked { border-color: var(--beige); background: #F6ECDF; box-shadow: inset 0 0 0 1px var(--beige); }
.q-opt.picked .q-ico { background: var(--beige); color: #33251A; }

/* Matching */
.q-loading { text-align: center; padding: 30px 0; }
.q-loading h3 { text-align: center; margin: 26px 0 14px; }
.q-loading ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.q-loading li { opacity: 0; animation: qopt .5s var(--ease) forwards; animation-delay: calc(var(--i) * 450ms + 200ms); }
.q-orb { position: relative; width: 84px; height: 84px; margin: 0 auto; }
.q-orb i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--beige); opacity: 0; animation: orb 1.8s ease-out infinite; }
.q-orb i:nth-child(2) { animation-delay: .6s; } .q-orb i:nth-child(3) { animation-delay: 1.2s; }
@keyframes orb { 0% { transform: scale(.3); opacity: .9; } 100% { transform: scale(1.15); opacity: 0; } }

/* Result */
.q-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: #9a7a58; margin: 0 0 8px; }
.q-result h3 { margin-bottom: 4px; }
.q-sum { color: var(--muted); font-size: .88rem; margin: 0 0 18px; }
.q-routine { display: grid; gap: 8px; }
.q-row { display: grid; grid-template-columns: 62px 1fr auto; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; border-radius: 18px; background: #FBFAF7; border: 1px solid var(--accent); animation: qopt .5s var(--ease) both; animation-delay: calc(var(--i) * 90ms + 100ms); }
.q-thumb { width: 62px; height: 62px; border-radius: 14px; background: rgba(227,229,223,.7); padding: 4px; }
.q-thumb svg { width: 100%; height: 100%; }
.q-info b { display: block; font-weight: 600; font-size: 14px; }
.q-info small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.q-buy { display: grid; justify-items: end; gap: 5px; }
.q-buy span { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; }
.q-buy a { padding: 6px 14px; border-radius: 999px; background: var(--beige); color: #33251A; font-size: 12px; font-weight: 600; transition: background .2s, transform .2s; }
.q-buy a:hover { background: #cba37e; transform: translateY(-1px); }
.q-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 6px 4px; font-size: 13px; color: var(--muted); }
.q-total b { font-family: var(--serif); font-size: 1.7rem; color: var(--dark); }
.q-actions { display: flex; gap: 10px; margin-top: 8px; }
.q-btn { flex: 1; padding: 14px; border-radius: 999px; border: 1px solid var(--accent); background: #fff; font-size: 13px; font-weight: 500; color: var(--dark); transition: border-color .2s, background .2s, transform .2s; }
.q-btn:hover { border-color: var(--dark); }
.q-btn.solid { background: var(--sage); border-color: #cfd3c6; }
.q-btn.solid:hover { background: #d6d9cf; }
.q-btn:active { transform: scale(.98); }
.q-kit { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; padding: 14px 16px; border-radius: 16px; background: #f3f1ec; font-size: 12px; }
.q-kit b { display: block; font-weight: 600; font-size: 13px; }
.q-kit small { color: var(--muted); }
.q-kit a { white-space: nowrap; font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--dark); padding-bottom: 1px; }

@media (max-width: 899px) {
    .q-profile { display: none; }
    .q-card { padding: 22px 18px 24px; min-height: 0; border-radius: 26px; }
    .q-grid { grid-template-columns: 1fr; }
    .q-opt { padding: 12px 14px; }
    .q-ico { width: 50px; height: 50px; border-radius: 14px; }
    .q-row { grid-template-columns: 52px 1fr; }
    .q-thumb { width: 52px; height: 52px; }
    .q-buy { grid-column: 1 / -1; grid-auto-flow: column; justify-content: space-between; align-items: center; padding-left: 66px; margin-top: -4px; }
    .q-kit { flex-direction: column; align-items: flex-start; }
}

/* ================= Bottom nav on phones: calm, solid, no bouncing pill =================
   The old floating nav slid a pill with a transform and sat on a translateX(-50%) shell,
   so it re-laid-out during page changes and looked jumpy. Now it is a plain fixed tab bar. */
@media (max-width: 899px) {
    .nav { left: 0; right: 0; bottom: 0; transform: none; max-width: none; width: 100%; border-radius: 0; border: 0; border-top: 1px solid var(--accent); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(249,248,246,.98); box-shadow: 0 -10px 30px -18px rgba(0,0,0,.25); display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; }
    .nav-ind { top: 6px; bottom: auto; height: 3px; border-radius: 3px; background: var(--dark); box-shadow: none; transition: transform .3s var(--ease), width .3s var(--ease); }
    .nav-link { padding: 12px 2px 8px; font-size: 11px; border-radius: 10px; text-align: center; color: var(--muted); transition: color .2s, background .2s; }
    .nav-link.is-active { color: var(--dark); background: transparent; font-weight: 600; }
    .nav-link:active { background: rgba(0,0,0,.05); }
    .footer { padding-bottom: 96px; }
    body { padding-bottom: 0; }
}

/* ================= Transitions: keep them on the GPU, lighter on phones ================= */
.wipe-strip { backface-visibility: hidden; transform: scaleY(0) translateZ(0); }
@media (max-width: 899px) {
    .wipe-strip::after { display: none; }
    #wipe-label { font-size: clamp(2rem, 11vw, 3rem); }
}
