/* The install guide (app_installs/show): a big iPhone/Android switch under the title, then the
   steps for the chosen system. The app-install controller swaps the panel shown. */
.app_install {
  /* The desktop modal (show.html+modal): the page's title and description in the wizard's chrome. */
  .app_install_modal_title {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: var(--font-weight-semibold);
  }

  .app_install_modal_description {
    margin: 0 var(--content-padding) var(--content-padding);
    font-size: var(--text-sm);
    color: var(--color-muted);
  }

  .app_install_switch {
    display: flex;
    margin: 0 var(--content-padding) var(--content-padding);
    padding: 4px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
  }

  .app_install_switch_option {
    flex: 1;
    min-height: 56px;
    border: 0;
    border-radius: var(--radius-pill);
    background: none;
    color: var(--color-text-light);
    font: inherit;
    font-size: var(--text-lg);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;

    &[aria-pressed="true"] {
      background: var(--color-bg-white);
      color: var(--color-text);
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    }

    @media (prefers-reduced-motion: reduce) {
      transition: none;
    }
  }

  .app_install_panel {
    padding: 0 var(--content-padding) var(--content-padding);
  }

  .app_install_prompt {
    margin-bottom: var(--content-padding);
  }

  .app_install_button {
    width: 100%;
    min-height: 56px;
    gap: 8px;
  }

  .app_install_prompt_hint {
    margin: 16px 0 0;
    font-size: var(--text-sm);
    color: var(--color-muted);
    text-align: center;
  }

  .app_install_steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .app_install_step {
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .app_install_step_number {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-size: var(--text-lg);
    font-weight: var(--font-weight-bold);
    line-height: 1;
    font-variant-numeric: tabular-nums;
  }

  .app_install_step_text {
    font-size: var(--text-base);
    line-height: var(--line-height-md);
    color: var(--color-text);
  }

  /* A button the step names: its label, and its icon as the phone draws it, on the text's line. */
  .app_install_label {
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
  }

  .app_install_glyph {
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    vertical-align: -0.25em;
    color: var(--color-primary);
  }

  /* The address to type, inline in the step's text, copied on a tap (clipboard controller, which
     adds .copied). The padding widens the tap without moving the text. */
  .app_install_domain {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: -12px -4px;
    padding: 12px 4px;
    border: 0;
    background: none;
    color: var(--color-text);
    font: inherit;
    font-weight: var(--font-weight-semibold);
    vertical-align: baseline;
    cursor: pointer;

    .app_install_domain_copy,
    .app_install_domain_copied {
      width: 1.1em;
      height: 1.1em;
      color: var(--color-primary);
    }

    .app_install_domain_copied {
      display: none;
      color: var(--color-success);
    }

    &.copied {
      .app_install_domain_copy {
        display: none;
      }

      .app_install_domain_copied {
        display: inline-block;
      }
    }
  }

  /* The address's QR code beside it on a computer, in a bubble above and right of its icon (help-tip). Dark on
     white in both themes, or the camera won't read it. */
  .app_install_qr {
    position: relative;
    display: inline-flex;
    margin-left: 6px;
    vertical-align: baseline;
  }

  .app_install_qr_toggle {
    display: inline-flex;
    align-items: center;
    margin: -12px -4px;
    padding: 12px 4px;
    border: 0;
    background: none;
    color: var(--color-primary);
    cursor: pointer;
  }

  .app_install_qr_bubble {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    z-index: var(--z-tooltip);
    width: max-content;
    padding: 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
  }

  /* Sized so the bubble clears the top of the modal's scrolling content above the first step. */
  .app_install_qr_code {
    display: block;
    width: 136px;
    height: 136px;
  }

  /* The closing line, green for what's done. */
  .app_install_done {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 28px;
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--color-success-wash);
    color: var(--color-text);
  }

  .app_install_done_icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: var(--color-success);
  }

  .app_install_done_text {
    margin: 0;
    font-size: var(--text-base);
    line-height: var(--line-height-md);
  }

  .app_install_done_title {
    color: var(--color-success-text);
  }
}
