/* The product demonstrations (see demo.js). Self-contained, so the same file works on
   the React pages and on the static pages in public/. */

.bld {
  --bld-brand: #102866;
  --bld-fg: #111318;
  --bld-muted: #5b6472;
  --bld-border: #e3e6ec;
  --bld-tint: #f4f6fa;
  --bld-ok: #166534;
  --bld-ok-bg: #e7f6ec;
  --bld-warn: #92400e;
  --bld-warn-bg: #fdf1d7;
  container-type: inline-size;
  display: block;
  width: 100%;
  font-family:
    "Geist",
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  color: var(--bld-fg);
  text-align: left;
  /* Room for the demo before the script has drawn it, so the page doesn't jump. */
  min-height: 26rem;
}

.bld[data-mounted] {
  min-height: 0;
}

.bld button {
  font-family: inherit;
  line-height: 1.3;
  cursor: pointer;
}

/* Package tabs (home page) */

.bld__tabs {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  margin-bottom: 0.875rem;
  border: 1px solid var(--bld-border);
  border-radius: 999px;
  background: #fff;
}

.bld__tab {
  padding: 0.4375rem 1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bld-muted);
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.bld__tab:hover {
  color: var(--bld-fg);
}

.bld__tab.is-active {
  background: var(--bld-brand);
  color: #fff;
}

/* Step list */

.bld__steps {
  display: flex;
  gap: 0.375rem;
  margin: 0 0 0.875rem;
  padding: 0 0 0.25rem;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.bld__steps::-webkit-scrollbar {
  display: none;
}

.bld__steps li {
  flex: none;
  margin: 0;
  padding: 0;
}

.bld__steps li::before {
  content: none;
}

.bld__step {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem 0.375rem 0.375rem;
  border: 1px solid var(--bld-border);
  border-radius: 999px;
  background: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--bld-muted);
  white-space: nowrap;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background-color 0.2s ease;
}

.bld__step:hover {
  color: var(--bld-fg);
  border-color: #c5cad4;
}

.bld__step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 999px;
  background: var(--bld-tint);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--bld-muted);
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.bld__step.is-done .bld__step-n {
  background: rgba(16, 40, 102, 0.12);
  color: var(--bld-brand);
}

.bld__step.is-active {
  border-color: var(--bld-brand);
  color: var(--bld-brand);
}

.bld__step.is-active .bld__step-n {
  background: var(--bld-brand);
  color: #fff;
}

/* The compact variant (home page hero) shows only the numbers. */

.bld[data-variant="compact"] .bld__step {
  padding: 0.25rem;
}

.bld[data-variant="compact"] .bld__step span:last-child {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Window */

.bld__window {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--bld-border);
  border-radius: 1rem;
  background: #fff;
  box-shadow:
    0 30px 60px -30px rgba(16, 40, 102, 0.35),
    0 10px 20px -12px rgba(16, 40, 102, 0.12);
}

.bld__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--bld-border);
  background: var(--bld-tint);
}

.bld__dots {
  display: inline-flex;
  gap: 0.3125rem;
}

.bld__dots i {
  width: 0.5625rem;
  height: 0.5625rem;
  border-radius: 999px;
  background: #cfd4dd;
}

.bld__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bld__tag {
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--bld-border);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--bld-muted);
}

.bld__toggle {
  position: relative;
  width: 1.75rem;
  height: 1.75rem;
  flex: none;
  border: 1px solid var(--bld-border);
  border-radius: 999px;
  background: #fff;
}

/* Pause icon: two bars. Play icon: a triangle. */
.bld__toggle::before,
.bld__toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0.1875rem;
  height: 0.625rem;
  border-radius: 1px;
  background: var(--bld-fg);
  transform: translateY(-50%);
}

.bld__toggle::before {
  left: calc(50% - 0.3125rem);
}

.bld__toggle::after {
  left: calc(50% + 0.125rem);
}

.bld__toggle.is-paused::before {
  left: calc(50% - 0.1875rem);
  width: 0;
  height: 0;
  border-radius: 0;
  background: transparent;
  border-style: solid;
  border-width: 0.3125rem 0 0.3125rem 0.5rem;
  border-color: transparent transparent transparent var(--bld-fg);
}

.bld__toggle.is-paused::after {
  content: none;
}

.bld__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.bld__list {
  padding: 0.875rem;
  border-bottom: 1px solid var(--bld-border);
}

.bld__list-title,
.bld__panel-step,
.bld-card__label {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bld-muted);
}

.bld-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.625rem;
  border: 1px solid transparent;
  border-radius: 0.625rem;
}

.bld-row.is-focus {
  border-color: var(--bld-border);
  background: var(--bld-tint);
}

.bld-row__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bld-row__name {
  overflow: hidden;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bld-row__meta {
  font-size: 0.75rem;
  color: var(--bld-muted);
}

.bld-status {
  flex: none;
  padding: 0.1875rem 0.5625rem;
  border-radius: 999px;
  background: var(--bld-tint);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--bld-muted);
  white-space: nowrap;
}

.bld-row.is-focus .bld-status {
  background: #fff;
}

.bld-status--brand,
.bld-row.is-focus .bld-status--brand {
  background: rgba(16, 40, 102, 0.1);
  color: var(--bld-brand);
}

.bld-status--ok,
.bld-row.is-focus .bld-status--ok {
  background: var(--bld-ok-bg);
  color: var(--bld-ok);
}

.bld-status--warn,
.bld-row.is-focus .bld-status--warn {
  background: var(--bld-warn-bg);
  color: var(--bld-warn);
}

/* On narrow screens the list shows only the row the panel is about. */
.bld-row:not(.is-focus) {
  display: none;
}

.bld__panel {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  min-height: 17rem;
  padding: 0.875rem;
}

.bld__panel.is-in > * {
  animation: bld-in 0.45s ease both;
}

.bld__panel.is-in > *:nth-child(2) {
  animation-delay: 0.06s;
}

.bld__panel.is-in > *:nth-child(3) {
  animation-delay: 0.12s;
}

.bld__panel.is-in > *:nth-child(4) {
  animation-delay: 0.18s;
}

@keyframes bld-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.bld__panel-step {
  margin: 0;
  color: var(--bld-brand);
}

.bld-card {
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--bld-border);
  border-radius: 0.75rem;
  background: #fff;
}

.bld-card--ok {
  border-color: #bfe3ca;
  background: #f4fbf6;
}

.bld-card--warn {
  border-color: #f1d9a0;
  background: #fffaf0;
}

.bld-card--warn .bld-card__label {
  color: var(--bld-warn);
}

.bld-card--ok .bld-card__label {
  color: var(--bld-ok);
}

.bld-text,
.bld-note {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.bld-text--strong {
  font-weight: 700;
}

.bld-note {
  color: var(--bld-muted);
}

.bld-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.bld-chip {
  padding: 0.1875rem 0.5625rem;
  border-radius: 999px;
  background: rgba(16, 40, 102, 0.08);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bld-brand);
}

.bld-checks {
  display: grid;
  gap: 0.375rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bld-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  font-size: 0.8125rem;
}

.bld-check::before {
  content: none;
}

.bld-check__icon {
  position: relative;
  width: 1rem;
  height: 1rem;
  flex: none;
  border-radius: 999px;
  border: 1.5px solid #c5cad4;
}

.bld-check--ok .bld-check__icon {
  border-color: var(--bld-ok);
  background: var(--bld-ok);
}

.bld-check--ok .bld-check__icon::after {
  content: "";
  position: absolute;
  left: 0.3125rem;
  top: 0.125rem;
  width: 0.25rem;
  height: 0.5rem;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.bld-check--warn {
  font-weight: 600;
  color: var(--bld-warn);
}

.bld-check--warn .bld-check__icon {
  border-color: #d97706;
  background: #d97706;
}

.bld-check--warn .bld-check__icon::after {
  content: "!";
  position: absolute;
  inset: 0;
  font-size: 0.6875rem;
  font-weight: 800;
  line-height: 0.8125rem;
  text-align: center;
  color: #fff;
}

.bld-kv {
  display: grid;
  gap: 0.375rem;
  margin: 0;
}

.bld-kv div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8125rem;
}

.bld-kv dt {
  color: var(--bld-muted);
}

.bld-kv dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.bld-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.625rem;
}

.bld-btn {
  padding: 0.3125rem 0.75rem;
  border: 1px solid var(--bld-brand);
  border-radius: 999px;
  background: var(--bld-brand);
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
}

.bld-btn--ghost {
  background: #fff;
  color: var(--bld-brand);
}

/* Progress towards the next step */

.bld__progress {
  height: 2px;
  background: var(--bld-border);
}

.bld__progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--bld-brand);
}

.bld__progress.is-running span {
  animation: bld-progress linear both;
}

@keyframes bld-progress {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.bld__caption {
  min-height: 2.75rem;
  margin: 0.875rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--bld-muted);
}

/* Wide enough for the list and the panel side by side */

@container (min-width: 30rem) {
  .bld__body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .bld__list {
    border-bottom: 0;
    border-right: 1px solid var(--bld-border);
  }

  .bld-row:not(.is-focus) {
    display: flex;
  }

  .bld__panel {
    min-height: 19rem;
  }

  .bld__caption {
    min-height: 0;
  }
}

.bld button:focus-visible {
  outline: 2px solid var(--bld-brand);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .bld__panel.is-in > *,
  .bld__progress.is-running span {
    animation: none;
  }
}
