/**
 * Field - Form field wrapper styles
 * @countermeasure/web-components/primitives/field
 */

.cmm-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cmm-field__label {
  display: inline-block;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: hsl(var(--foreground));
}

.cmm-field__required {
  color: var(--color-error-text);
  margin-left: 0.25rem;
}

.cmm-field__content {
  /* Slot for consumer-provided input elements */
}

.cmm-field__hint {
  font-size: 0.75rem;
  line-height: 1rem;
  color: hsl(var(--foreground) / 0.78);
}

.cmm-field__error {
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--color-error-text);
}

.cmm-field__hint:empty,
.cmm-field__error:empty {
  display: none;
}

.cmm-field--error .cmm-field__label {
  color: var(--color-error-text);
}
