/* ──────────────────────────────────────────────────────────────
 * app.css — Migration Cost Calculator layout & components
 * Built on BizStream tokens (styles/tokens.css). Light & airy.
 * Accent is driven by --accent (set live by the Tweaks panel).
 * ────────────────────────────────────────────────────────────── */

* { box-sizing: border-box; }

:root {
  /* Accent pinned to cyan (the production default; Tweaks panel omitted).
     In the prototype these were set live via JS — here they're static. */
  --accent: var(--bzs-cyan);
  --accent-deep: var(--bzs-cyan-700);
  --accent-soft: var(--bzs-cyan-50);
  --accent-ring: rgba(0, 196, 233, 0.32);
  --accent-fg: var(--bzs-navy);
}

html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-muted);
  color: var(--fg);
  font-family: var(--font-body);
  min-height: 100vh;
}

button { font-family: inherit; }

/* ── App shell ──────────────────────────────────────────────── */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--bzs-navy);
}
.brand .mark { width: 26px; height: 26px; display: block; color: var(--accent); }
.brand .mark svg { width: 100%; height: 100%; display: block; }
.brand .wm {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--bzs-navy);
}
.topbar .save-note {
  font-size: var(--text-xs);
  color: var(--fg-subtle);
  display: flex;
  align-items: center;
  gap: 7px;
}
.topbar .save-note i { color: var(--accent-deep); }

/* ── Centered stage ─────────────────────────────────────────── */
.stage {
  width: 100%;
  max-width: 760px;
  padding: 8px 24px 64px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ── Progress ───────────────────────────────────────────────── */
.progress {
  margin: 14px 0 30px;
}
.progress .meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.progress .step-label {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--bzs-navy);
}
.progress .pct {
  font-size: var(--text-xs);
  color: var(--fg-subtle);
  font-weight: var(--fw-medium);
}

/* bar style */
.bar-track {
  height: 8px;
  background: var(--bzs-neutral-100);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: width .4s cubic-bezier(.4,0,.2,1);
}

/* dots style */
.dots { display: flex; gap: 8px; align-items: center; }
.dots .dot {
  height: 8px; flex: 1;
  background: var(--bzs-neutral-100);
  border-radius: var(--radius-pill);
  transition: background .3s ease;
}
.dots .dot.done { background: var(--accent); }
.dots .dot.active { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }

/* steps (numbered nodes) style */
.steps { display: flex; align-items: center; gap: 0; }
.steps .node {
  width: 26px; height: 26px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: var(--fw-bold);
  background: var(--bzs-neutral-100); color: var(--fg-subtle);
  font-family: var(--font-display);
  transition: all .3s ease;
}
.steps .node.done { background: var(--accent); color: #fff; }
.steps .node.active { background: var(--bzs-navy); color: #fff; box-shadow: 0 0 0 3px var(--accent-ring); }
.steps .seg { flex: 1; height: 3px; background: var(--bzs-neutral-100); border-radius: 2px; transition: background .3s ease; }
.steps .seg.done { background: var(--accent); }

/* ── Card / panel ───────────────────────────────────────────── */
.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 38px 40px 32px;
  animation: panelIn .42s cubic-bezier(.16,.84,.44,1) both;
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sec-head { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.sec-icon {
  width: 52px; height: 52px; flex-shrink: 0;
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  color: var(--accent-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.sec-icon.hidden { display: none; }
.eyebrow {
  font-weight: var(--fw-bold);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 3px;
}
.sec-title {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--text-3xl);
  line-height: 1.12;
  color: var(--bzs-navy);
  letter-spacing: -0.01em;
}
.sec-blurb {
  color: var(--fg-muted);
  font-size: var(--text-base);
  line-height: 1.5;
  margin-top: 14px;
  max-width: 56ch;
}

.q-list { margin-top: 28px; display: flex; flex-direction: column; gap: 30px; }

/* question reveal animation */
.q-block { animation: revealIn .4s cubic-bezier(.16,.84,.44,1) both; }
@keyframes revealIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.q-label {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--text-lg);
  color: var(--bzs-navy);
  line-height: 1.35;
}
.q-hint {
  font-size: var(--text-sm);
  color: var(--fg-subtle);
  font-weight: var(--fw-medium);
  margin-top: 3px;
}

/* ── Option cards ───────────────────────────────────────────── */
.opts { margin-top: 14px; display: grid; gap: 12px; }
.opts.cols-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .opts.cols-2 { grid-template-columns: 1fr; } }

.opt {
  position: relative;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  background: #fff;
  border: 2px solid var(--bzs-neutral-100);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .08s ease;
}
.opt:hover { border-color: var(--accent); background: #fff; }
.opt:active { transform: translateY(1px); }
.opt:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.opt.sel {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.opt .tick {
  width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px;
  border-radius: 50%;
  border: 2px solid var(--bzs-neutral-200);
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  transition: all .15s ease;
  color: #fff; font-size: 11px;
}
.opt.multi .tick { border-radius: 6px; }
.opt.sel .tick { background: var(--accent); border-color: var(--accent); }
.opt .tick i { opacity: 0; transition: opacity .12s ease; }
.opt.sel .tick i { opacity: 1; }
.opt .otext { flex: 1; }
.opt .otitle {
  display: block;
  font-weight: var(--fw-semibold);
  font-size: var(--text-base);
  color: var(--bzs-navy);
  line-height: 1.3;
}
.opt .odesc {
  display: block;
  font-size: var(--text-sm);
  color: var(--fg-muted);
  line-height: 1.45;
  margin-top: 3px;
}

/* compact horizontal single-select for short labelled choices */
.segmented-slider {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: #fff;
}
.segment {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  line-height: 1.2;
  min-height: 40px;
  padding: 9px 10px;
  text-align: center;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease, transform .08s ease;
}
.segment:hover { color: var(--bzs-navy); background: var(--accent-soft); }
.segment:active { transform: translateY(1px); }
.segment:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.segment.sel {
  background: var(--bzs-cyan-400);
  color: var(--bzs-navy);
  box-shadow: var(--shadow-sm);
}
.segmented-text { max-width: 460px; }

/* inline "other" text field that appears under a selected option */
.opt-text {
  margin-top: 10px;
  animation: revealIn .3s ease both;
}

/* ── Text inputs ────────────────────────────────────────────── */
.field {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--fg);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field::placeholder { color: var(--bzs-neutral-400); }
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
textarea.field { resize: vertical; min-height: 92px; line-height: 1.5; }
.field-label {
  display: block;
  font-weight: var(--fw-semibold);
  font-size: var(--text-sm);
  color: var(--bzs-navy);
  margin-bottom: 7px;
}

/* ── Footer nav ─────────────────────────────────────────────── */
.nav {
  margin-top: 26px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav .spacer { flex: 1; }

.btn {
  font-family: var(--font-body);
  font-weight: var(--fw-semibold);
  font-size: var(--text-base);
  border-radius: var(--radius-pill);
  border: 0;
  cursor: pointer;
  padding: 13px 28px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .08s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn-primary { background: var(--bzs-blue); color: #fff; }
.btn-primary:hover { background: var(--bzs-navy); }
.btn-accent { background: var(--accent); color: var(--accent-fg, var(--bzs-navy)); }
.btn-accent:hover { filter: brightness(.95); }
.btn-ghost { background: transparent; color: var(--fg-muted); padding-left: 14px; padding-right: 14px; }
.btn-ghost:hover { color: var(--bzs-navy); background: var(--bzs-neutral-100); }
.btn-link {
  background: transparent;
  color: var(--fg-subtle);
  border: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: var(--fw-semibold);
  font-size: var(--text-sm);
  padding: 8px 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--bzs-neutral-300);
}
.btn-link:hover { color: var(--bzs-navy); }
.btn[disabled] { background: var(--bzs-neutral-100); color: var(--bzs-neutral-400); cursor: not-allowed; }
.btn[disabled]:active { transform: none; }

/* ── Intro screen ───────────────────────────────────────────── */
.intro { text-align: center; padding: 48px 44px 40px; }
.intro .kicker {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-soft); color: var(--accent-deep);
  font-weight: var(--fw-bold); font-size: var(--text-xs);
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 7px 14px; border-radius: var(--radius-pill);
  margin-bottom: 22px;
}
.intro h1 {
  font-family: var(--font-display);
  font-weight: var(--fw-extra);
  font-size: var(--text-5xl);
  line-height: 1.05;
  color: var(--bzs-navy);
  letter-spacing: -0.02em;
  margin: 0 auto;
  max-width: 22ch;
}
.intro h1 .headline-line { display: block; }
.intro p {
  color: var(--fg-muted);
  font-size: var(--text-lg);
  line-height: 1.55;
  max-width: 52ch;
  margin: 18px auto 0;
}
.intro .meta-row {
  display: flex; justify-content: center; gap: 26px; flex-wrap: wrap;
  margin: 28px 0 30px;
}
.intro .meta-item {
  display: flex; align-items: center; gap: 9px;
  font-size: var(--text-sm); color: var(--fg-muted); font-weight: var(--fw-medium);
}
.intro .meta-item i { color: var(--accent-deep); font-size: 15px; }
.intro .start-row { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.intro .btn-primary { font-size: var(--text-lg); padding: 16px 36px; }

/* ── Result screen ──────────────────────────────────────────── */
.result-hero {
  text-align: center;
  padding: 36px 40px 28px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.result-hero .inner { position: relative; }
.result-hero .eyebrow { color: var(--accent-deep); }
.result-hero .ttl {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--text-xl);
  color: var(--bzs-navy); opacity: .92;
  margin-top: 4px;
}
.result-hero .tier-badge {
  display: inline-flex; align-items: center;
  margin-top: 10px;
  background: var(--bzs-neutral-50);
  border: 1px solid var(--border);
  color: var(--bzs-navy);
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--text-sm);
  padding: 6px 14px; border-radius: var(--radius-pill);
}
.result-hero .figure {
  font-family: var(--font-display);
  font-weight: var(--fw-extra);
  font-size: clamp(32px, 6.4vw, 60px);
  line-height: 1.02;
  color: var(--accent-deep);
  letter-spacing: -0.02em;
  margin: 18px 0 6px;
  white-space: nowrap;
}
.result-hero .sub { color: var(--fg-muted); font-size: var(--text-sm); }
.streamline-separator {
  position: relative;
  height: 50px;
  margin-top: 24px;
  background: var(--bzs-navy);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.streamline-separator .pattern {
  position: absolute;
  inset: -4px 0 0;
  opacity: .55;
}
.result-hero .placeholder-tag {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 18px;
  background: var(--bzs-neutral-50);
  color: var(--fg-muted);
  border: 1px solid var(--border);
  font-size: var(--text-xs); font-weight: var(--fw-medium);
  padding: 6px 13px; border-radius: var(--radius-pill);
}

.calc-cta { text-align: center; padding: 44px 40px; }

/* ── Cost breakdown / enterprise note ───────────────────────── */
.breakdown {
  margin-top: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 8px 22px;
}
.breakdown .brow {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-base);
}
.breakdown .brow:last-child { border-bottom: 0; }
.breakdown .brow .bl { color: var(--fg-muted); font-weight: var(--fw-medium); }
.breakdown .brow .bv { color: var(--bzs-navy); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.breakdown .brow.total .bl { color: var(--bzs-navy); font-weight: var(--fw-bold); font-family: var(--font-display); }
.breakdown .brow.total .bv { color: var(--accent-deep); font-weight: var(--fw-bold); font-size: var(--text-lg); }

.ent-note {
  margin-top: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
}
.ent-note .ent-title {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: var(--fw-semibold);
  font-size: var(--text-base); color: var(--bzs-navy);
  margin-bottom: 14px;
}
.ent-note .ent-title i { color: var(--accent-deep); }
.calc-cta h2 {
  font-family: var(--font-display); font-weight: var(--fw-bold);
  font-size: var(--text-3xl); color: var(--bzs-navy); letter-spacing: -0.01em;
}
.calc-cta p { color: var(--fg-muted); font-size: var(--text-base); margin: 12px auto 26px; max-width: 46ch; line-height: 1.5; }
.summary-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 28px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bzs-neutral-50); border: 1px solid var(--border);
  color: var(--fg-muted); font-size: var(--text-xs); font-weight: var(--fw-semibold);
  padding: 7px 13px; border-radius: var(--radius-pill);
}
.chip i { color: var(--accent-deep); font-size: 12px; }

.calc-spin { display: inline-flex; align-items: center; gap: 10px; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Lead form ──────────────────────────────────────────────── */
.lead { margin-top: 24px; }
.lead-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm); padding: 32px 36px;
}
.lead-card h3 { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--text-2xl); color: var(--bzs-navy); }
.lead-card .opt-note { color: var(--fg-subtle); font-size: var(--text-sm); margin-top: 4px; }
.lead-grid { margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.lead-grid .full { grid-column: 1 / -1; }
.consent-copy { color: var(--fg-subtle); font-size: var(--text-sm); line-height: 1.5; margin: 0; }
.form-error {
  margin-top: 16px;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  background: #fef2f2;
  color: #991b1b;
  padding: 12px 14px;
  font-size: var(--text-sm);
}
@media (max-width: 560px) { .lead-grid { grid-template-columns: 1fr; } }

.thanks { text-align: center; padding: 50px 40px; }
.thanks .ok {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin: 0 auto 20px;
}
.thanks h3 { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--text-3xl); color: var(--bzs-navy); }
.thanks p { color: var(--fg-muted); font-size: var(--text-base); margin: 10px auto 0; max-width: 42ch; line-height: 1.5; }

.restart-row { text-align: center; margin-top: 22px; }

/* ── Tweaks panel overrides ─────────────────────────────────── */
.tp-panel, .tweaks-panel { font-family: var(--font-body); }

/* ──────────────────────────────────────────────────────────────
 * Mobile — phones & small tablets (≤640px)
 * ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  /* top bar: tighter padding, save note collapses to its icon */
  .topbar { padding: 14px 16px; }
  .topbar .save-note { gap: 0; }
  .topbar .save-note i { font-size: 15px; }
  .topbar .save-note .note-text {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }

  .stage { padding: 4px 14px 44px; }
  .progress { margin: 12px 2px 22px; }

  /* cards */
  .panel { padding: 26px 18px 24px; border-radius: var(--radius-lg); }
  .sec-head { gap: 12px; }
  .sec-icon { width: 40px; height: 40px; font-size: 17px; border-radius: var(--radius-md); }
  .sec-title { font-size: var(--text-2xl); }
  .sec-blurb { font-size: var(--text-sm); margin-top: 10px; }
  .q-list { margin-top: 22px; gap: 24px; }
  .q-label { font-size: var(--text-base); }
  .opt { padding: 14px; gap: 12px; }
  .segmented-slider {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: var(--radius-lg);
  }
  .segment {
    border-radius: var(--radius-md);
    min-height: 38px;
    padding: 8px;
  }

  /* footer nav: stack with the primary action on top, everything full-width */
  .nav { margin-top: 20px; flex-direction: column-reverse; align-items: stretch; gap: 10px; }
  .nav .spacer { display: none; }
  .nav .btn { width: 100%; justify-content: center; }
  .nav .btn-link { width: 100%; text-align: center; padding: 10px 6px; }

  /* intro: fluid headline, stacked meta list, full-width CTA */
  .intro { padding: 34px 20px 30px; }
  .intro h1 { font-size: clamp(1.75rem, 7.6vw, var(--text-5xl)); line-height: 1.12; }
  .intro p { font-size: var(--text-base); margin-top: 14px; }
  .intro .meta-row {
    flex-direction: column; align-items: center;
    gap: 12px; margin: 24px 0 26px;
  }
  .intro .meta-item { text-align: left; }
  .intro .btn-primary { width: 100%; justify-content: center; font-size: var(--text-base); padding: 15px 24px; }

  /* result screens */
  .result-hero { padding: 26px 18px 20px; }
  .result-hero .figure { white-space: normal; overflow-wrap: break-word; }
  .streamline-separator { height: 42px; margin-top: 18px; }
  .breakdown { padding: 4px 16px; }
  .breakdown .brow { font-size: var(--text-sm); gap: 12px; }
  .breakdown .brow .bv { text-align: right; }
  .calc-cta { padding: 32px 20px 28px; }
  .calc-cta h2 { font-size: var(--text-2xl); }
  .calc-cta .btn-primary { width: 100%; justify-content: center; }
  .summary-chips { margin-bottom: 24px; }
  .ent-note { padding: 18px 16px; }

  /* lead form */
  .lead-card { padding: 24px 18px; }
  .lead-card h3 { font-size: var(--text-xl); }
  .lead-grid { grid-template-columns: 1fr; gap: 14px; margin-top: 18px; }

  /* thank-you */
  .thanks { padding: 38px 20px; }
  .thanks h3 { font-size: var(--text-2xl); }
}

/* ── Extra-small phones (≤420px) ────────────────────────────── */
@media (max-width: 420px) {
  .stage { padding: 2px 12px 40px; }
  .panel { padding: 22px 15px 20px; }
  .btn { padding: 12px 20px; }
  .sec-title { font-size: var(--text-xl); }
  .result-hero .figure { font-size: clamp(26px, 8.6vw, 40px); }
}
