/* Form spacing is opt-in so inline and action-row submits stay aligned. */
form > button[type="submit"],
form > input[type="submit"] {
  margin-top: 0;
}

.tpg-stacked-form > button[type="submit"],
.tpg-stacked-form > input[type="submit"] {
  margin-top: 2em;
}

.tpg-action-strip,
.tpg-action-strip > form {
  margin-top: 0;
}

.tpg-action-strip > button[type="submit"],
.tpg-action-strip > input[type="submit"],
.tpg-action-strip form > button[type="submit"],
.tpg-action-strip form > input[type="submit"] {
  margin-top: 0;
}

.tpg-media-library-filters > button[type="submit"],
.tpg-media-library-filters > input[type="submit"],
.workspace-sidebar-block-actions form > button[type="submit"],
.workspace-sidebar-block-actions form > input[type="submit"] {
  margin-top: 0;
}

/* Multi-step workflow forms (.tpg-workflow-layout renders crispy-bootstrap5
   fields with the label above the control). Only inside the workflow layout,
   replace the legacy floating-label conventions from base.css: the italic,
   padded global label, the 3em fieldset padding, the 60px textarea, help text
   brighter than its label, and the sibling-order required asterisk that never
   matches crispy's label-first markup. Tokens only; no page selectors. */
.tpg-workflow-layout__main fieldset {
  padding-top: 0;
  padding-bottom: 0;
}

.tpg-workflow-layout__main legend {
  margin-bottom: 1rem;
}

.tpg-workflow-layout .form-label {
  display: block;
  margin-bottom: 0.375rem;
  padding: 0;
  color: var(--bs-secondary-color);
  font-size: 0.8125rem;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

[data-bs-theme=dark] .tpg-workflow-layout .form-label {
  color: var(--tpg-300);
}

.tpg-workflow-layout__main .tpg-toggle .form-check-label {
  font-style: normal;
  font-weight: 500;
}

.tpg-workflow-layout .asteriskField {
  margin-left: 0.125rem;
  color: var(--tpg-danger);
  font-weight: 700;
}

.tpg-workflow-layout__main .form-text {
  margin-top: 0.375rem;
  color: var(--tpg-report-muted) !important;
  font-size: 0.8125rem;
}

.tpg-workflow-layout__main textarea.form-control {
  height: auto;
  min-height: 7.5rem;
}

.tpg-workflow-layout__main .input-group > .input-group-text {
  color: var(--bs-secondary-color);
  background-color: var(--form-control-background);
  border-color: var(--bs-border-color);
  font-weight: 500;
}

.tpg-workflow-layout__main .repc-file-input-group:has(.required, [required], [aria-required="true"]) label.repc-file-input-card {
  position: relative;
}

.tpg-workflow-layout__main .repc-file-input-group:has(.required, [required], [aria-required="true"]) label.repc-file-input-card::after {
  content: "*";
  position: absolute;
  top: 0.65rem;
  right: 0.85rem;
  color: var(--tpg-danger);
  font-size: 0.95rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}
