.Root {
  color: var(--demo-neutral-fg);
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 0.25rem;
  width: 100%;
  max-width: 24rem;

  &[data-disabled] {
    opacity: 0.5;
    filter: grayscale(100%);
  }

  &[data-inline] {
    width: auto;
  }
}

.Label {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--demo-neutral-fg);
}

.ErrorText {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--demo-coral-fg);
}

.HelperText {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--demo-neutral-fg-muted);
}

.Input {
  width: 100%;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  background: transparent;
  border: 1px solid var(--demo-border-emphasized);
  border-radius: 0.375rem;
  color: var(--demo-neutral-fg);
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;

  &::placeholder {
    color: var(--demo-neutral-emphasized);
  }

  &:focus {
    border-color: var(--demo-coral-solid);
    box-shadow: 0 0 0 1px var(--demo-coral-solid);
  }

  &[data-invalid] {
    border-color: var(--demo-coral-fg);

    &:focus {
      border-color: var(--demo-coral-fg);
      box-shadow: 0 0 0 1px var(--demo-coral-fg);
    }
  }
}

.Textarea {
  width: 100%;
  min-width: 0;
  min-height: 5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-family: inherit;
  background: transparent;
  border: 1px solid var(--demo-border-emphasized);
  border-radius: 0.375rem;
  color: var(--demo-neutral-fg);
  outline: none;
  resize: vertical;
  scroll-padding-bottom: 0.5rem;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;

  &::placeholder {
    color: var(--demo-neutral-emphasized);
  }

  &:focus {
    border-color: var(--demo-coral-solid);
    box-shadow: 0 0 0 1px var(--demo-coral-solid);
  }

  &[data-invalid] {
    border-color: var(--demo-coral-fg);

    &:focus {
      border-color: var(--demo-coral-fg);
      box-shadow: 0 0 0 1px var(--demo-coral-fg);
    }
  }
}

.Select {
  width: 100%;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  padding-right: 2rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  background: transparent;
  border: 1px solid var(--demo-border-emphasized);
  border-radius: 0.375rem;
  color: var(--demo-neutral-fg);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236f6d66' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1rem;

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;

  &:focus {
    border-color: var(--demo-coral-solid);
    box-shadow: 0 0 0 1px var(--demo-coral-solid);
  }

  &[data-invalid] {
    border-color: var(--demo-coral-fg);

    &:focus {
      border-color: var(--demo-coral-fg);
      box-shadow: 0 0 0 1px var(--demo-coral-fg);
    }
  }
}
