/*
 * The walked demo's guide (ticket 0121, partials/demo-guide). Loaded by the partial itself, on the app's screens, the
 * designer and the customer-portal preview alike, so it reads only the tokens (tokens.css is on all three).
 * One white card with a tinted header and the two action roles: Next is the yellow main action with dark text, Back
 * the outlined tertiary. No coloured left border, no frosted glass, no hover lift.
 */
.demo-guide {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  z-index: 1085;
  width: 380px;
  max-width: calc(100vw - 2 * var(--space-4));
  font-family: var(--font-ui);
  color: var(--text);
}

.demo-guide__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--elev-2);
  overflow: hidden;
}

.demo-guide__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--action-tint);
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-12);
  color: var(--text);
}

.demo-guide__count {
  font-weight: 700;
  white-space: nowrap;
}

.demo-guide__demo {
  color: var(--text-muted);
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demo-guide__fold {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  line-height: 1;
}

.demo-guide__fold:hover,
.demo-guide__fold:focus-visible {
  background: var(--surface-sunken);
}

.demo-guide__body {
  padding: var(--space-3) var(--space-4) var(--space-2);
}

.demo-guide .demo-guide__title {
  font-family: var(--font-ui);
  margin: 0 0 var(--space-2);
  font-size: var(--fs-16);
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--text);
}

.demo-guide__caption {
  margin: 0;
  font-size: var(--fs-14);
  line-height: var(--lh);
  color: var(--text);
}

.demo-guide__progress {
  display: flex;
  gap: var(--space-1);
  margin-top: var(--space-3);
}

.demo-guide__dot {
  flex: 1 1 0;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
}

.demo-guide__dot.is-done {
  background: var(--action-2);
}

.demo-guide__dot.is-now {
  background: var(--action);
}

.demo-guide__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4) var(--space-4);
}

.demo-guide__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--fs-14);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}

.demo-guide .demo-guide__actions .demo-guide__btn--next {
  background: var(--action);
  color: var(--on-action);
}

.demo-guide .demo-guide__actions .demo-guide__btn--next:hover,
.demo-guide .demo-guide__actions .demo-guide__btn--next:focus-visible {
  background: var(--action-hover);
  color: var(--on-action);
}

.demo-guide .demo-guide__actions .demo-guide__btn--back {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-control);
}

.demo-guide .demo-guide__actions .demo-guide__btn--back:hover,
.demo-guide .demo-guide__actions .demo-guide__btn--back:focus-visible {
  background: var(--surface-sunken);
  color: var(--text);
}

.demo-guide__open {
  float: right;
  border: 1px solid var(--border);
  background: var(--action);
  color: var(--on-action);
  font-weight: 600;
  font-size: var(--fs-14);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  box-shadow: var(--elev-2);
}

/* A phone: a sheet along the bottom, and room left under the page so nothing is hidden behind it */
@media (max-width: 575.98px) {
  .demo-guide {
    left: var(--space-2);
    right: var(--space-2);
    bottom: var(--space-2);
    width: auto;
    max-width: none;
  }

  .demo-guide__body {
    padding: var(--space-2) var(--space-3) var(--space-1);
  }

  .demo-guide__caption {
    font-size: var(--fs-14);
  }

  .demo-guide__actions {
    padding: var(--space-2) var(--space-3) var(--space-3);
  }

  .demo-guide__btn {
    flex: 1 1 0;
  }

  body.has-demo-guide {
    padding-bottom: 240px;
  }
}

@media (min-width: 576px) {
  body.has-demo-guide {
    padding-bottom: 200px;
  }
}

/* The demo's own pages: the crew's phone and the last step */
.demo-phone {
  width: 300px;
  max-width: 100%;
  margin: 0 auto;
  border: 10px solid var(--text);
  border-radius: 36px;
  background: var(--surface-page);
  color: var(--text);
  overflow: hidden;
  box-shadow: var(--elev-2);
}

.demo-phone__bar {
  background: var(--brand);
  color: var(--on-action-2);
  padding: var(--space-3) var(--space-4);
  font-weight: 700;
  font-size: var(--fs-14);
}

.demo-phone__section {
  background: var(--surface);
  margin: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: var(--fs-14);
}

.demo-phone__label {
  font-size: var(--fs-12);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-1);
}

.demo-phone__check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) 0;
}

.demo-phone__box {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2px solid var(--border-control);
  border-radius: 4px;
  background: var(--surface);
}

.demo-phone__box.is-ticked {
  background: var(--action-2);
  border-color: var(--action-2);
}

.demo-phone__button {
  display: block;
  margin: var(--space-2);
  padding: var(--space-3);
  text-align: center;
  border-radius: var(--radius-sm);
  background: var(--action);
  color: var(--on-action);
  font-weight: 700;
  font-size: var(--fs-14);
}

.demo-door__steps {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-4);
  display: grid;
  gap: var(--space-2);
}

.demo-door__steps li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--fs-14);
}

.demo-door__icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background: var(--action-tint);
  color: var(--text);
}
