/* "Vyzkoušet" wizard. Layout: the five steps on the left, the visitor's future widget on a storefront stage on the right,
   which repaints as we learn the brand. Tokens follow the portal studio (/app/widget) so both feel like one product. */
:root {
  --bg: #f4f6fb; --panel: #ffffff; --fg: #1b1f2a; --muted: #5d6677; --line: #dde2ec; --soft: #eef2fb;
  --accent: #2f5bea; --on-accent: #ffffff; --ok: #15803d; --okbg: #e9f7ee; --warn: #9a4a07; --warnbg: #fdf3e4; --bad: #b42318;
  --stage: #dfe5f2; --shop: #ffffff;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151d; --panel: #1a1e29; --fg: #e8ebf3; --muted: #a3acbf; --line: #2e3547; --soft: #242a3a;
    --accent: #7d9bff; --on-accent: #0c1022; --ok: #4ade80; --okbg: #15291d; --warn: #f5b454; --warnbg: #2e2414; --bad: #ff8f7a;
    --stage: #0d1017; --shop: #1f2430; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12151d; --panel: #1a1e29; --fg: #e8ebf3; --muted: #a3acbf; --line: #2e3547; --soft: #242a3a;
  --accent: #7d9bff; --on-accent: #0c1022; --ok: #4ade80; --okbg: #15291d; --warn: #f5b454; --warnbg: #2e2414; --bad: #ff8f7a;
  --stage: #0d1017; --shop: #1f2430; color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--font); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 78rem; margin: 0 auto; padding-block: 1.25rem 2rem;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--fg); text-decoration: none; }
.muted-link { color: var(--muted); font-size: .9rem; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 2.25rem; align-items: start; }
@media (max-width: 960px) { .grid { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; } .stage { position: static !important; } }
.foot { max-width: 78rem; margin: 0 auto; padding: 0 16px 2rem; color: var(--muted); font-size: .9rem; }

/* step indicator: a real sequence, so numbers are right here */
.steps { display: flex; gap: .35rem; margin: 0 0 1.6rem; padding: 0; list-style: none; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--muted); padding: .3rem .7rem .3rem .35rem; border-radius: 999px; background: var(--soft); border: 0; }
.steps li b { width: 1.4rem; height: 1.4rem; border-radius: 50%; display: grid; place-items: center; background: var(--panel); font-size: .78rem; font-weight: 600; }
.steps li.now { color: var(--fg); font-weight: 600; }
.steps li.now b { background: var(--accent); color: var(--on-accent); }
.steps li.done b { background: var(--ok); color: #fff; }
.steps li button { all: unset; display: flex; align-items: center; gap: .4rem; cursor: pointer; border-radius: 999px; }
.steps li button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 560px) { .steps li span.name { display: none; } .steps li.now span.name { display: inline; } .steps li { padding-right: .35rem; } .steps li.now { padding-right: .7rem; } }

h1 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); line-height: 1.15; margin: 0 0 .6rem; text-wrap: balance; letter-spacing: -.01em; outline: none; }
.lead { color: var(--muted); margin: 0 0 1.4rem; max-width: 36rem; font-size: 1.02rem; }
.hint { color: var(--muted); font-size: .9rem; margin: .4rem 0 0; }
.err { color: var(--bad); font-size: .92rem; margin: .6rem 0 0; font-weight: 500; }
.big { display: flex; gap: .5rem; flex-wrap: wrap; }
.big input { flex: 1 1 15rem; min-width: 0; }
input[type=text], input[type=email], textarea {
  width: 100%; padding: .7rem .85rem; border: 1.5px solid var(--line); border-radius: .65rem; background: var(--panel); color: var(--fg);
}
.big input { font-size: 1.05rem; padding: .85rem 1rem; border-radius: .7rem; }
textarea { resize: vertical; min-height: 4.5rem; }
::placeholder { color: var(--muted); opacity: .75; }
.primary { border: 0; background: var(--accent); color: var(--on-accent); padding: .8rem 1.3rem; border-radius: .7rem; font-weight: 600; }
.primary:disabled { opacity: .5; cursor: default; }
.ghost { border: 1px solid var(--line); background: var(--panel); padding: .55rem .95rem; border-radius: .6rem; font-weight: 500; }
.ghost:hover { border-color: var(--muted); }
.ghost.wide { width: 100%; padding: .75rem; }
.linkbtn { border: 0; background: none; color: var(--accent); padding: .3rem 0; font-weight: 600; }
.skip { margin-top: .5rem; }
.nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.6rem; flex-wrap: wrap; }

/* what we found on the site: each signal lands and the stage repaints */
.found { list-style: none; margin: 1.3rem 0 0; padding: 0; display: grid; gap: .45rem; }
.found li { display: flex; align-items: center; gap: .65rem; padding: .6rem .8rem; border-radius: .65rem; background: var(--panel); border: 1px solid var(--line); color: var(--muted); transition: color .3s, border-color .3s; }
.found li i { width: .6rem; height: .6rem; border-radius: 50%; background: var(--line); flex: none; }
.found li span { margin-left: auto; text-align: right; font-size: .9rem; min-width: 0; overflow-wrap: anywhere; display: flex; align-items: center; gap: .35rem; justify-content: flex-end; }
.found li.wait i { animation: pulse 1.1s ease-in-out infinite; background: var(--muted); }
.found li.on { color: var(--fg); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.found li.on i { background: var(--ok); }
.found li.on span { color: var(--fg); font-weight: 500; }
.found li.miss i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }
.found .dot { width: .85rem; height: .85rem; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .2); display: inline-block; }
@keyframes pulse { 50% { opacity: .25; } }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: .9rem; padding: 1.15rem 1.25rem; display: grid; gap: .85rem; }
.mailpanel { margin-top: 1rem; }
.field { display: grid; gap: .4rem; padding-top: .85rem; border-top: 1px solid var(--line); }
.field:first-child { border-top: 0; padding-top: 0; }
.label { font-weight: 600; }
.row { display: flex; gap: .5rem; }
.row input { flex: 1; min-width: 0; }
.row .ghost { flex: none; }
@media (max-width: 480px) { .row { flex-direction: column; } }
.swatches { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; padding: 4px; }
.sw { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 0; background: var(--c); position: relative; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 28%, transparent); }
.sw[aria-checked="true"]::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--fg); }
.where { font-size: .85rem; color: var(--muted); }
.feedhelp { background: var(--soft); border-radius: .6rem; padding: .75rem .9rem; font-size: .92rem; }
.feedhelp ol { margin: .3rem 0 0; padding-left: 1.2rem; display: grid; gap: .15rem; }
.feedhelp p { margin: 0; }
.or { display: flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.progress { height: .4rem; border-radius: 999px; background: var(--soft); overflow: hidden; position: relative; }
.progress i { display: block; height: 100%; width: 40%; background: var(--accent); border-radius: 999px; animation: slide 1.2s ease-in-out infinite; }
.progress.full i { width: 100%; animation: none; }
@keyframes slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
.state { margin: 0; min-height: 1.4em; }
.state.bad { color: var(--bad); font-weight: 500; }
.state.good { color: var(--ok); font-weight: 500; }

.counter { display: inline-flex; gap: .4rem; align-items: center; font-size: .9rem; padding: .3rem .75rem; border-radius: 999px; background: var(--okbg); color: var(--ok); font-weight: 600; }
.counter.out { background: var(--warnbg); color: var(--warn); }
.qs { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1rem 0 .5rem; }
.q { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: .5rem .95rem; text-align: left; }
.q:hover { border-color: var(--accent); }

.seg { display: inline-flex; background: var(--soft); border-radius: .6rem; padding: .2rem; gap: .2rem; flex-wrap: wrap; justify-self: start; }
.seg button { border: 0; background: none; padding: .45rem .9rem; border-radius: .45rem; font-weight: 600; color: var(--muted); }
.seg button[aria-checked="true"] { background: var(--panel); color: var(--fg); box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
.check { display: flex; gap: .65rem; align-items: flex-start; font-weight: 500; cursor: pointer; }
.check input { width: 1.15rem; height: 1.15rem; margin-top: .2rem; accent-color: var(--accent); flex: none; }
.check small { display: block; color: var(--muted); font-weight: 400; font-size: .85rem; }
.logorow { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.logoprev { width: 2.4rem; height: 2.4rem; border-radius: .5rem; background: var(--soft); background-size: contain; background-position: center; background-repeat: no-repeat; border: 1px solid var(--line); flex: none; }
.logoname { flex: 1 1 8rem; min-width: 0; color: var(--muted); font-size: .9rem; }
.filebtn { cursor: pointer; display: inline-block; position: relative; }
.filebtn input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.filebtn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .6rem; }
.plan { border: 1.5px solid var(--line); background: var(--panel); border-radius: .85rem; padding: .9rem; text-align: left; display: grid; gap: .25rem; align-content: start; }
.plan[aria-checked="true"] { border-color: var(--accent); background: var(--soft); }
.plan b { font-size: 1rem; } .plan strong { font-size: 1.1rem; } .plan small { color: var(--muted); line-height: 1.35; }
.tagline { font-size: .78rem; font-weight: 600; color: var(--ok); }

.done { display: grid; gap: .8rem; justify-items: start; }
.check-mark, .done .check { width: 3rem; height: 3rem; border-radius: 50%; background: var(--okbg); color: var(--ok); display: grid; place-items: center; font-size: 1.4rem; font-weight: 700; }

/* stage */
.stage { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 1rem); display: grid; gap: .6rem; }
.stagebar { display: flex; justify-content: flex-end; }
.screen { background: var(--stage); border-radius: 1rem; padding: 1rem; }
.shop { background: var(--shop); height: 34rem; border-radius: .7rem; overflow: hidden; position: relative; box-shadow: 0 10px 30px rgb(15 23 42 / .14); }
.shop iframe { position: absolute; top: 0; right: 0; width: 100%; height: 100%; border: 0; display: block; background: var(--shop); }
.shop iframe.left { right: auto; left: 0; }
.nowrap { white-space: nowrap; }
@media (max-width: 960px) { .shop { height: 32rem; } }
@media (max-width: 480px) { .screen { padding: .5rem; } }
.stagecap { color: var(--muted); font-size: .88rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } .progress i { margin-left: 0; width: 100%; } }

.big button.ghost { padding: .8rem 1.3rem; border-radius: .7rem; font-weight: 600; }

/* compact live preview for narrow screens, where the stage sits far below the list */
.mini { display: none; margin-top: 1rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--panel); overflow: hidden; --mr: .55rem; --mbg: #5d6677; --mfg: #fff; }
.minibar { display: flex; align-items: center; gap: .55rem; padding: .65rem .85rem; background: var(--mbg); color: var(--mfg); transition: background .4s, color .4s; }
.minibar b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.minimark { width: 1.6rem; height: 1.6rem; border-radius: .4rem; background: rgb(255 255 255 / .3) center / contain no-repeat; flex: none; }
.minimark.has { background-color: #fff; }
.minilauncher { display: inline-block; margin: .8rem .85rem; padding: .55rem 1rem; border-radius: var(--mr); background: var(--mbg); color: var(--mfg); font-weight: 600; transition: background .4s, color .4s; }
@media (max-width: 960px) { .mini:not([hidden]) { display: block; } }

/* editable list of suggested questions (same pattern as the studio) */
.list { display: grid; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.list li { display: flex; align-items: center; gap: .25rem; }
.list li input { flex: 1; min-width: 0; }
.icon { width: 2.3rem; height: 2.3rem; border: 0; border-radius: .45rem; background: none; color: var(--muted); display: grid; place-items: center; flex: none; }
.icon:hover:not(:disabled) { background: var(--soft); color: var(--fg); }
.icon:disabled { opacity: .3; cursor: default; }
.add { justify-self: start; border: 0; background: none; color: var(--accent); font-weight: 600; padding: .3rem 0; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { border: 1px dashed var(--muted); border-radius: 999px; padding: .3rem .75rem; font-size: .85rem; color: var(--muted); background: none; text-align: left; }
.chip:hover { color: var(--fg); border-color: var(--fg); }
