/* Action row (brandbook "Action row"): the end of every confirmation. The
   action first, the way back second. Narrower than 480 px (a phone, a narrow
   card or dialog): the action spans the row, the text action sits centred
   under it, 4 px apart. 480 px and wider: side by side, 12 px apart, wrapping
   and never truncating.

   The width the row follows is its frame's: .mm-action-frame, a block
   around the row that holds nothing else, is the query container. A card,
   a dialog or the page column cannot be one, since containment makes an
   element the containing block of fixed descendants, and the term
   explanations (tooltip.css) are fixed at viewport coordinates. In a dialog
   the button pane is the frame (dialogs.css).

   ActionRow puts .mm-action-row on $form['actions'], or on
   $form['form_button_group']['actions'] where the module wraps the actions
   in .form-button-group (login, password, register, profile, TFA), and
   renders it through templates/form/container--action-row.html.twig, which
   emits the frame; both shapes lay out the same. A template that writes an
   action row by hand wraps it in <div class="mm-action-frame"> too. */
.mm-action-frame {
  container-type: inline-size;
}

.mm-action-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--mm-space-1);
  margin-top: var(--mm-space-6);
}

.mm-action-row .mm-btn--text {
  align-self: center;
}

/* A module wrapper around one button (the login form's .sign-up-wrapper)
   takes no box of its own, so its button lays out as a row item. */
.mm-action-row > :not(.mm-btn):has(> .mm-btn) {
  display: contents;
}

/* In a form the fields are 16 px apart (fields.css); 8 px more makes the
   brandbook's 24 px above the row. */
.mm-form > .mm-action-frame > .mm-action-row,
.mm-form > .form-button-group {
  margin-top: var(--mm-space-2);
}

.form-button-group > .mm-action-frame > .mm-action-row {
  margin-top: 0;
}

@container (min-width: 480px) {
  .mm-action-row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--mm-space-3);
  }

  .mm-action-row .mm-btn--text {
    align-self: auto;
  }
}
