/* ==========================================================================
   Como funciona — 4 passos com tela fixa (desktop) ou alternância (celular)
   Cada etapa tem uma tela ilustrativa com dados fictícios. As animações só
   tocam na etapa ativa; o estado padrão é o final (movimento reduzido/sem JS).
   ========================================================================== */

.onb {
  position: relative;
  isolation: isolate;
  background: linear-gradient(180deg, #f4f8fc 0%, #eaf3fb 100%);
}

.onb > .container {
  display: grid;
  gap: clamp(32px, 5vw, 56px);
  padding-block: clamp(72px, 10vw, 120px);
}

.onb-head {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}

.onb-head h2 em {
  font-style: normal;
  color: var(--action);
}

.onb-head p {
  max-width: 34em;
  font-size: 1.0625rem;
}

.onb-layout {
  --stage-h: 560px;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

/* ---------- Passos ---------- */
.onb-track {
  --onb-p: 0;
  position: relative;
}

.onb-steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.onb-step {
  display: flex;
  align-items: center;
  min-height: 62vh;
}

.onb-step-btn {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  opacity: 0.42;
  transition: opacity 0.5s var(--ease-out);
}

.onb-step-btn:hover,
.onb-step.is-active .onb-step-btn {
  opacity: 1;
}

.onb-num {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #cfe0ef;
  font: 800 1rem/1 var(--f-display);
  color: var(--ink-2);
  transition: background-color 0.45s, border-color 0.45s, color 0.45s, box-shadow 0.45s, transform 0.45s var(--ease-out);
}

.onb-step.is-active .onb-num {
  background: var(--action);
  border-color: var(--action);
  color: #fff;
  box-shadow: 0 0 0 8px rgba(33, 108, 169, 0.12);
  transform: scale(1.06);
}

.onb-step.is-done .onb-num {
  border-color: var(--action);
  color: var(--action);
}

.onb-step-copy {
  display: grid;
  gap: 8px;
  padding-top: 8px;
}

.onb-step-title {
  font: 800 clamp(1.4rem, 1rem + 1.2vw, 1.9rem)/1.15 var(--f-display);
  letter-spacing: -0.02em;
  color: var(--ink);
}

.onb-step-text {
  max-width: 24em;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-2);
}

/* Trilho de progresso */
.onb-rail {
  position: absolute;
  left: 27px;
  top: var(--rail-top, 0);
  height: var(--rail-h, 100%);
  width: 2px;
  background: #d5e4f1;
}

.onb-rail i {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--brand-blue), var(--action));
  transform: scaleY(var(--onb-p));
  transform-origin: 50% 0;
}

/* ---------- Tela ---------- */
.onb-stage {
  position: sticky;
  top: max(calc(var(--header-h) + 16px), calc((100vh + var(--header-h) - var(--stage-h)) / 2));
  height: var(--stage-h);
}

.onb-stage-inner {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 32px;
  background:
    radial-gradient(circle at 80% 15%, rgba(83, 160, 221, 0.45), transparent 50%),
    radial-gradient(circle at 10% 90%, rgba(249, 182, 85, 0.25), transparent 45%),
    var(--deep-800);
  box-shadow: 0 40px 90px rgba(12, 36, 64, 0.25);
}

.onb-stage-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 50%, #000 30%, transparent 75%);
}

.onb-watermark {
  position: absolute;
  right: 28px;
  bottom: -30px;
  font: 800 12rem/1 var(--f-display);
  letter-spacing: -0.05em;
  color: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.onb-watermark.is-changing {
  animation: onb-mark 0.6s var(--ease-out);
}

@keyframes onb-mark {
  from { opacity: 0; transform: translateY(30px); }
}

.onb-tag {
  position: absolute;
  z-index: 2;
  top: 20px;
  left: 22px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #c3d7ea;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.onb-view {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 64px 48px 48px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(26px) scale(0.97);
  transition: opacity 0.55s var(--ease-out), transform 0.7s var(--ease-out), visibility 0s 0.55s;
}

.onb-view.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0.12s, 0.12s, 0s;
}

/* Janela */
.onb-win {
  width: min(440px, 100%);
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.onb-win-top {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.onb-win-top i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d5e2ee;
}

.onb-win-top span {
  margin-left: 8px;
  font-size: 0.75rem;
  color: var(--ink-3);
}

.onb-win-body {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.onb-win-title {
  font: 800 1.25rem/1.2 var(--f-display);
}

.onb-field {
  display: grid;
  gap: 5px;
}

.onb-field small {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-3);
}

.onb-field > span {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
}

.onb-type {
  display: inline-block;
}

.onb-select {
  justify-content: space-between;
}

.onb-select::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: 8px;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg) translateY(-3px);
}

.onb-grid2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
}

.onb-submit {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 46px;
  border-radius: 999px;
  background: var(--action);
  color: #fff;
  font-weight: 700;
  font-size: 0.9375rem;
}

.onb-submit > span {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.onb-submit-idle {
  opacity: 0;
}

.onb-submit svg {
  width: 16px;
  height: 16px;
}

.onb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.onb-chips span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 0.75rem;
  font-weight: 700;
}

.onb-chips svg {
  width: 12px;
  height: 12px;
}

/* Endereço próprio */
.onb-address {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eef6fd, #fdf5e8);
  border: 1px solid #d9e8f4;
}

.onb-address-ico {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #fff;
  color: var(--action);
}

.onb-address-ico svg {
  width: 17px;
  height: 17px;
}

.onb-address-url {
  font-size: 0.9375rem;
  color: var(--ink-2);
  overflow-wrap: break-word;
}

.onb-address-url b {
  color: var(--action);
}

.onb-address-ok {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ok);
}

.onb-address-ok svg {
  width: 12px;
  height: 12px;
}

/* Assistente */
.onb-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
}

.onb-progress b {
  font-variant-numeric: tabular-nums;
  color: var(--action);
}

.onb-progress i {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
}

.onb-progress em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-blue), var(--action));
  transform-origin: 0 50%;
}

.onb-checklist {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.onb-checklist li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 0.9375rem;
  font-weight: 600;
}

.onb-checklist em {
  font-style: normal;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-3);
}

.onb-tick {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
}

.onb-tick svg {
  width: 13px;
  height: 13px;
}

.onb-tick--blue {
  background: var(--action);
}

/* Painel em uso */
.onb-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.onb-kpis span {
  display: grid;
  gap: 2px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 0.75rem;
  color: var(--ink-3);
}

.onb-kpis b {
  font: 800 1.5rem/1 var(--f-display);
  color: var(--ink);
}

.onb-spark {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 90px;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f3f8fd, #eaf3fb);
}

.onb-spark i {
  flex: 1;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--brand-blue), #3d8ccc);
  transform: scaleY(var(--h));
  transform-origin: 50% 100%;
}

.onb-spark i:last-child {
  background: linear-gradient(180deg, var(--brand-orange), #f0a23a);
}

.onb-toast {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  font-size: 0.8125rem;
}

.onb-toast > span:last-child {
  display: grid;
  color: var(--ink-3);
}

.onb-toast b {
  color: var(--ink);
  font-size: 0.875rem;
}

.onb-toast--1 {
  right: 22px;
  bottom: 76px;
}

.onb-toast--2 {
  left: 22px;
  bottom: 26px;
}

/* ---------- Animações da etapa ativa ---------- */
@media (prefers-reduced-motion: no-preference) {
  .is-active .onb-field {
    animation: onb-rise 0.5s var(--ease-out) both;
    animation-delay: calc(var(--d) * 0.7s + 0.25s);
  }

  .is-active .onb-type {
    animation: onb-type calc(var(--n) * 40ms + 200ms) steps(var(--n), jump-start) both;
    animation-delay: calc(var(--d) * 0.7s + 0.45s);
  }

  .is-active .onb-submit-idle {
    animation: onb-out 0.3s ease both;
    animation-delay: 2.7s;
  }

  .is-active .onb-submit {
    animation: onb-press 0.35s ease 2.55s;
  }

  .is-active .onb-submit-done {
    animation: onb-pop 0.45s var(--ease-out) both;
    animation-delay: 2.8s;
  }

  .is-active .onb-chips span {
    animation: onb-rise 0.45s var(--ease-out) both;
  }

  .is-active .onb-chips span:nth-child(1) { animation-delay: 3.1s; }
  .is-active .onb-chips span:nth-child(2) { animation-delay: 3.25s; }

  .is-active .onb-field .onb-select {
    animation: onb-rise 0.4s var(--ease-out) both;
    animation-delay: 1.15s;
  }

  .is-active .onb-address {
    animation: onb-pop 0.55s var(--ease-out) both;
    animation-delay: 2.6s;
  }

  .is-active .onb-address-ok {
    animation: onb-rise 0.4s var(--ease-out) both;
    animation-delay: 3.1s;
  }

  .is-active .onb-progress em {
    animation: onb-fill 2.6s cubic-bezier(0.5, 0, 0.3, 1) both;
    animation-delay: 0.3s;
  }

  .is-active .onb-checklist li {
    animation: onb-rise 0.45s var(--ease-out) both;
    animation-delay: calc(var(--d) * 0.5s + 0.3s);
  }

  .is-active .onb-checklist .onb-tick {
    animation: onb-pop 0.4s var(--ease-out) both;
    animation-delay: calc(var(--d) * 0.5s + 0.65s);
  }

  .is-active .onb-kpis span {
    animation: onb-rise 0.5s var(--ease-out) both;
    animation-delay: calc(var(--d) * 0.15s + 0.3s);
  }

  .is-active .onb-spark i {
    animation: onb-grow 0.8s var(--ease-out) both;
  }

  .is-active .onb-spark i:nth-child(1) { animation-delay: 0.7s; }
  .is-active .onb-spark i:nth-child(2) { animation-delay: 0.76s; }
  .is-active .onb-spark i:nth-child(3) { animation-delay: 0.82s; }
  .is-active .onb-spark i:nth-child(4) { animation-delay: 0.88s; }
  .is-active .onb-spark i:nth-child(5) { animation-delay: 0.94s; }
  .is-active .onb-spark i:nth-child(6) { animation-delay: 1s; }
  .is-active .onb-spark i:nth-child(7) { animation-delay: 1.06s; }

  .is-active .onb-toast {
    animation: onb-toast 0.6s var(--ease-out) both;
  }

  .is-active .onb-toast--1 { animation-delay: 1.5s; }
  .is-active .onb-toast--2 { animation-delay: 2.3s; }
}

@keyframes onb-rise {
  from { opacity: 0; transform: translateY(10px); }
}

@keyframes onb-pop {
  from { opacity: 0; transform: scale(0.85); }
}

@keyframes onb-out {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes onb-press {
  50% { transform: scale(0.96); }
}

@keyframes onb-type {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 -2px 0 0); }
}

@keyframes onb-fill {
  from { transform: scaleX(0); }
}

@keyframes onb-grow {
  from { transform: scaleY(0); }
}

@keyframes onb-toast {
  from { opacity: 0; transform: translateY(16px) scale(0.92); }
}

/* ---------- CTA ---------- */
.onb-cta {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

/* ---------- Celular e tablet: tela acima, alternância automática ---------- */
@media (max-width: 999px) {
  .onb-layout {
    --stage-h: 460px;
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .onb-stage {
    position: relative;
    top: auto;
    order: -1;
  }

  .onb-step {
    min-height: 0;
    padding: 0 0 22px;
  }

  .onb-step:last-child {
    padding-bottom: 0;
  }

  .onb-step-btn {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 16px;
  }

  .onb-num {
    width: 44px;
    height: 44px;
    font-size: 0.875rem;
  }

  .onb-rail {
    left: 21px;
  }

  .onb-rail i {
    transition: transform 0.6s var(--ease-out);
  }

  .onb-step-copy {
    padding-top: 2px;
  }

  .onb-step-title {
    font-size: 1.25rem;
  }

  .onb-step-text {
    font-size: 0.9375rem;
  }
}

@media (max-width: 600px) {
  .onb-layout {
    --stage-h: 540px;
  }

  .onb-tag {
    top: 14px;
    left: 14px;
  }

  .onb-address-url {
    font-size: 0.8125rem;
  }

  .onb-stage-inner {
    border-radius: 24px;
  }

  .onb-view {
    padding: 52px 14px 18px;
  }

  .onb-win-body {
    padding: 16px;
    gap: 11px;
  }

  .onb-watermark {
    font-size: 8rem;
  }

  .onb-toast {
    padding: 10px 12px;
  }

  .onb-toast--1 {
    right: 10px;
    bottom: 70px;
  }

  .onb-toast--2 {
    left: 10px;
    bottom: 16px;
  }

  .onb-kpis b {
    font-size: 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .onb-view,
  .onb-step-btn,
  .onb-num,
  .onb-rail i {
    transition: none;
  }

  .onb-submit-idle {
    opacity: 0;
  }

  .onb-watermark.is-changing {
    animation: none;
  }
}
