/* The owner's set-up pages: /setup, /setup/done, /setup/child, /setup/phone,
   /setup/phone/simple (plans CHILD-P7A-001, CHILD-P7B-001,
   CHILD-P7D-001; the look of plan CHILD-BUNDLEX-001, row T-W5).
   The pages draw with the kit's parts (bx/components.css: px-page__title,
   px-card, px-row, px-badge, px-button, px-field, px-list) and the notice of
   site.css (noticeHtml). This file holds only what the kit has no part for;
   every colour, size, radius and shadow is a token of bx/tokens.css (--bx-*) or
   bx/components.css (--px-space-*). One column that fits a 320 px screen. */

.su-page,
.sp-view,
.sw-view,
.sw-qr-part {
  display: flex;
  flex-direction: column;
  gap: var(--px-space-base);
  min-width: 0;
}

/* plan CHILD-BUNDLEX-002, T-W5 (v4/web/w2b3.css 20, 59 to 62, 83, 85 to 87,
   134): one plain line of what to do, a full-width button, the one card of
   a form */
.su-say {
  margin: 0;
  font-size: var(--bx-font-size-body);
  line-height: var(--bx-line-height-body);
  color: rgb(var(--bx-color-text));
}

.su-wide {
  width: 100%;
  min-height: 2.75rem;
}

/* CHILD-BUGS-029 DP: the buttons of a set-up page stand in a site.css
   .cl-actions row (one under the other on a phone, at the end on a computer) */

/* a list row that is a link: the chevron at its end, the text wraps (its size is the shared .px-row rule of
   site.css, CHILD-BUGS-021 D5) */
a.px-row:hover {
  background: rgb(var(--bx-color-bg-surface-hover));
}

a.px-row:focus-visible {
  outline: var(--bx-focus-ring-width) solid rgb(var(--bx-color-border-focus));
  outline-offset: -2px;
}

.px-row > .px-badge {
  flex: none;
}

/* CHILD-FEEDBACK-003 (D10): the step line of the four set-up steps, "Step N of 4" over the kit's progress bar;
   the bar's width is the kit's --value, set by the class cl-step--N (never a style attribute) */
.cl-step {
  display: flex;
  flex-direction: column;
  gap: var(--px-space-small-300);
}

.cl-step__of {
  margin: 0;
  font-size: var(--bx-font-size-small);
  line-height: var(--bx-line-height-small);
  color: rgb(var(--bx-color-text-secondary));
}

/* CHILD-UXHUNT-001 M-15 (MB-9): the bar's track shows on the grey phone page
   too: the kit's border colour behind the black part */
.cl-step__bar {
  background: rgb(var(--bx-color-border));
}

.cl-step--1 { --value: 25%; }
.cl-step--2 { --value: 50%; }
.cl-step--3 { --value: 75%; }
.cl-step--4 { --value: 100%; }

/* CHILD-FEEDBACK-003 (D9): the one way on /setup/phone, its QR part under the numbered lines */
.sp-get-app {
  display: flex;
  flex-direction: column;
  gap: var(--px-space-base);
}

.su-chev {
  flex: none;
  display: inline-flex;
  color: rgb(var(--bx-color-icon-secondary));
}

.su-line .px-row__title,
.su-line .px-row__sub,
.sw-way .px-row__title,
.sw-way .px-row__sub {
  overflow-wrap: anywhere;
}

.su-av {
  width: 2rem;
  height: 2rem;
  flex: none;
  border-radius: 50%;
}

/* a box of text in a card */
.su-box {
  display: flex;
  flex-direction: column;
  gap: var(--px-space-small-300);
}

/* the big round mark of a state (paired, ended, done) */
.sp-mark {
  display: flex;
  justify-content: center;
  margin-top: var(--px-space-small-200);
}

.su-mark {
  width: 4rem;
  height: 4rem;
  flex: none;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgb(var(--bx-color-bg-surface-selected));
  color: rgb(var(--bx-color-icon-secondary));
}

.su-mark--ok {
  background: rgb(var(--bx-color-bg-fill-success-secondary));
  color: rgb(var(--bx-color-icon-success));
}

.su-mark--am {
  background: rgb(var(--bx-color-bg-fill-caution-secondary));
  color: rgb(var(--bx-color-icon-caution));
}

.su-mark--bad {
  background: rgb(var(--bx-color-bg-fill-critical-secondary));
  color: rgb(var(--bx-color-icon-critical));
}

.sp-center {
  text-align: center;
}

/* the 8 avatars (a05): four a line, radio buttons drawn as tiles */
.avgrid {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.avgrid > .px-label {
  display: block;
  margin-bottom: var(--px-space-small-200);
  padding: 0;
}

.avgrid-in {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--px-space-small-200);
}

.avt {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--px-space-small-400);
  min-width: 0;
  min-height: 2.75rem;
  padding: var(--px-space-small-200) var(--px-space-small-400);
  border-radius: var(--bx-radius-card);
  background: rgb(var(--bx-color-bg-surface));
  box-shadow: var(--bx-shadow-card);
  cursor: pointer;
}

.avt input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.avt img {
  width: 3.5rem;
  height: 3.5rem;
  max-width: 100%;
}

/* CHILD-UXHUNT-001 D-25 (B-25): the picture's name under it, small */
.avt__name {
  max-width: 100%;
  font-size: var(--bx-font-size-small);
  line-height: var(--bx-line-height-small);
  color: rgb(var(--bx-color-text-secondary));
  text-align: center;
  overflow-wrap: anywhere;
}

.avt:has(input:checked) .avt__name {
  color: rgb(var(--bx-color-text));
  font-weight: var(--bx-font-weight-medium);
}

.avt:has(input:checked) {
  background: rgb(var(--bx-color-bg-surface-selected));
  box-shadow: inset 0 0 0 var(--bx-focus-ring-width) rgb(var(--bx-color-border-focus));
}

.avt:has(input:focus-visible) {
  outline: var(--bx-focus-ring-width) solid rgb(var(--bx-color-border-focus));
  outline-offset: 1px;
}

/* the pairing code (a06c) */
.sp-code {
  margin: 0;
  font-size: var(--bx-font-size-display);
  line-height: var(--bx-line-height-display);
  font-weight: var(--bx-font-weight-bold);
  letter-spacing: .25rem;
  font-variant-numeric: tabular-nums;
  color: rgb(var(--bx-color-text));
  overflow-wrap: anywhere;
}

.sp-left {
  margin: var(--px-space-small-300) 0 0;
}

.sw-list {
  overflow-wrap: anywhere;
}

/* the app link in one input box, the Copy button at its right */
.sw-link-row {
  display: flex;
  align-items: center;
  gap: var(--px-space-small-200);
  width: 100%;
  min-width: 0;
}

.sw-link-row[hidden] {
  display: none;
}

.sw-link {
  flex: 1 1 auto;
  min-width: 0;
  text-overflow: ellipsis;
}

.sw-copy {
  flex: 0 0 auto;
  white-space: nowrap;
}


/* the QR code: a white box at least 240 px wide, never wider than the screen */
.sw-qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--px-space-small);
}

.sw-qr {
  width: 100%;
  min-width: min(15rem, 100%);
  max-width: 21.25rem;
  padding: var(--px-space-small-200);
  background: rgb(var(--bx-color-bg-surface));
}

.sw-qr svg {
  display: block;
  width: 100%;
  height: auto;
}

.sw-left {
  margin: 0;
  font-weight: var(--bx-font-weight-semibold);
  text-align: center;
}

.sw-download {
  align-self: stretch;
}

.sw-ended {
  display: flex;
  flex-direction: column;
  gap: var(--px-space-small-200);
}

/* The parent code page (plan CHILD-OWNER-1118, D8; DESIGN.md section 5,
   snapshots/plan/CHILD-OWNER-1118/design/new.css block T-A5). The line under
   the title of the Confirm step is the kit's px-paragraph px-text--subdued. */
/* the account row of the Confirm step: the initial (site.css .cl-acct__av),
   name and email, then the Google button; the button goes under the row on a
   phone, at its end from 900 px */
.pc-who {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--px-space-small);
  padding: var(--px-space-base);
  min-width: 0;
}

.pc-who__text {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.pc-who__text b,
.pc-who__text small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-who__text b {
  font-weight: var(--bx-font-weight-medium);
}

.pc-who__text small {
  font-size: var(--bx-font-size-small);
  line-height: var(--bx-line-height-small);
  color: rgb(var(--bx-color-text-secondary));
}

.pc-who > .pc-google {
  flex: 1 0 100%;
}

/* the Google button: the kit's button with Google's own G mark (the brand
   mark keeps its own colours); 18 px is Google's mark size, no token */
.pc-google {
  gap: var(--px-space-small-200);
}

.pc-google > svg {
  width: 1.125rem;
  height: 1.125rem;
}

/* the code step: the two fields side by side from 900 px, one under the
   other on a phone */
.pc-fields {
  display: grid;
  gap: var(--px-space-base);
  min-width: 0;
}

/* the code itself, centred with wide letter spacing (.5rem follows settings.css
   .st-code); CHILD-BUGS-021 D14: the kit's field height and body size
   (bundlex-ui tokens.css:276, 277) */
/* CHILD-BUGS-029 DI (gap 4): the kit field's text size, 16 px on a phone, so
   the phone does not zoom the page when the field gets focus */
.px-input.pc-code {
  font-size: var(--bx-font-size-input);
  line-height: var(--bx-line-height-body);
  letter-spacing: .5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.px-input.pc-code::placeholder {
  color: rgb(var(--bx-color-icon-secondary) / .5);
}

@media (min-width: 900px) {
  .pc-who > .pc-google {
    flex: none;
  }

  .pc-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* CHILD-UXHUNT-001 D-5: from the width where the left menu shows, a set-up
     button is as wide as its words, at the end of the card's column; the
     phone keeps the full-width buttons above */
  .su-wide {
    width: auto;
    align-self: flex-end;
  }
}

/* CHILD-UX-005 (s40, s41): the big check card; its row under the check with
   the card's own hairline */
.su-mark-card > .cl-list {
  border-top: 1px solid rgb(var(--bx-color-border-section));
}

/* "2 of 4 done" in the kit's bold, as the sketch draws it (the big check's
   heading takes site.css .cl-mark h2) */
#su-progress .cl-gist__t {
  font-weight: var(--bx-font-weight-bold);
}

/* CHILD-UX-005 (s42, s58): "Your code" over the large code; the three steps
   and the QR fold in their own cards */
.pp-zalo .zl-code-of {
  margin: 0;
  color: rgb(var(--bx-color-text-secondary));
}
