/* FlowCraft Lead Wizard — catalogue demo styles (extends site.css)
   Mirrors the buyer-delivered Tailwind widget using the site's own tokens,
   so the catalogue pages stay free of the Tailwind CDN.
   Every selector is prefixed .lw- to avoid clashing with the estimator demo. */

.lw {
  position: relative;
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  text-align: left;
}
.lw-frame { border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 20px; }

/* ---------- Header + progress ---------- */
.lw-head { padding: 24px 20px 20px; border-bottom: 1px solid var(--line); }
@media (min-width: 480px) { .lw-head { padding: 28px 28px 22px; } }
.lw-head-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.lw-kicker { margin: 0; font-size: .75rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.lw-count { margin: 0; font-size: .85rem; font-weight: 650; color: var(--ink-muted); white-space: nowrap; }
.lw-title { font-size: 1.35rem; font-weight: 780; letter-spacing: -.02em; margin: 0 0 16px; }

.lw-track { height: 8px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.lw-bar {
  height: 100%; width: 33%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, #8f7bff 100%);
  transition: width .5s cubic-bezier(.22, 1, .36, 1);
}

.lw-markers { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: .8rem; font-weight: 650; }
.lw-markers li { display: flex; align-items: center; gap: 7px; color: #8a93ae; transition: color .3s ease; }
.lw-markers li:nth-child(2) { justify-content: center; }
.lw-markers li:nth-child(3) { justify-content: flex-end; }
.lw-dot {
  display: inline-grid; place-items: center; flex: none;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg-soft); color: var(--ink-muted); font-size: .75rem; font-weight: 750;
  transition: background-color .3s ease, color .3s ease, box-shadow .3s ease;
}
.lw-markers li[data-state="active"] { color: var(--accent-strong); }
.lw-markers li[data-state="active"] .lw-dot { background: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.lw-markers li[data-state="complete"] { color: var(--ink); }
.lw-markers li[data-state="complete"] .lw-dot { background: var(--accent-line); color: var(--accent-strong); }

/* ---------- Body ---------- */
.lw-form { padding: 22px 20px 24px; margin: 0; }
@media (min-width: 480px) { .lw-form { padding: 26px 28px 28px; } }
.lw-step { border: 0; margin: 0; padding: 0; min-width: 0; }
.lw [hidden] { display: none !important; }

.lw-intro { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; background: var(--accent-soft); margin-bottom: 20px; }
.lw-intro-alt { background: #f3f0ff; }
.lw-intro svg { flex: none; width: 56px; height: 56px; }
.lw-intro-title { margin: 0; font-weight: 700; font-size: 1rem; color: var(--ink); }
.lw-intro-text { margin: 0; font-size: .88rem; color: var(--ink-muted); line-height: 1.45; }

.lw-field { margin-bottom: 16px; }
.lw-field:last-child { margin-bottom: 0; }
.lw-label { display: block; margin-bottom: 6px; font-size: .9rem; font-weight: 650; color: #2a3558; }
.lw-control { position: relative; }
.lw-control > svg { position: absolute; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #8a93ae; pointer-events: none; }
.lw-control > svg.lw-lead { left: 12px; }
.lw-control > svg.lw-chev { right: 12px; }
.lw-input {
  display: block; width: 100%; min-height: 46px;
  padding: 10px 12px; border: 1px solid #cdd3e2; border-radius: 10px;
  background: #fff; color: var(--ink); font: inherit; font-size: .95rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.lw-input::placeholder { color: #98a1bb; }
.lw-input.has-lead { padding-left: 40px; }
select.lw-input { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer; }
.lw-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.lw-input[aria-invalid="true"] { border-color: #d1344e; }
.lw-input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px #ffe3e8; }
.lw-error { margin: 6px 0 0; font-size: .84rem; color: #b42339; font-weight: 600; }

.lw-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lw-chip { position: relative; display: block; cursor: pointer; }
.lw-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lw-chip span {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: .9rem; font-weight: 600; color: var(--ink-muted); background: #fff;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.lw-chip svg { flex: none; width: 18px; height: 18px; }
.lw-chip:hover span { border-color: var(--accent-line); }
.lw-chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.lw-chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
[data-invalid-group="true"] .lw-chip span { border-color: #f0a3b1; }

/* ---------- Navigation ---------- */
.lw-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 24px; }
.lw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 16px; border-radius: 10px;
  font: inherit; font-size: .93rem; font-weight: 700; cursor: pointer;
  border: 1.5px solid transparent; transition: background-color .15s ease, border-color .15s ease;
}
.lw-btn svg { width: 16px; height: 16px; flex: none; }
.lw-btn-prev { background: #fff; color: var(--ink); border-color: var(--line); }
.lw-btn-prev:hover { border-color: var(--accent-line); background: #fbfaff; }
.lw-btn-prev.is-hidden { visibility: hidden; }
.lw-btn-next { background: var(--accent); color: #fff; min-width: 116px; }
.lw-btn-next:hover { background: var(--accent-strong); }
.lw-btn:disabled { opacity: .65; cursor: not-allowed; }
.lw-spin { animation: lw-spin .8s linear infinite; }
@keyframes lw-spin { to { transform: rotate(360deg); } }
.lw-demo-note { margin: 12px 0 0; font-size: .78rem; color: var(--ink-muted); line-height: 1.45; text-align: center; }

/* ---------- Success ---------- */
.lw-success { text-align: center; padding: 6px 0 2px; }
.lw-success:focus { outline: none; }
.lw-success > svg { width: 104px; height: 104px; margin: 0 auto; }
.lw-success .lw-success-title { color: var(--ink); font-size: 1.45rem; font-weight: 780; letter-spacing: -.02em; margin: 12px 0 6px; }
.lw-success p { color: var(--ink-muted); font-size: .95rem; margin: 0; }
.lw-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 0; text-align: left; }
.lw-summary div { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.lw-summary dt { font-size: .7rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.lw-summary dd { margin: 3px 0 0; font-weight: 700; font-size: .9rem; color: var(--ink); }
.lw-restart { margin-top: 16px; background: none; border: 0; padding: 6px; font: inherit; font-size: .9rem; font-weight: 700; color: var(--accent); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; border-radius: 6px; }
.lw-restart:hover { color: var(--accent-strong); }
.lw-restart svg { width: 16px; height: 16px; }
.lw-step:not([hidden]) .lw-check { stroke-dasharray: 48; stroke-dashoffset: 48; animation: lw-draw .45s .2s ease-out forwards; }
@keyframes lw-draw { to { stroke-dashoffset: 0; } }

/* ---------- Step transitions (same timings as the buyer widget) ---------- */
@keyframes lw-in-forward  { from { opacity: 0; transform: translateX(24px); }  to { opacity: 1; transform: none; } }
@keyframes lw-in-back     { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes lw-out-forward { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(-24px); } }
@keyframes lw-out-back    { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(24px); } }
@keyframes lw-pop         { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes lw-shake { 0%,100% { transform: none; } 20%,60% { transform: translateX(-4px); } 40%,80% { transform: translateX(4px); } }
.lw-enter-forward { animation: lw-in-forward .28s cubic-bezier(.22, 1, .36, 1) both; }
.lw-enter-back    { animation: lw-in-back .28s cubic-bezier(.22, 1, .36, 1) both; }
.lw-leave-forward { animation: lw-out-forward .18s ease-in both; }
.lw-leave-back    { animation: lw-out-back .18s ease-in both; }
.lw-enter-success { animation: lw-pop .36s cubic-bezier(.22, 1, .36, 1) both; }
.lw-shake { animation: lw-shake .32s ease; }
@media (prefers-reduced-motion: reduce) {
  .lw-bar, .lw-markers li, .lw-dot { transition: none; }
  .lw-enter-forward, .lw-enter-back, .lw-leave-forward, .lw-leave-back, .lw-enter-success, .lw-shake, .lw-spin { animation: none; }
  .lw-step:not([hidden]) .lw-check { animation: none; stroke-dashoffset: 0; }
}

/* Without JavaScript the wizard can't advance; dim it like the estimator demo does. */
html:not(.js-lead-wizard) .lw-form { opacity: .5; pointer-events: none; }

/* ---------- Small screens ---------- */
@media (max-width: 419px) {
  .lw-markers li span:last-child { display: none; }
  .lw-markers li { justify-content: center !important; }
  .lw-intro svg { width: 44px; height: 44px; }
  .lw-chip span { font-size: .84rem; padding: 10px 9px; gap: 6px; }
  .lw-summary { grid-template-columns: 1fr; }
}
@media (max-width: 479px) {
  #lead-wizard .product-head { padding: 24px 14px; }
}

/* Code sample colours used on the Lead Wizard demo page */
.code-card .s { color: #ffd28a; }
.code-card .c { color: #8792b8; }
