/* ============================================================
   AssetNix Outreach — adaptive wizard (LIGHT / corporate theme)
   Used by /bme (and later /ms, /plant-manager).
   Pure CSS. Class prefix: .wz-
   ============================================================ */

:root {
  --brand: #4f46e5;         /* corporate indigo */
  --brand-700: #3730a3;
  --brand-soft: #eef2ff;
  --accent: #0ea5e9;        /* sky — secondary accent */
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e6eaf2;
  --card: #ffffff;
  --bg: #f5f7fc;

  --ok: #059669;
  --warn: #d97706;
  --danger: #dc2626;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05), 0 2px 8px rgba(15,23,42,.05);
  --shadow: 0 12px 32px -14px rgba(30,41,59,.28);
  --shadow-lg: 0 30px 70px -28px rgba(30,41,59,.35);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --role: var(--brand);
  --role-soft: var(--brand-soft);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--ink);
  background:
    radial-gradient(900px 480px at 88% -8%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 66%),
    radial-gradient(720px 460px at -6% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 64%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  overflow-x: hidden; /* never scroll sideways */
}
h1,h2,h3 { margin: 0; line-height: 1.14; letter-spacing: -.02em; }
p { margin: 0; }
img { max-width: 100%; display: block; }

/* ---------- Shell ---------- */
.wz {
  height: 100vh;            /* fallback */
  height: 100svh;
  height: 100dvh;           /* fixed viewport: header + nav pinned, body scrolls */
  display: flex; flex-direction: column;
  overflow: hidden;
}
.wz-top {
  display: flex; align-items: center; gap: 1rem; flex-wrap: nowrap;
  padding: .8rem clamp(1rem, 4vw, 2.2rem);
}
.wz-brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; letter-spacing: -.02em; font-size: 1.12rem; color: var(--ink); text-decoration: none; min-width: 0; flex-shrink: 0; }
.wz-brand .logo {
  width: 30px; height: 30px; border-radius: 9px; color: #fff; font-weight: 900; font-size: 1rem;
  display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--accent));
}
.wz-brand .pill {
  font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand); background: var(--brand-soft); padding: .22rem .55rem; border-radius: 999px;
}

/* ---------- Macro stepper (from screen 2 onward) ---------- */
.wz-steps { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.wz-steps[hidden] { display: none; }
.wz-step { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .8rem; font-weight: 600; }
.wz-step .bullet {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: .72rem; font-weight: 800; background: #fff; border: 1.5px solid var(--line); color: var(--muted);
  transition: .2s;
}
.wz-step .label { display: none; }
.wz-step.active .bullet { background: var(--brand); border-color: var(--brand); color: #fff; }
.wz-step.done .bullet { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.wz-step.active .label { display: inline; color: var(--ink); }
.wz-step .sep { width: 14px; height: 1.5px; background: var(--line); }
@media (min-width: 720px) { .wz-step .label { display: inline; } }

/* ---------- Body / screen ---------- */
/* Scrolls when content is taller than the viewport; centers when it fits.
   margin:auto on the item (not justify-content:center) avoids top clipping on overflow. */
.wz-body { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: clamp(1rem, 4vw, 2rem); min-height: 0; width: 100%; }
.wz-screen { width: 100%; max-width: 680px; min-width: 0; margin-block: auto; animation: wz-fade .4s ease; }
.wz-screen.wide { max-width: 980px; }
.wz-screen h1, .wz-tagline, .wz-points .v, .wz-points .k { overflow-wrap: anywhere; }
@keyframes wz-fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.wz-eyebrow {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--brand); background: var(--brand-soft); padding: .32rem .7rem; border-radius: 999px;
}
.wz-h { font-size: clamp(1.7rem, 4.6vw, 2.7rem); font-weight: 800; margin-top: 1rem; }
.wz-sub { color: var(--ink-2); font-size: clamp(1.02rem, 2vw, 1.18rem); margin-top: .85rem; }
.wz-center { text-align: center; }
.wz-center .wz-eyebrow, .wz-center .wz-cta-row { justify-content: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; white-space: nowrap;
  padding: .95rem 1.7rem; border-radius: 999px; border: 1.5px solid transparent;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 12px 26px -12px color-mix(in srgb, var(--brand) 75%, transparent); }
.btn-primary:hover { background: var(--brand-700); }
.btn-primary:disabled { background: #c7cbe6; box-shadow: none; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: #cbd5e1; background: #fbfcfe; }
.btn-text { background: transparent; color: var(--muted); border: 0; padding: .8rem 1rem; font-weight: 600; }
.btn-text:hover { color: var(--ink); }
.wz-cta-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; align-items: center; }
.wz-cta-hint { color: var(--muted); font-size: .86rem; }

/* ---------- Diagnose chips ---------- */
.wz-chips { display: grid; gap: .7rem; margin-top: 1.6rem; }
.wz-chip {
  display: flex; align-items: center; gap: .85rem; text-align: left;
  width: 100%; padding: 1rem 1.15rem; border-radius: 14px; cursor: pointer;
  background: #fff; border: 1.5px solid var(--line); color: var(--ink);
  font: inherit; font-size: 1.02rem; font-weight: 600; transition: .15s;
}
.wz-chip:hover { border-color: #c7cbe6; background: #fbfcff; }
.wz-chip .box {
  flex: none; width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid #cbd5e1;
  display: grid; place-items: center; color: #fff; transition: .15s;
}
.wz-chip .box::after { content: "✓"; font-size: .8rem; font-weight: 900; opacity: 0; transition: .15s; }
.wz-chip[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.wz-chip[aria-pressed="true"] .box { background: var(--brand); border-color: var(--brand); }
.wz-chip[aria-pressed="true"] .box::after { opacity: 1; }

/* Optional qualifier */
.wz-qual { margin-top: 1.6rem; }
.wz-qual .q { font-weight: 700; font-size: .95rem; color: var(--ink-2); margin-bottom: .6rem; }
.wz-seg { display: inline-flex; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: .25rem; gap: .2rem; flex-wrap: wrap; }
.wz-seg button {
  font: inherit; font-weight: 600; font-size: .9rem; border: 0; background: transparent; color: var(--ink-2);
  padding: .5rem 1rem; border-radius: 999px; cursor: pointer;
}
.wz-seg button[aria-pressed="true"] { background: var(--brand); color: #fff; }

/* ---------- Fix screen: title above, image + points below ---------- */
.wz-fix-head { margin-bottom: clamp(1.2rem, 3vw, 1.8rem); }
.wz-fix-head .wz-tagline { margin-top: .6rem; }
.wz-fix { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.4rem, 4vw, 3rem); align-items: center; }
.wz-fix > * { min-width: 0; }
.wz-fix .visual { display: grid; place-items: center; }
.wz-fix .visual .device { width: min(360px, 100%); }
.wz-tagline { color: var(--muted); font-style: italic; margin-top: .7rem; font-size: 1.02rem; }
.wz-points { list-style: none; margin: 1.3rem 0 0; padding: 0; display: grid; gap: .8rem; }
.wz-points li { display: flex; gap: .7rem; }
.wz-points .tick {
  flex: none; width: 24px; height: 24px; border-radius: 7px; background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-weight: 900; font-size: .8rem; margin-top: .1rem;
}
.wz-points .k { font-weight: 700; }
.wz-points .v { color: var(--ink-2); }
.wz-foot { margin-top: 1.3rem; font-weight: 700; color: var(--brand); }

/* ---------- Snapshot / credibility lists ---------- */
.wz-recap { display: inline-flex; flex-wrap: wrap; gap: .45rem; margin-top: 1rem; justify-content: center; }
.wz-recap .tag { font-size: .82rem; font-weight: 700; color: var(--brand-700); background: var(--brand-soft); padding: .3rem .7rem; border-radius: 999px; }
.wz-list { list-style: none; margin: 1.6rem auto 0; padding: 0; display: grid; gap: .8rem; max-width: 560px; text-align: left; }
.wz-list li { display: flex; gap: .7rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1.05rem; box-shadow: var(--shadow-sm); }
.wz-list .tick { flex: none; width: 24px; height: 24px; border-radius: 7px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 900; font-size: .8rem; }

/* ---------- Challenges: animated problem reveal (no input) ---------- */
.wz-challenges { list-style: none; margin: 1.8rem auto 0; padding: 0; display: grid; gap: .7rem; max-width: 640px; text-align: left; }
.wz-challenges li {
  display: flex; align-items: center; gap: .85rem;
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: 12px;
  padding: .9rem 1.1rem; box-shadow: var(--shadow-sm); font-weight: 600; color: var(--ink);
  opacity: 0; animation: wz-chal-in .55s cubic-bezier(.2,.7,.2,1) forwards;
}
.wz-challenges .mk {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: #fef3c7; color: #b45309; font-weight: 900; font-size: .9rem;
}
@keyframes wz-chal-in { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .wz-challenges li { opacity: 1; animation: none; } }

/* ---------- Solutions intro: professional word-reveal ---------- */
.wz-reveal .wz-word {
  display: inline-block; opacity: 0; transform: translateY(16px);
  animation: wz-word-in .62s cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes wz-word-in { to { opacity: 1; transform: none; } }
.wz-solutions .wz-underline {
  display: block; width: 0; height: 4px; margin: 1.5rem auto 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  animation: wz-underline .7s .55s cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes wz-underline { to { width: 128px; } }

@media (prefers-reduced-motion: reduce) {
  .wz-reveal .wz-word { opacity: 1; transform: none; animation: none; }
  .wz-solutions .wz-underline { width: 128px; animation: none; }
}

/* ---------- Thanks: professional finale (animated check + staggered list) ---------- */
.wz-finale { position: relative; width: 84px; height: 84px; margin: 0 auto 1.1rem; display: grid; place-items: center; }
.wz-finale .ring {
  position: absolute; width: 76px; height: 76px; border-radius: 50%;
  border: 2px solid var(--brand); opacity: 0; animation: wz-pulse 2.2s ease-out .5s 2;
}
@keyframes wz-pulse { 0% { transform: scale(.75); opacity: .45; } 80% { opacity: 0; } 100% { transform: scale(1.35); opacity: 0; } }
.wz-check .disk { fill: var(--brand); transform-origin: center; animation: wz-pop .5s cubic-bezier(.2,.9,.3,1.35) both; }
.wz-check .tick {
  fill: none; stroke: #fff; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 40; stroke-dashoffset: 40; animation: wz-draw .4s .42s ease forwards;
}
@keyframes wz-pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes wz-draw { to { stroke-dashoffset: 0; } }
.wz-list--in li { opacity: 0; animation: wz-rise .5s ease forwards; }
@keyframes wz-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .wz-finale .ring, .wz-check .disk, .wz-check .tick, .wz-list--in li { animation: none; }
  .wz-check .tick { stroke-dashoffset: 0; }
  .wz-list--in li { opacity: 1; }
}

/* ---------- Book form ---------- */
.wz-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1.4rem, 4vw, 2.2rem); }
.wz-form { display: grid; gap: .9rem; margin-top: 1.4rem; text-align: left; }
.wz-field { display: grid; gap: .35rem; }
.wz-field label { font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.wz-field input {
  font: inherit; padding: .85rem 1rem; border-radius: 11px; border: 1.5px solid var(--line); background: #fff; color: var(--ink);
}
.wz-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.wz-form .btn { width: 100%; }
.wz-form-note { color: var(--muted); font-size: .8rem; text-align: center; margin-top: .3rem; }
.wz-success { display: none; text-align: center; margin-top: 1.2rem; padding: 1rem; border-radius: 12px; background: #ecfdf5; color: #047857; font-weight: 600; }

/* ---------- Bottom nav ---------- */
.wz-nav {
  display: flex; align-items: center; gap: .8rem;
  padding: .9rem clamp(1rem, 4vw, 2.2rem);
  padding-bottom: max(.9rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: color-mix(in srgb, #fff 70%, transparent);
  backdrop-filter: blur(8px);
}
.wz-nav > .btn { flex: 0 0 auto; }
.wz-dots { flex: 1 1 auto; min-width: 0; display: flex; gap: .4rem; justify-content: center; overflow: hidden; }
.wz-dots button { flex: none; width: 8px; height: 8px; border-radius: 999px; border: 0; background: #cbd5e1; cursor: pointer; padding: 0; transition: .2s; }
.wz-dots button[aria-current="true"] { background: var(--brand); width: 24px; }

/* ---------- Mockup device (light) ---------- */
.device { background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; }
.device-bar { display: flex; align-items: center; gap: .4rem; padding: .65rem .85rem; border-bottom: 1px solid var(--line); }
.device-bar .dot { width: 9px; height: 9px; border-radius: 50%; background: #e2e8f0; }
.device-bar .url { margin-left: .55rem; font-size: .72rem; color: var(--muted); background: #f1f5f9; padding: .18rem .55rem; border-radius: 999px; }
.device-body { padding: 1rem; }
.mock-card { border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.mock-row { display: flex; align-items: center; gap: .7rem; }
.mock-kv { display: flex; justify-content: space-between; padding: .5rem 0; border-top: 1px dashed var(--line); font-size: .85rem; }
.mock-kv:first-child { border-top: 0; }
.mock-kv .k { color: var(--muted); }
.mock-kv .v { font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .7rem; font-weight: 800; padding: .2rem .55rem; border-radius: 999px; }
.chip.ok { color: #047857; background: #d1fae5; }
.chip.warn { color: #92400e; background: #fef3c7; }
.chip.danger { color: #991b1b; background: #fee2e2; }
.chip.info { color: var(--brand-700); background: var(--brand-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 780px) {
  .wz-fix { grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }
  .wz-fix .visual { order: -1; }
  .wz-fix .visual .device { width: min(280px, 82%); }
  .wz-h { font-size: clamp(1.55rem, 7vw, 2.1rem); margin-top: .7rem; }
  .wz-points { gap: .6rem; }
  .btn { padding: .9rem 1.4rem; }
  .wz-nav .btn { padding: .85rem 1.2rem; font-size: .92rem; }
}

/* Compact header on phones: the bottom dots already convey progress,
   so drop the macro stepper (and the role pill) to guarantee the header fits. */
@media (max-width: 640px) {
  .wz-steps { display: none !important; }
  .wz-brand .pill { display: none; }
  .wz-nav { gap: .5rem; }
  .wz-nav .btn { padding: .8rem 1.05rem; font-size: .9rem; }
  .wz-dots { gap: .28rem; }
  .wz-dots button { width: 6px; height: 6px; }
  .wz-dots button[aria-current="true"] { width: 16px; }
}
