/* Fieldset: a titled group of fields. */
.bootcn-fieldset {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
  max-width: 28rem;
  margin: 0;
  padding: 0;
  border: 0;
}

/* The legend is not a flex item, so it gets its own spacing. */
.bootcn-fieldset__legend {
  float: none;
  width: auto;
  margin: 0 0 0.25rem;
  padding: 0;
  font-size: 1rem;
  font-weight: 600;
}

.bootcn-fieldset__description {
  margin: 0;
  color: var(--bootcn-muted-foreground);
  font-size: 0.875rem;
}

/* Fields side by side, wrapping on narrow screens. */
.bootcn-field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 6.5rem), 1fr));
  gap: 1rem;
}

.bootcn-field__error {
  margin: 0;
  color: var(--bootcn-destructive-text);
  font-size: 0.875rem;
}

.bootcn-field > .bootcn-label {
  line-height: 1.25rem;
}

/* Horizontal: text on the left, control on the right. */
.bootcn-field.bootcn-field--horizontal {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: var(--bootcn-border-width) solid var(--bootcn-border-color);
  border-radius: var(--bootcn-radius-lg);
}

.bootcn-field__text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.bootcn-field--horizontal .bootcn-switch {
  display: block;
  margin: 0;
}
